mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
leggermente meglio
This commit is contained in:
parent
7160b367cf
commit
b4d1d3a8f6
2 changed files with 8 additions and 10 deletions
13
bot.py
13
bot.py
|
@ -308,10 +308,7 @@ def cv():
|
||||||
m['emoji'] = chr(128264)
|
m['emoji'] = chr(128264)
|
||||||
else:
|
else:
|
||||||
m['emoji'] = chr(128266)
|
m['emoji'] = chr(128266)
|
||||||
for channel in r['channels']:
|
m['channelname'] = discord.getchannelname(r, member['channel_id'])
|
||||||
if member['channel_id'] == channel['id']:
|
|
||||||
m['channelname'] = channel['name']
|
|
||||||
break
|
|
||||||
else:
|
else:
|
||||||
if member['status'] == "online":
|
if member['status'] == "online":
|
||||||
if 'game' in member:
|
if 'game' in member:
|
||||||
|
@ -332,13 +329,9 @@ def cv():
|
||||||
else:
|
else:
|
||||||
tosend += "{emoji} {name}\n".format(**m)
|
tosend += "{emoji} {name}\n".format(**m)
|
||||||
# Controlla se l'utente è royal music
|
# Controlla se l'utente è royal music
|
||||||
elif 'id' == "176358898851250176":
|
elif member['id'] == "176358898851250176":
|
||||||
if 'game' in member:
|
if 'game' in member:
|
||||||
for channel in r['channels']:
|
musicchannel = discord.getchannelname(r, member['channel_id'])
|
||||||
if member['channel_id'] == channel['id']:
|
|
||||||
musicchannel = channel['name']
|
|
||||||
break
|
|
||||||
# Todo: migliorami
|
|
||||||
musicstatus = "{emoji} *{channelname}* {songname}\n".format(emoji="\U0001F3B5",
|
musicstatus = "{emoji} *{channelname}* {songname}\n".format(emoji="\U0001F3B5",
|
||||||
channelname=musicchannel,
|
channelname=musicchannel,
|
||||||
songname=member['game']['name'])
|
songname=member['game']['name'])
|
||||||
|
|
|
@ -9,3 +9,8 @@ def getwidgetdata(token):
|
||||||
else:
|
else:
|
||||||
# Sì, dovrei fare una DiscordException
|
# Sì, dovrei fare una DiscordException
|
||||||
raise Exception("Qualcosa di discord non va")
|
raise Exception("Qualcosa di discord non va")
|
||||||
|
|
||||||
|
def getchannelname(r, id):
|
||||||
|
for channel in r['channels']:
|
||||||
|
if id == channel['id']:
|
||||||
|
return channel['name']
|
||||||
|
|
Loading…
Reference in a new issue