1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

leggermente meglio

This commit is contained in:
Steffo 2016-09-04 20:24:58 +02:00
parent 7160b367cf
commit b4d1d3a8f6
2 changed files with 8 additions and 10 deletions

13
bot.py
View file

@ -308,10 +308,7 @@ def cv():
m['emoji'] = chr(128264)
else:
m['emoji'] = chr(128266)
for channel in r['channels']:
if member['channel_id'] == channel['id']:
m['channelname'] = channel['name']
break
m['channelname'] = discord.getchannelname(r, member['channel_id'])
else:
if member['status'] == "online":
if 'game' in member:
@ -332,13 +329,9 @@ def cv():
else:
tosend += "{emoji} {name}\n".format(**m)
# Controlla se l'utente è royal music
elif 'id' == "176358898851250176":
elif member['id'] == "176358898851250176":
if 'game' in member:
for channel in r['channels']:
if member['channel_id'] == channel['id']:
musicchannel = channel['name']
break
# Todo: migliorami
musicchannel = discord.getchannelname(r, member['channel_id'])
musicstatus = "{emoji} *{channelname}* {songname}\n".format(emoji="\U0001F3B5",
channelname=musicchannel,
songname=member['game']['name'])

View file

@ -9,3 +9,8 @@ def getwidgetdata(token):
else:
# Sì, dovrei fare una DiscordException
raise Exception("Qualcosa di discord non va")
def getchannelname(r, id):
for channel in r['channels']:
if id == channel['id']:
return channel['name']