use consistent guild getter syntax
This commit is contained in:
@@ -6,10 +6,8 @@ use poise::serenity_prelude as serenity;
|
||||
/// Register an existing role as a user's custom role. This deletes their current self role.
|
||||
#[poise::command(slash_command, prefix_command, required_permissions = "MANAGE_ROLES")]
|
||||
pub async fn register(ctx: Context<'_>, user: serenity::User, role: serenity::Role) -> Result<(), Error> {
|
||||
let guild = if let Some(guild) = ctx.guild_id() {
|
||||
guild
|
||||
} else {
|
||||
ctx.reply("This command can only be run inside of a guild.").await?;
|
||||
let Some(guild) = ctx.guild_id() else {
|
||||
ctx.reply("This command must be ran within a guild.").await?;
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user