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

Migliorato /cv

This commit is contained in:
Steffo 2016-10-03 09:37:16 +02:00 committed by GitHub
parent 72c6a02a67
commit 990031465d

19
bot.py
View file

@ -308,14 +308,15 @@ def cv():
if 'channel_id' in member: if 'channel_id' in member:
# Controlla il suo stato (esclusa, mutata, normale) e scegli l'emoji appropriata # Controlla il suo stato (esclusa, mutata, normale) e scegli l'emoji appropriata
if member['deaf'] or member['self_deaf']: if member['deaf'] or member['self_deaf']:
m['emoji'] = chr(128263) m['vemoji'] = chr(128263)
elif member['mute'] or member['self_mute']: elif member['mute'] or member['self_mute']:
m['emoji'] = chr(128264) m['vemoji'] = chr(128264)
else: else:
m['emoji'] = chr(128266) m['vemoji'] = chr(128266)
m['channelname'] = discord.getchannelname(r, member['channel_id']) m['channelname'] = discord.getchannelname(r, member['channel_id'])
# Altrimenti # Altrimenti
else: else:
m['vemoji'] = ""
# Controlla il suo stato (online, in gioco, afk) e scegli l'emoji appropriata # Controlla il suo stato (online, in gioco, afk) e scegli l'emoji appropriata
if member['status'] == "online": if member['status'] == "online":
m['emoji'] = chr(128309) m['emoji'] = chr(128309)
@ -334,18 +335,16 @@ def cv():
member['username'] = m['nick'] member['username'] = m['nick']
else: else:
m['name'] = member['username'] m['name'] = member['username']
if 'gamename' in m and 'channelname' in m: tosend += "{emoji} {name}".format(emoji=m['emoji'], name=m['name'])
tosend += "{emoji} *{channelname}* {name} | _{gamename}_\n".format(**m)
elif 'gamename' in m: elif 'gamename' in m:
tosend += "{emoji} {name} | _{gamename}_\n".format(**m) tosend += " | _{gamename}_".format(gamename=m['gamename'])
elif 'channelname' in m: elif 'channelname' in m:
tosend += "{emoji} *{channelname}* {name}\n".format(**m) tosend += " | {vemoji} *{channelname}*".format(vemoji=m['vemoji'], channelname=m['channelname'])
else: tosend += "\n"
tosend += "{emoji} {name}\n".format(**m)
# Controlla se l'utente è royal music # Controlla se l'utente è royal music
elif member['id'] == "176358898851250176": elif member['id'] == "176358898851250176":
if 'game' in member: if 'game' in member:
tosend += "{emoji} *{channelname}* {songname}\n" \ tosend += "{emoji} Music | {emoji} *{channelname}* | {songname}\n" \
.format(emoji="\U0001F3B5", channelname=discord.getchannelname(r, member['channel_id']), .format(emoji="\U0001F3B5", channelname=discord.getchannelname(r, member['channel_id']),
songname=member['game']['name']) songname=member['game']['name'])
telegram.sendmessage(tosend, sentin, source) telegram.sendmessage(tosend, sentin, source)