Skip to content

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

Description

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions