Explorar o código

refactor(cmd): move var inside the if statement

ayn2op hai 9 meses
pai
achega
628d17e45b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      cmd/messages_list.go

+ 1 - 1
cmd/messages_list.go

@@ -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