Compare commits
No commits in common. "8b001e499a1a38ab02ef30b1d3612154258128ba" and "2a42301c25e4a928a73bd2cfc9cab3e858fd14be" have entirely different histories.
8b001e499a
...
2a42301c25
@ -3,7 +3,6 @@ token = ""
|
|||||||
appid = ""
|
appid = ""
|
||||||
guildid = ""
|
guildid = ""
|
||||||
category_id = ""
|
category_id = ""
|
||||||
admin_roles = [""]
|
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
host = ""
|
host = ""
|
||||||
@ -12,4 +11,4 @@ name = ""
|
|||||||
username = ""
|
username = ""
|
||||||
password = ""
|
password = ""
|
||||||
|
|
||||||
|
admin_roles = [""]
|
||||||
|
21
main.go
21
main.go
@ -21,16 +21,16 @@ 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 {
|
||||||
Token string `toml:"token"`
|
Token string `toml:"token"`
|
||||||
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,11 +240,8 @@ var (
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, roleID := range config.Discord.AdminRoles {
|
for _, roleID := range config.AdminRoles {
|
||||||
err := client.ChannelPermissionSet(channel.ID, roleID, discordgo.PermissionOverwriteTypeRole, discordgo.PermissionViewChannel|discordgo.PermissionSendMessages, 0)
|
client.ChannelPermissionSet(channel.ID, roleID, discordgo.PermissionOverwriteTypeRole, discordgo.PermissionViewChannel, 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…
x
Reference in New Issue
Block a user