Implement Jeopardy cashout #18

Merged
pratyush merged 3 commits from jeopardy into master 2024-10-02 20:07:10 +02:00
Owner

This depends on #14, which should be reviewed and merged first. Afterwards the patch here can be rebased and marked as ready.

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.

This depends on https://git.com.de/LibertaCasa/watbot/pulls/14, which should be reviewed and merged first. Afterwards the patch here can be rebased and marked as ready. 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.
Georg added 4 commits 2024-09-22 17:48:09 +02:00
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>
The Allowed() function already implements this loop, use it to reduce
redundant code.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
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>
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>
Georg force-pushed jeopardy from b7f2ad6dcd to e91af7c0f6 2024-09-28 19:44:17 +02:00 Compare
Georg changed title from WIP: Implement Jeopardy cashout to Implement Jeopardy cashout 2024-09-28 19:44:22 +02:00
Author
Owner

The parsing could be done nicer by having katyusha send a special JSON formatted PRIVMSG with the information to watbot, but I think the slightly unorthodox parsing logic here still outweighs having to fork and modify the Limnoria plugin.

The parsing could be done nicer by having katyusha send a special JSON formatted PRIVMSG with the information to watbot, but I think the slightly unorthodox parsing logic here still outweighs having to fork and modify the Limnoria plugin.
Georg added 1 commit 2024-09-28 20:17:23 +02:00
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Georg force-pushed jeopardy from fc4409c1c9 to 984e86a123 2024-09-29 14:39:02 +02:00 Compare
Author
Owner

Improved this a bit by refactoring the new logic to a separate file and function now.

Improved this a bit by refactoring the new logic to a separate file and function now.
Georg force-pushed jeopardy from 984e86a123 to 82534a9030 2024-09-29 14:45:09 +02:00 Compare
Georg added 1 commit 2024-10-01 20:56:28 +02:00
Elaborate as the convoluted logic can be difficult to understand.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
pratyush requested changes 2024-10-02 19:59:41 +02:00
@ -0,0 +40,4 @@
}
func (w *WatIntegration) HandleIntegration(m *irc.Message, msgargs []string) bool {
Owner

empty line not needed here, right?

empty line not needed here, right?
Author
Owner

Good point, the other functions do not have it either.

Good point, the other functions do not have it either.
Georg marked this conversation as resolved
@ -0,0 +49,4 @@
return true
}
}
Owner

I think here neither.

I think here neither.
Author
Owner

I would prefer to have it here for better structure, but I get Bot() does not separate the return either, similar to the functions in the other file.

I would prefer to have it here for better structure, but I get `Bot()` does not separate the `return` either, similar to the functions in the other file.
Georg marked this conversation as resolved
Georg force-pushed jeopardy from ab92441200 to 89ed59a9c7 2024-10-02 20:04:05 +02:00 Compare
pratyush merged commit a5cc5e0317 into master 2024-10-02 20:07:10 +02:00
pratyush deleted branch jeopardy 2024-10-02 20:07:11 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: LibertaCasa/watbot#18
No description provided.