|
|
|
@ -32,7 +32,7 @@ class ReplayBot(irc.bot.SingleServerIRCBot):
|
|
|
|
|
self.output_channel = '#{0}'.format(self.config['IRC'].get('output_channel'))
|
|
|
|
|
control_channel = self.config['IRC'].get('control_channel')
|
|
|
|
|
self.control_channel = '#{0}'.format(control_channel) if control_channel else None
|
|
|
|
|
self.control_user = self.config['IRC'].getint('control_user')
|
|
|
|
|
self.control_users = self.config['IRC'].get('control_users').split(',')
|
|
|
|
|
server = self.config['IRC'].get('server')
|
|
|
|
|
port = self.config['IRC'].getint('port')
|
|
|
|
|
nickname = self.config['IRC'].get('nickname')
|
|
|
|
@ -77,7 +77,7 @@ class ReplayBot(irc.bot.SingleServerIRCBot):
|
|
|
|
|
action(tags, send_response, **m.groupdict())
|
|
|
|
|
|
|
|
|
|
def _do_load(self, tags, send_response, id, **kwargs):
|
|
|
|
|
if int(tags['user-id']) != self.control_user:
|
|
|
|
|
if tags['user-id'] not in self.control_users:
|
|
|
|
|
send_response('Sorry @{0}, you are not allowed to do this'.format(tags['display-name']))
|
|
|
|
|
return
|
|
|
|
|
client_id = self.config['Twitch'].get('client_id')
|
|
|
|
@ -106,7 +106,7 @@ class ReplayBot(irc.bot.SingleServerIRCBot):
|
|
|
|
|
send_response('@{0}: failed to load messages'.format(tags['display-name']))
|
|
|
|
|
|
|
|
|
|
def _do_start(self, tags, send_response, at=None, **kwargs):
|
|
|
|
|
if int(tags['user-id']) != self.control_user:
|
|
|
|
|
if tags['user-id'] not in self.control_users:
|
|
|
|
|
send_response('Sorry @{0}, you are not allowed to do this'.format(tags['display-name']))
|
|
|
|
|
return
|
|
|
|
|
if at is None:
|
|
|
|
@ -119,7 +119,7 @@ class ReplayBot(irc.bot.SingleServerIRCBot):
|
|
|
|
|
self.reactor.scheduler.execute_at(t + offset, cb)
|
|
|
|
|
|
|
|
|
|
def _do_resync(self, tags, send_response, offset, **kwargs):
|
|
|
|
|
if int(tags['user-id']) != self.control_user:
|
|
|
|
|
if tags['user-id'] not in self.control_users:
|
|
|
|
|
send_response('Sorry @{0}, you are not allowed to do this'.format(tags['display-name']))
|
|
|
|
|
return
|
|
|
|
|
offset = datetime.timedelta(seconds=float(offset))
|
|
|
|
@ -131,7 +131,7 @@ class ReplayBot(irc.bot.SingleServerIRCBot):
|
|
|
|
|
self.reactor.scheduler.queue[i] = ndc
|
|
|
|
|
|
|
|
|
|
def _do_stop(self, tags, send_response, **kwargs):
|
|
|
|
|
if int(tags['user-id']) != self.control_user:
|
|
|
|
|
if tags['user-id'] not in self.control_users:
|
|
|
|
|
send_response('Sorry @{0}, you are not allowed to do this'.format(tags['display-name']))
|
|
|
|
|
return
|
|
|
|
|
with self.reactor.mutex:
|
|
|
|
|