Move all commands to their own files

This commit is contained in:
jude
2024-02-17 18:55:16 +00:00
parent eb92eacb90
commit 4823754955
51 changed files with 1757 additions and 1699 deletions

View File

@ -2,12 +2,15 @@ use poise::{
serenity_prelude::{
http::CacheHttp,
model::id::{GuildId, UserId},
CreateInteractionResponseMessage,
CreateEmbedFooter, CreateInteractionResponseMessage,
},
CreateReply,
};
use crate::consts::{CNC_GUILD, SUBSCRIPTION_ROLES};
use crate::{
consts::{CNC_GUILD, SUBSCRIPTION_ROLES},
Context,
};
pub async fn check_subscription(cache_http: impl CacheHttp, user_id: impl Into<UserId>) -> bool {
if let Some(subscription_guild) = *CNC_GUILD {
@ -49,3 +52,15 @@ pub fn reply_to_interaction_response_message(
builder
}
pub fn footer(ctx: Context<'_>) -> CreateEmbedFooter {
let shard_count = ctx.serenity_context().cache.shard_count();
let shard = ctx.serenity_context().shard_id;
CreateEmbedFooter::new(format!(
"{}\nshard {} of {}",
concat!(env!("CARGO_PKG_NAME"), " ver ", env!("CARGO_PKG_VERSION")),
shard,
shard_count,
))
}