|
|
|
@ -49,6 +49,7 @@ class TwitchClient(irc.bot.SingleServerIRCBot):
|
|
|
|
|
(re.compile(r'^!(bella(gram|pics)|insta(gram|bella))$'), self._do_bellagram),
|
|
|
|
|
(re.compile(r'^!yt\s+(?P<q>")?(?P<query>.+)(?(q)")$'), self._do_yt),
|
|
|
|
|
(re.compile(r'^!clip\s+(?P<q>")?(?P<filter>.+)(?(q)")$'), self._do_clip),
|
|
|
|
|
(re.compile(r'^!reload$'), self._do_reload),
|
|
|
|
|
]
|
|
|
|
|
server = self.config['IRC'].get('server')
|
|
|
|
|
port = self.config['IRC'].getint('port')
|
|
|
|
@ -186,3 +187,11 @@ class TwitchClient(irc.bot.SingleServerIRCBot):
|
|
|
|
|
send_response('Sorry @{0}, {1}'.format(tags['display-name'], e))
|
|
|
|
|
else:
|
|
|
|
|
send_response('{0}: {1}'.format(result['title'], result['url']))
|
|
|
|
|
|
|
|
|
|
def _do_reload(self, tags, send_response, **kwargs):
|
|
|
|
|
master_user_id = self.config['Twitch'].getint('master_user_id')
|
|
|
|
|
if int(tags['user-id']) != master_user_id:
|
|
|
|
|
respond('Sorry @{0}, you are not allowed to do this'.format(tags['display-name']))
|
|
|
|
|
return
|
|
|
|
|
self.config.remove_section('Extra Commands')
|
|
|
|
|
self.config.read('settings.cfg')
|
|
|
|
|