Python discord library
pip install discord
- Update the config file and name it
config.py. See theConfigsection for instructions, andexample_config.pyfor an example. - Run
python3 bot.py
MS_TOKEN = "Majsoul XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
TOURN_ID = 12345678
SEASON_ID = 0
You can find the Mahjong Soul token by login to the page https://mahjongsoul.tournament.yo-star.com/contest_dashboard/, and check the Authorization row in the headers of the http request. You should be able to find it in most of the requests to engame.mahjongsoul.com.
Similarly, you can get the tournament ID and season ID by clicking the tournament you are looking for, and check the url.
uma = [30, 10, -10, -30]
Set the uma here – it should be an array of 4 integers, where the first one is the uma for the first place, and so on.
BOT_TOKEN = "?????"
CHANNEL_ID = 12345678
UPDATE_PERIOD = 60 # in seconds
The bot token is self explanatory. The channel ID is the one where the bot send the message to. The update period decides how frequent the bot scraps the website and updates the message. Default is 60, which means once per minute.