Code Tools

Made By Skyzhou


Github Link : SkyTgBot

Introduction

A simple Telegram bot sending a daily notification at 8:00 a.m. (UTC+8) if there’s a CF/At contest scheduled for the day.

How to use?

First, you need to have a server(not in China Mainland) to deploy the Telegram Bot backend.

Then, search @BotFather on Telegram and create a bot by following his instructions.

After successfully created a Telegram Bot, you have to create a config.json like below, to put your TOKEN in it. Or you can just copy the config_empty.json file and rename it to config.json.

1
2
3
4
{
"TOKEN": "YOUR TOKEN HERE",
"CHAT_ID": 1145141919810
}

To test whether the Bot has been created correctly and get the CHAT_ID of the messsage room where you want to use later. You can run the code getChatId.py first, and /start in Telegram. You will now get your CHAT_ID, it should be put correctly in the config.json, too.

The last step is to run main.py and wait for the alarm on every 8:00a.m. (UTC+8) if the day has a CF/At contest. 😋

P.S. Remember to use the venv by requirements.txt


Warning: If you’re in China Mainland

It’s amazing that Apple and most of the Android system has put the notificaiton API on Chinese Server, that means you don’t have to use VPN tools to receive such a notification by Telegram when using iPhone in China Mainland!

But unfortunately, if you’re a Huawei user, I’m sorry to tell that the notification is not available in China Mainland without using VPN tools.

Test Images

TestingImage


本站由 Sky Zhou 使用 Stellar 1.29.1 主题创建。
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。
© Copyright skyzhou.top
All Rights Reserved