Files
tg-archive/src/messaging.rs
T
Elias Wendland 5a5f817df7
CI and release / Detect release commit (push) Successful in 2m42s
CI and release / Run tests (push) Successful in 7m18s
CI and release / Build and publish container (push) Failing after 5m12s
CI and release / Create release (push) Skipped
Initial commit
2026-08-07 11:54:42 +02:00

35 lines
898 B
Rust

use crate::{Context, Error};
use tracing::trace;
pub async fn trace_message(msg: &str, channel: String, guild: String) {
trace!(
"Saying \"{}\" in channel {} in guild {}",
msg, channel, guild
);
}
pub async fn edit_response_message<'a>(
response_message: &poise::ReplyHandle<'a>,
ctx: Context<'_>,
content: &str,
silent: bool,
) -> Result<(), Error> {
if silent {
response_message
.edit(
ctx,
poise::CreateReply::default()
.content(content)
.allowed_mentions(
poise::serenity_prelude::CreateAllowedMentions::new().empty_users(),
),
)
.await?;
} else {
response_message
.edit(ctx, poise::CreateReply::default().content(content))
.await?;
}
Ok(())
}