modules/active+config: Allow multiple unnerfed channels

master
Luther Wen Xu 2020-01-05 17:00:23 +07:00
parent 828b942e68
commit 76b7aaa01a
Signed by: chanbakjsd
GPG Key ID: B7D77E3E9D102B70
2 changed files with 10 additions and 4 deletions

@ -22,7 +22,13 @@ func Reward(s *discordgo.Session, m *discordgo.MessageCreate) {
}
amountToIncrement := calculateIncrement(m.Author.ID)
if m.ChannelID != config.GeneralChannelID {
found := false
for _, v := range config.GeneralChannelID {
if v == m.ChannelID {
found = true
}
}
if !found {
amountToIncrement /= config.NotInGeneralNerf
}
multiplier, err := db.GetPrestigeMultiplier(m.Author.ID)

@ -18,7 +18,7 @@ type config struct {
}
type activeNerf struct {
GeneralChannelID string `json:"channelID"`
GeneralChannelID []string `json:"channelID"`
NotInGeneralNerf int `json:"nerfFactor"`
}
@ -61,7 +61,7 @@ func init() {
//Exposed Variables
var (
GeneralChannelID string
GeneralChannelID []string
NotInGeneralNerf int
)
var Admins []string