Twitch-Channel-Points-Miner-v2
Twitch-Channel-Points-Miner-v2 copied to clipboard
Telegram notification does not work
What's happening? Telegram notifications are not being sent, I get a 400 response instead..
What is my run.py configuration for logging?
logger_settings=LoggerSettings(
save=True, # If you want to save logs in a file (suggested)
console_level=logging.INFO, # Level of logs - use logging.DEBUG for more info
file_level=logging.DEBUG, # Level of logs - If you think the log file it's too big, use logging.INFO
emoji=True, # On Windows, we have a problem printing emoji. Set to false if you have a problem
less=False, # If you think that the logs are too verbose, set this to True
colored=True, # If you want to print colored text
color_palette=ColorPalette( # You can also create a custom palette color (for the common message).
STREAMER_online="GREEN", # Don't worry about lower/upper case. The script will parse all the values.
streamer_offline="red", # Read more in README.md
BET_wiN=Fore.MAGENTA # Color allowed are: [BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET].
),
telegram=Telegram( # You can omit or leave None if you don't want to receive updates on Telegram
chat_id=753293613, # Chat ID to send messages @GiveChatId
token="<censored>", # Telegram API token @BotFather
events=[Events.STREAMER_ONLINE, Events.STREAMER_OFFLINE, "BET_LOSE"], # Only these events will be sent to the chat
disable_notification=True, # Revoke the notification (sound/vibration)
),
),
Expected behavior The script should normally sent the notification through my bot to my Telegram account.
Desktop (please complete the following information):
- OS: Linux Debian
- Python version: apparently 2.7, not sure if in the docker it's different
Logs
https://api.telegram.org:443 "POST /bot<censored>/sendMessage HTTP/1.1" 400 73
(I suppose 400
means the HTTP response code..)
400
is BadRequest
, there is something wrong with the URL path.
Try and make sure the token is the correct value, including the colon (:
)
telegram=Telegram(
chat_id=456789123,
token="123456:abc123def456",
events=[
Alternatively also try to open the URL manually: https://api.telegram.org/bot<TOKEN>/getMe
.
https://api.telegram.org/bot<TOKEN>/getMe
this is working flawlessly.
Are there any other options? Any information you need to identify the problem?