rand.Int() would panic when the max value is <= 0, which happens when
big.NewInt() was fed with a too large number. Avoid this by validating
the big.NewInt() return beforehand. Add error handling to all callers to
both gracefully return to IRC and to log an error message.
Rename the shadowed "max" variable whilst at it to avoid confusion.
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Some parts of the logic do not make use of the host column in the
players table, allow the field to be empty and do not query for an empty
value (which might return bogus entries) if no value is passed to the
lookup function.
This additionally avoids the need for the hardcoded initial host when
configuring the bot player.
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
reactivated bench with a 2400 limit
help command just outputs command structs because that's easier
lower all commands to account for caps mistakes
some hardcoded nick bits :\
removed disused db structs
added a link to source, healing
parse ints through one function and return helpful errors that can be used as return values
added more error checking
improved some output
made some more joke methods
lazily added more if conditions for people i'm sick of
added self reference, allowing the bot to accrue currency
messed about with some messages (removed swears, changed 'schlorped', etc)
improved send output
regular wattery to make 'wat' interesting