ImplResetting #2
9
main.go
9
main.go
@ -23,7 +23,6 @@ var (
|
|||||||
type Config struct {
|
type Config struct {
|
||||||
Discord Discord `toml:"discord"`
|
Discord Discord `toml:"discord"`
|
||||||
Database Database `toml:"database"`
|
Database Database `toml:"database"`
|
||||||
AdminRoles []string `toml:"admin_roles"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Discord struct {
|
type Discord struct {
|
||||||
@ -31,6 +30,7 @@ type Discord struct {
|
|||||||
AppID string `toml:"appid"`
|
AppID string `toml:"appid"`
|
||||||
GuildID string `toml:"guildid"`
|
GuildID string `toml:"guildid"`
|
||||||
CategoryID string `toml:"category_id"`
|
CategoryID string `toml:"category_id"`
|
||||||
|
AdminRoles []string `toml:"admin_roles"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Database struct {
|
type Database struct {
|
||||||
@ -240,8 +240,11 @@ var (
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, roleID := range config.AdminRoles {
|
for _, roleID := range config.Discord.AdminRoles {
|
||||||
client.ChannelPermissionSet(channel.ID, roleID, discordgo.PermissionOverwriteTypeRole, discordgo.PermissionViewChannel, 0)
|
err := client.ChannelPermissionSet(channel.ID, roleID, discordgo.PermissionOverwriteTypeRole, discordgo.PermissionViewChannel|discordgo.PermissionSendMessages, 0)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("Error setting permissions for role %s: %v", roleID, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = client.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
err = client.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
||||||
|
Loading…
Reference in New Issue
Block a user