Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolate bot channel #36

Merged
merged 3 commits into from
Oct 26, 2023
Merged

Isolate bot channel #36

merged 3 commits into from
Oct 26, 2023

Conversation

ctmbl
Copy link
Contributor

@ctmbl ctmbl commented Oct 15, 2023

This PR adds a little global check in root_pythia_bot.py that prevents the bot to respond in another channel than the one it is assign to.
This is really annoying when a development instance is up to have both bots (production and development) respondoing to every command, it can also mess with the prod bot DB.
The global check returns false if the context channel (the one form which the command is triggered) ID is different from CHANNEL_ID (the channel where the bot ping on new solves), making the command to be aborted, raisign an exception caught in on_command_error and ignored after logging a warning

TODO: this could be cool to make this behavior configurable in .env or other configuration (even dynamic with some bot API?)

@ctmbl ctmbl requested review from atxr, Xlitoni and J3y0 October 15, 2023 21:29
@ctmbl ctmbl self-assigned this Oct 15, 2023
@ctmbl ctmbl force-pushed the isolate-bot-channel branch from 78ad845 to 5397df6 Compare October 15, 2023 21:32
@ctmbl ctmbl force-pushed the isolate-bot-channel branch from 5397df6 to d1613c3 Compare October 18, 2023 18:23
@ctmbl ctmbl force-pushed the isolate-bot-channel branch from d5c94cd to 924bcd6 Compare October 18, 2023 22:53
@ctmbl ctmbl merged commit af65bdb into iScsc:main Oct 26, 2023
2 checks passed
@ctmbl ctmbl deleted the isolate-bot-channel branch October 26, 2023 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants