mirror of
https://github.com/RYGhub/royalnet.git
synced 2025-02-17 10:53:57 +00:00
Il bot non crasha più se non scrivi l'audio da inviare
This commit is contained in:
parent
0000b84f44
commit
e4ec4c7925
1 changed files with 10 additions and 4 deletions
14
bot.py
14
bot.py
|
@ -173,11 +173,17 @@ while True:
|
||||||
elif text.startswith('/audio'):
|
elif text.startswith('/audio'):
|
||||||
print("@" + username + ": /audio")
|
print("@" + username + ": /audio")
|
||||||
cmd = text.split(" ", 1)
|
cmd = text.split(" ", 1)
|
||||||
if cmd[1] in audiolist:
|
if len(cmd) > 1:
|
||||||
sendme = audiolist[cmd[1]]
|
if cmd[1] in audiolist:
|
||||||
telegram.senddocument(sendme, sentin, source)
|
sendme = audiolist[cmd[1]]
|
||||||
|
telegram.senddocument(sendme, sentin, source)
|
||||||
|
else:
|
||||||
|
sendme = chr(9888) + " L'audio richiesto non esiste!\n*Audio disponibili*:\n"
|
||||||
|
for audio in audiolist:
|
||||||
|
sendme += audio + "\n"
|
||||||
|
telegram.sendmessage(sendme, sentin, source)
|
||||||
else:
|
else:
|
||||||
sendme = chr(9888) + " L'audio richiesto non esiste!\n*Audio disponibili*:\n"
|
sendme = chr(9888) + " Per mandare un audio, scrivi `/audio nomeaudio`\n*Audio disponibili*:\n"
|
||||||
for audio in audiolist:
|
for audio in audiolist:
|
||||||
sendme += audio + "\n"
|
sendme += audio + "\n"
|
||||||
telegram.sendmessage(sendme, sentin, source)
|
telegram.sendmessage(sendme, sentin, source)
|
||||||
|
|
Loading…
Add table
Reference in a new issue