tried adding notify command
This commit is contained in:
@@ -23,7 +23,7 @@ func ready(s *discordgo.Session, event *discordgo.Ready) {
|
||||
_, err := s.ApplicationCommandCreate(s.State.User.ID, guild.ID, &command.Definition)
|
||||
if err != nil {
|
||||
fmt.Println("error creating command,", err)
|
||||
continue // Continue to the next guild
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,36 +64,3 @@ func removeCommandFromAllGuilds(s *discordgo.Session) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
func hasManageServerPermissions(s *discordgo.Session, userID string, guildID string) bool {
|
||||
member, err := s.GuildMember(guildID, userID)
|
||||
if err != nil {
|
||||
fmt.Printf("Error fetching guild member: %v\n", err)
|
||||
return false
|
||||
}
|
||||
|
||||
guild, err := s.Guild(guildID)
|
||||
if err != nil {
|
||||
fmt.Printf("Error fetching guild: %v\n", err)
|
||||
return false
|
||||
}
|
||||
|
||||
if guild.OwnerID == userID {
|
||||
return true
|
||||
}
|
||||
|
||||
for _, roleID := range member.Roles {
|
||||
role, err := s.State.Role(guildID, roleID)
|
||||
if err != nil {
|
||||
fmt.Printf("Error fetching role: %v\n", err)
|
||||
continue
|
||||
}
|
||||
if role.Permissions&discordgo.PermissionManageServer != 0 || role.Permissions&discordgo.PermissionAdministrator != 0 {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
*/
|
||||
|
Reference in New Issue
Block a user