summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request 'Prevent dice overflow' (#27) from overflow into masterHEADmasterPratyush Desai2024-10-122-21/+110
|\ | | | | | | Reviewed-on: https://git.com.de/LibertaCasa/watbot/pulls/27
| * Prevent dice overflowGeorg Pfuetzenreuter2024-10-102-21/+110
|/ | | | | | | | | | 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>
* Merge pull request 'Configurable database path' (#26) from config into masterPratyush Desai2024-10-104-3/+7
|\ | | | | | | Reviewed-on: https://git.com.de/LibertaCasa/watbot/pulls/26
| * Configurable database pathGeorg Pfuetzenreuter2024-10-104-3/+7
|/ | | | | | | Allow the database file to reside in a user defined location instead of requiring it to be in the working directory. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
* Merge pull request 'Lower nickname in Jeopardy cashout' (#25) from ↵Pratyush Desai2024-10-101-1/+1
|\ | | | | | | | | | | jeopardylower into master Reviewed-on: https://git.com.de/LibertaCasa/watbot/pulls/25
| * Lower nickname in Jeopardy cashoutGeorg Pfuetzenreuter2024-10-091-1/+1
|/ | | | | | | Align with GetTarget() which is used in games to have consistent handling of nicknames regardless of their casing. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
* Merge pull request 'Improve Jeopardy cashout message' (#24) from jeopardymsg ↵Pratyush Desai2024-10-031-4/+36
|\ | | | | | | | | | | into master Reviewed-on: https://git.com.de/LibertaCasa/watbot/pulls/24
| * Improve Jeopardy cashout messageGeorg Pfuetzenreuter2024-10-031-4/+36
|/ | | | | | | | | | | | Print only a single message instead of one per winner to reduce chat clutter. Skip cashout to users who won less than the possible cashout value as limited by the division value to avoid congratulating someone who only gets 0. Abort should a regression cause the logic to process an empty set of finishers to prevent unexpected behavior. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
* Merge pull request 'Change host lookup to be optional' (#23) from dbhost ↵Pratyush Desai2024-10-032-2/+6
|\ | | | | | | | | | | into master Reviewed-on: https://git.com.de/LibertaCasa/watbot/pulls/23
| * Change host lookup to be optionalGeorg Pfuetzenreuter2024-10-022-2/+6
|/ | | | | | | | | | | 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>
* Merge pull request 'Strip formatting codes' (#19) from format into masterPratyush Desai2024-10-023-1/+5
|\ | | | | | | Reviewed-on: https://git.com.de/LibertaCasa/watbot/pulls/19
| * Strip formatting codesGeorg Pfuetzenreuter2024-10-023-1/+5
|/ | | | | | | | To allow for correct parsing of messages containing formatting codes and to avoid exploitation of unparseable messages, strip all formatting codes from a message when entering the parsing chain. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
* Merge pull request 'Implement Jeopardy cashout' (#18) from jeopardy into masterPratyush Desai2024-10-024-0/+115
|\ | | | | | | Reviewed-on: https://git.com.de/LibertaCasa/watbot/pulls/18
| * Explain Jeopardy finishers parsingGeorg Pfuetzenreuter2024-10-021-0/+11
| | | | | | | | | | | | Elaborate as the convoluted logic can be difficult to understand. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
| * Refactor integrationsGeorg Pfuetzenreuter2024-10-022-57/+87
| | | | | | | | | | | | | | Move to a separate file for better code structure and to avoid huge branching inside Msg(). Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
| * Implement Jeopardy cashoutGeorg Pfuetzenreuter2024-09-293-0/+74
|/ | | | | | | | | | | | | | | | | This adds integration between Watbot and the Limnoria Jeopardy plugin. If a game of Jeopardy ends, Watbot will parse the finishers message and pay a small share of the Jeopardy price money in the form of Watcoins. To avoid abuse, only Jeopardy finishing messages from authorized bots are considered. An IRC user is considered an authorized bot if the hostmask matches one of the configured bot hostmasks, and if the nickname is configured for "jeopardy" in the newly introduced bot games configuration. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net> Add sample message to Jeopardy logic Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
* Merge pull request 'Implement configuration file + automatic channel ↵Pratyush Desai2024-09-285-35/+159
|\ | | | | | | | | | | joining' (#14) from config into master Reviewed-on: https://git.com.de/LibertaCasa/watbot/pulls/14
| * Implement automatic channel joiningGeorg Pfuetzenreuter2024-09-283-1/+18
| | | | | | | | | | | | | | | | Avoid the need for an administrator to join the bot to channels by implementing a configuration option allowing the passing of channels the bot should always join to by itself upon startup. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
| * Replace redundant logic in Admin()Georg Pfuetzenreuter2024-09-281-7/+1
| | | | | | | | | | | | | | The Allowed() function already implements this loop, use it to reduce redundant code. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
| * Implement configuration fileGeorg Pfuetzenreuter2024-09-285-28/+141
|/ | | | | | | | Abstract settings which commonly differ between instances to a YAML based configuration file to allow for easy administration without the need for modifying the source code. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
* Merge pull request 'Remove count script' (#16) from count into masterPratyush Desai2024-09-241-2/+0
|\ | | | | | | Reviewed-on: https://git.com.de/LibertaCasa/watbot/pulls/16
| * Remove count scriptGeorg Pfuetzenreuter2024-09-241-2/+0
|/ | | | | | Unable to find a purpose. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
* Merge pull request 'Remove and ignore binary' (#15) from gitignore into masterPratyush Desai2024-09-242-0/+3
|\ | | | | | | Reviewed-on: https://git.com.de/LibertaCasa/watbot/pulls/15
| * Remove and ignore binaryGeorg Pfuetzenreuter2024-09-212-0/+3
|/ | | | | | Build artifacts shouldn't be tracked in version control. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
* Merge pull request 'Add myself as admin' (#12) from admin into masterPratyush Desai2024-09-211-1/+7
|\ | | | | | | Reviewed-on: https://git.com.de/LibertaCasa/watbot/pulls/12
| * Add myself as adminGeorg Pfuetzenreuter2024-09-211-1/+7
|/ | | | | | | For some administrative operations, such as joining channels, it would be useful if I could "imp"ersonate the bot. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
* Merge pull request 'Basic systemd service' (#4) from systemd into masterPratyush Desai2022-03-011-0/+14
|\ | | | | | | Reviewed-on: https://git.com.de/LibertaCasa/watbot/pulls/4
| * Init systemd servicesystemdGeorg Pfuetzenreuter2022-02-021-0/+14
|/ | | | Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
* initial commitmogad0n2021-03-107-18/+42
|
* fixes #8alex2019-09-221-1/+8
|
* fixes #9alex2019-09-221-1/+1
|
* fixes #5alex2019-07-102-0/+16
|
* fixes #6alex2019-06-281-2/+2
|
* fixes #7alex2019-06-284-32/+66
|
* moved config around somewhatalex2019-01-042-12/+38
|
* Added time limited bankrupcy, steroids for benching (don't persist across ↵alex2019-01-042-14/+84
| | | | restarts), removed aliases from command list, ping, strongest, don't allow vlk to roll.
* int64 -> uint64 for coins, disable noisy logging, turned off wattery (it was ↵alex2018-12-033-20/+15
| | | | quickly abused), made anarchy less likely to win and time limited
* CanAct func, used in Riot and Liftalex2018-11-162-2/+15
|
* added actions table, makes it easier to add time based commandsalex2018-11-152-42/+74
| | | | | | | | 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
* changed coins to uint64 and started using uints all over the placealex2018-11-143-35/+54
| | | | | added toplost removed an ignore
* formatting changes from goimportalex2018-11-083-103/+186
| | | | | | | | | 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
* nmalex2018-10-271-3/+5
|
* fixed rand to use crypto randalex2018-10-263-30/+52
| | | | | fixed imp with imps but should go back to privmsg detection give the bot money when people lose lel
* misc improvementsalex2018-10-253-29/+43
| | | | | | | 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
* added resting, messed about with stuffalex2018-10-232-20/+104
|
* fixed some bugs, fixed some debug behaviour, changed over to a command -> ↵alex2018-10-233-56/+101
| | | | method map to avoid sending spurious messages
* added admin command for impersonating any irc commandalex2018-10-212-14/+24
| | | | remove db
* Reimplemented python bot in golang, skipped a few featuresalex2018-10-216-9/+500
|
* Added flag lib for parsing env + flag + filealex2018-10-201-6/+10
|
* sorry for rehosting ur stuff (。◕ ‿ ◕。)alex2018-10-2010-1/+799
| | | | | | Added original source Fixed readme typo (I fat fingered your username again whoops) Fiddling with golang config
* Initial commitself2018-10-193-0/+24