mirror of https://github.com/velour/catbase.git
give catbase some negative back talk
This commit is contained in:
parent
b0210fd240
commit
f2309b9090
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue