1
0
mirror of https://xfnw.ttm.sh/git/oirc.git synced 2024-06-12 20:06:37 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
2888fa2fbd loggy 2020-08-02 02:31:05 +00:00
b1299b7752 enable radio commands with env var if tildebot is being unusable 2020-08-02 02:18:38 +00:00
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 import random
async def owologger(self,c,n,m): async def owologger(self,c,n,m):
print("<{} {}> {}".format(c,n,m))
if m[:len(self.prefix)] == self.prefix: if m[:len(self.prefix)] == self.prefix:
return return
if c not in self.owolog: if c not in self.owolog:

View File

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