Explorar el Código

refactor(cmd): move var inside the if statement

ayn2op hace 9 meses
padre
commit
628d17e45b
Se han modificado 1 ficheros con 1 adiciones y 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