introduce direct message support, add back fixed event loop
This commit is contained in:
13
idlebot.py
13
idlebot.py
@@ -110,6 +110,19 @@ def start(botclass, active=False):
|
||||
|
||||
config.runtimeconf_set('start_time', -time.time())
|
||||
|
||||
while 1:
|
||||
try:
|
||||
# print("hangup: %s" % got_hangup)
|
||||
if not plugins.event_trigger():
|
||||
bot.hangup()
|
||||
if bot.state.current_state() == 'disconnected':
|
||||
exit(0)
|
||||
|
||||
time.sleep(EVENTLOOP_DELAY)
|
||||
except KeyboardInterrupt:
|
||||
print('')
|
||||
exit(130)
|
||||
|
||||
|
||||
if '__main__' == __name__:
|
||||
start(IdleBot)
|
||||
|
||||
Reference in New Issue
Block a user