-
Notifications
You must be signed in to change notification settings - Fork 168
Add timer hooks #171
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
base: master
Are you sure you want to change the base?
Add timer hooks #171
Conversation
Timers are called when someone speaks anywhere for the first time. Use @hook.event('004') to start timers on bot connect.
Thank you |
There seem to be two bugs with this. 1). The timer does not start until someone interacts with the bot. 2). "return" and "print" don't print to IRC. (they do, however, print to the console window.) I made a fresh clone of your fork to make sure the issue wasn't from something else and it's still happening. Using your exact example plugin code, too. I'm sure I'm missing something obvious here, but "say", "message", "return" and "print" don't send text to IRC. I tried to look at the command function to see how it passes information to IRC, and all I can tell is that it just "returns" it. It looks like dispatch doesn't have a way to handle input from a timer. See here: https://github.com/Red-M/skybot/blob/f051014fca683b3f309ef9655fd513f22c9fef35/core/main.py#L132-L153 |
You just need to find the IRC server object in I did put that timers won't start until someone says something in the commits. An example for messaging a channel using default config values:
I've included this in the PR comment for future use. |
Did this work for you? |
Prevention of duplicate timers should also be implemented in my opinion. Event 004 can trigger multiple times if the network connection is flaky, which would lead to multiple running timers for the same hook. |
#105 😃
Timers are called when someone speaks anywhere for the first time and only once. Use
@hook.event('004')
to start timers on bot connect.An example:
An example for messaging a channel using default config values and at bot start up: