refactor(cmd): move var inside the if statement
This commit is contained in:
parent
a80c5bff2a
commit
628d17e45b
1 changed files with 1 additions and 1 deletions
|
|
@ -511,8 +511,8 @@ func (ml *messagesList) delete() {
|
|||
return
|
||||
}
|
||||
|
||||
clientID := discordState.Ready().User.ID
|
||||
if msg.GuildID.IsValid() {
|
||||
clientID := discordState.Ready().User.ID
|
||||
if msg.Author.ID != clientID && !discordState.HasPermissions(msg.ChannelID, discord.PermissionManageMessages) {
|
||||
slog.Error("failed to delete message; missing relevant permissions", "channel_id", msg.ChannelID, "message_id", msg.ID)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue