A simple, short, mostly customisable GitHub Action to show your bot's status in your GitHub MarkDown file as well as in your Telegram.
- Star this repo. โญ
- Go to the repository where you want to display the status of the bots. ๐ค
- Go to environment variables (Settings โข Secrets โข New Repository Secret.) ๐ถ
- Fill all Environment variables there. ๐คญ
- Copy this snippet in
./github/workflows/main.yml
in your repository. ๐ - The workflow will automatically run at interval of 3 hours. ๐
You can also use ${{ steps.bot-status.outputs.STATUS }}
for using the JSON data (containing the name of bot, username and status) wherever you want to use them.
3rd and 4th steps are not mandatory, It's just to keep your secrets completely secret and not let anyone peep into them. You can also define them directly in
.yml
file.
๐คซ Environment variables
โฒ These are mandatory variables and should be kept secret. (use Environment variables)
๐ Secret ๐ | ๐ท Description ๐ท | โ๏ธ Default โ๏ธ | ๐ Example ๐ |
---|---|---|---|
API_HASH |
Get it from my.telegram.org | None |
782xxxx |
APP_ID |
Get it from my.telegram.org | None |
a1bbfb767fd59812bxxxxxxxxxxxxxxx |
IDS |
IDs of the Messgage followed with chat id |
None |
-100153418xxxx:3 -100225478xxxx:16 |
SESSION |
None |
xxxxxxxxxxxxxxxx..... |
|
BOTS |
Raw link of JSON file of bots. | ๐ Link ๐ | JSON format โ Raw link |
Format of chat IDs ยป chat id
:message id
Eg, -100123456xxx:1x
where 100123456xxx
is chat id
and 1x
is message id
.
Optional variables
โฒ These are optional values and can be omitted. Default values will be used. (can use directly in .yml
instead of messing Environment variables.)
๐งพ Values ๐งพ | ๐ท Description ๐ท | โ๏ธ Default โ๏ธ | ๐ Example ๐ |
---|---|---|---|
FILE_NAME |
Name of the file to edit. | README.md |
STATUS.md |
EDIT_IN_REPO |
True for editing status in repository, False for else. |
True |
True |
EDIT_IN_TELEGRAM |
True for editing status in Telegram. | True |
True |
START_MESSAGE |
Message to be shown in starting of the Text in Telegram. | Read main.py | Read main.py |
END_MESSAGE |
Message to be shown in ending of the Text in Telegram. | Read main.py | Read main.py |
COMMIT_MESSAGE |
Message while commit. | โจ auto-updated bot status. โจ |
Updated bot status [Bot] |
BULLET |
The bullet use to separate bots in Telegram. | โช |
โ |
TIME_ZONE |
The Time zone of your locale. | Asia/Kolkata |
Europe/London |
TIME_FORMAT |
Format of your time to be shown everwhere. | %H:%M %d/%m |
%Y-%m-%d %H:%M:%S |
UP_GITHUB |
Emoji or Text when the status is up. (on GitHub MarkDown file) | โ๏ธ |
โ
|
DOWN_GITHUB |
Emoji or Text when the status is down. (on GitHub MarkDown file) | โ |
โ |
UP_TELEGRAM |
Emoji or Text when the status is up. (in Telegram chat) | ๐ |
โ๏ธ |
DOWN_TELEGRAM |
Emoji or Text when the status is down. (in Telegram chat) | โ |
๐ค |
๐ป Credits
- Aditya for inspiration from his repo.
- Vaibhav-08 for making me aware of typos, suggesting features and a lot that should deserve "Thanks".
- Lonami for Telethon.
- Google and Telethon docs.
BotStatus is licensed under GNU Affero General Public License v3 or later.
The GNU General Public License (GNU GPL or simply GPL) is a series of widely-used free software licenses that guarantee end users the freedom to run, study, share, and modify the software.[8] The licenses were originally written by Richard Stallman, founder of the Free Software Foundation (FSF), for the GNU Project, and grant the recipients of a computer program the rights of the Free Software Definition.[9] The GPL series are all copyleft licenses, which means that any derivative work must be distributed under the same or equivalent license terms. This is in distinction to permissive software licenses, of which the BSD licenses and the MIT License are widely used, less restrictive examples. GPL was the first copyleft license for general use.