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

TwitchBot does not ignore own nick if used by another bot #75

Open
ghost opened this issue May 22, 2020 · 1 comment
Open

TwitchBot does not ignore own nick if used by another bot #75

ghost opened this issue May 22, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented May 22, 2020

I have two bots using the same bot account on Twitch, with different OAuth tokens.

When pinhook sends messages, it does not trigger its own listener, which is good. If the other bot sends a message using the same nick, it causes pinhook to trigger listeners and commands even when pinhook's bot name is added to banned_users:

I can work around this by adding the following code, but it is tedious to do it for every plugin:

if msg.nick != "pyllybot":
    # plugin code here

Ideally, the bot should always be ignoring its own nick.

Note: pinhook has the command !ping and the other bot has !ding

Here is a log generate for this issue:

2020-05-22 15:36:40,393 - INFO - bot - Logging started!
2020-05-22 15:36:40,393 - INFO - bot - Joining Twitch Server
2020-05-22 15:36:40,393 - DEBUG - plugin - []
2020-05-22 15:36:40,393 - INFO - plugin - clearing plugin cache
2020-05-22 15:36:40,393 - INFO - plugin - checking plugin directory
2020-05-22 15:36:40,393 - INFO - plugin - loading plugin test_plugin
2020-05-22 15:36:40,393 - DEBUG - plugin - adding command !ping
2020-05-22 15:36:40,393 - DEBUG - plugin - adding listener echo
2020-05-22 15:36:40,393 - DEBUG - pyllybot - Banned users: pyllybot, buttsbot
2020-05-22 15:36:41,034 - INFO - bot - requesting permissions
2020-05-22 15:36:41,034 - INFO - bot - Joining channel #siinacutie
2020-05-22 15:36:45,228 - DEBUG - bot - Message info: channel: #siinacutie, nick: siinacutie, cmd: !ping, text: !ping
2020-05-22 15:36:45,228 - DEBUG - bot - executing !ping
2020-05-22 15:36:45,228 - DEBUG - bot - returning output: ['is pinged!']
2020-05-22 15:36:45,228 - DEBUG - bot - sending output: ['is pinged!']
2020-05-22 15:36:45,228 - DEBUG - bot - output action: is pinged!
2020-05-22 15:36:49,415 - DEBUG - bot - Message info: channel: #siinacutie, nick: siinacutie, cmd: !ding, text: !ding
2020-05-22 15:36:49,415 - DEBUG - bot - whispering to listener: echo
2020-05-22 15:36:49,614 - DEBUG - bot - Message info: channel: #siinacutie, nick: pyllybot, cmd: Dong!, text: Dong!
2020-05-22 15:36:49,615 - DEBUG - bot - whispering to listener: echo
2020-05-22 15:36:49,615 - INFO - test_plugin - Echoing user: pyllybot
2020-05-22 15:36:49,615 - DEBUG - bot - returning output: ['Dong!']
2020-05-22 15:36:49,615 - DEBUG - bot - sending output: ['Dong!']
2020-05-22 15:36:49,615 - DEBUG - bot - output message: Dong!
@archangelic
Copy link
Owner

archangelic commented May 25, 2020

I've pushed a fix to the twitch_fix branch (which i'm now using as a release branch because I'm lazy). Basically the bot will not process any event if the nick is the same as the self.bot_nick. This might be overkill but that makes some implicit behavior explicit in the code.

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

No branches or pull requests

1 participant