Skip to content

Commit

Permalink
Add "Debug Embeds" command
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinegb committed Apr 16, 2024
1 parent fb1c800 commit ad7c2c1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/debug.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use poise::serenity_prelude::Message;
use tracing::debug;

use crate::{Context, Error};

#[poise::command(context_menu_command = "Debug Embeds", owners_only, ephemeral)]
pub(super) async fn embeds(ctx: Context<'_>, message: Message) -> Result<(), Error> {
debug!("{:#?}", message.embeds);
ctx.say(format!("```rs\n{:#?}\n```", message.embeds))
.await?;

Ok(())
}
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@
mod boredom;
mod collective;
mod confess;
mod debug;
mod portside;
mod rp_commands;
mod utility;

use std::{
collections::HashSet,
fmt,
sync::{atomic::AtomicBool, Arc},
};

use anyhow::Context as _;
use poise::serenity_prelude::{ClientBuilder, FullEvent, GatewayIntents, GuildId};
use poise::serenity_prelude::{ClientBuilder, FullEvent, GatewayIntents, GuildId, UserId};
use shuttle_runtime::SecretStore;
use shuttle_serenity::ShuttleSerenity;
use tracing::info;
Expand Down Expand Up @@ -141,6 +143,7 @@ async fn main(#[shuttle_runtime::Secrets] secret_store: SecretStore) -> ShuttleS
pat(),
confess(),
collective(),
debug::embeds(),
],
event_handler: |ctx, event, _framework, _data| {
Box::pin(async move {
Expand All @@ -160,6 +163,7 @@ async fn main(#[shuttle_runtime::Secrets] secret_store: SecretStore) -> ShuttleS
Ok(())
})
},
owners: HashSet::from([UserId::new(1016154932354744330)]),
..Default::default()
})
.setup(|ctx, _ready, framework| {
Expand Down

0 comments on commit ad7c2c1

Please sign in to comment.