Skip to content

Commit

Permalink
Adiciona efeitos ao finalizar prova
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielRF committed Jun 8, 2024
1 parent 42a7ae4 commit 563b4ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 10 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
'Início ⌂',
callback_data=f'Voltar_ao_inicio'
)
effects = [
5107584321108051014,
5044134455711629726,
5104841245755180586,
5046509860389126442
]

def verifica_e_adiciona_usuario(user_id):
conn = sqlite3.connect(db)
Expand Down Expand Up @@ -363,13 +369,15 @@ def send_results(user_id):
anuncieaqui.send_message(
TOKEN,
user_id,
end_message
end_message,
message_effect_id=random.choice(effects)
)
except:
bot.send_message(
user_id,
end_message,
parse_mode='HTML'
parse_mode='HTML',
message_effect_id=random.choice(effects)
)

def send_poll(user_id, query_data=None):
Expand Down
3 changes: 2 additions & 1 deletion utils/anuncieaqui.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import json
import requests

def send_message(bot_token, destination, message):
def send_message(bot_token, destination, message, message_effect_id=None):
url = 'http://localhost:8080/send_message'
payload = {
'bot_token': bot_token,
'destination': destination,
'message': message,
'message_effect_id': message_effect_id,
}
response = requests.post(url, json=payload)

0 comments on commit 563b4ef

Please sign in to comment.