Compare commits

...

3 Commits

Author SHA1 Message Date
vulpine 2888fa2fbd loggy 2020-08-02 02:31:05 +00:00
vulpine b1299b7752 enable radio commands with env var if tildebot is being unusable 2020-08-02 02:18:38 +00:00
vulpine 1e50154087 always allow radio commands in a dm 2020-08-02 02:15:16 +00:00
2 changed files with 4 additions and 2 deletions

View File

@ -2,6 +2,7 @@
import random
async def owologger(self,c,n,m):
print("<{} {}> {}".format(c,n,m))
if m[:len(self.prefix)] == self.prefix:
return
if c not in self.owolog:

View File

@ -119,7 +119,7 @@ def formatSec(dt):
async def upnext(self,c,n,m):
if 'tildebot' in self.channels[c]['users']:
if self.tildebot and c in self.channels and 'tildebot' in self.channels[c]['users']:
return # only respond in #tr whilst tildebot is down
res = requests.get('https://radio.tildeverse.org/api/station/1/schedule')
if res.status_code == 200:
@ -133,7 +133,7 @@ async def upnext(self,c,n,m):
await self.message(c,'[\x036radio\x0f] something went wrong...')
async def nowplaying(self,c,n,m):
if 'tildebot' in self.channels[c]['users']:
if self.tildebot and c in self.channels and 'tildebot' in self.channels[c]['users']:
return # only respond in #tr whilst tildebot is down
res = requests.get("https://radio.tildeverse.org/api/nowplaying/1")
if res.status_code == 200:
@ -200,6 +200,7 @@ async def remindTask(self, n, up, delta_time,c):
async def init(self):
self.tildebot = True
self.rreminders = {}
self.cmd['un'] = upnext
self.cmd['upnext'] = upnext