1
0
mirror of https://github.com/velour/catbase.git synced 2025-04-05 12:31:42 +00:00

Merge f2309b9090920146be409fa3517a368afed21311 into 98298dfb84384d835bbebcaf07a519edf6336b15

This commit is contained in:
Scott Kiesel 2017-06-07 02:22:53 +00:00 committed by GitHub
commit e7352e9f16
3 changed files with 22 additions and 0 deletions

@ -57,6 +57,7 @@ type Config struct {
YourChance float64
FuckingChance float64
DuckingChance float64
NegativeChance float64
MaxLength int
}
LeftPad struct {

@ -48,6 +48,7 @@
"YourChance": 0.4,
"FuckingChance": 0.15,
"DuckingChance": 0.5,
"NegativeChance": 0.5,
"MaxLength": 140
},
"LeftPad": {

@ -63,6 +63,26 @@ func (p *YourPlugin) Message(message msg.Message) bool {
return true
}
}
if strings.Contains(message.Body, " is ") {
log.Println("Found an is")
if rand.Float64() < config.NegativeChance {
log.Println("Replacing an is")
r := strings.NewReplacer(" is ", " is not ")
msg := r.Replace(message.Body)
p.bot.SendMessage(message.Channel, msg)
return true
}
}
if strings.Contains(message.Body, " are ") {
log.Println("Found an are")
if rand.Float64() < config.NegativeChance {
log.Println("Replacing an are")
r := strings.NewReplacer(" are ", " are not ")
msg := r.Replace(message.Body)
p.bot.SendMessage(message.Channel, msg)
return true
}
}
return false
}