only respond to upnext and nowplaying when tildebot not present

This commit is contained in:
vulpine 2020-07-21 16:24:26 +00:00
parent 295e760cb7
commit ca0d600a9d
1 changed files with 4 additions and 0 deletions

View File

@ -119,6 +119,8 @@ def formatSec(dt):
async def upnext(self,c,n,m):
if '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:
js = res.json()
@ -131,6 +133,8 @@ 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']:
return # only respond in #tr whilst tildebot is down
res = requests.get("https://radio.tildeverse.org/api/nowplaying/1")
if res.status_code == 200:
js = res.json()