This repository contains the source code for a Telegram bot, written using Google Apps Script, that utilizes the API from the website russianwarship.rip to track enemy losses.
- Google account. If you don't have one, create a Google account.
- Bot token from BotFather in Telegram. If you don't have the token, create a new bot in Telegram.
You can access the bot by clicking this link.
- To learn more about the development of this bot, you can read this discussion.
- Open Google Apps Script and create a new project.
- Copy the entire code from
code.js
in this repository and paste it into the Apps Script editor. - Replace
const token = ''
with your Telegram bot's token. - Replace
const hookUrl = ''
with your Google Apps Script's URL (Publish > Deploy as web app > copy 'Current web app URL'). - Save the project with a relevant name.
- From the top menu, select Publish > Deploy as web app.
- Under 'Project version', select 'New' and make a note about the project. Then, click 'Deploy'.
- Copy the 'Current web app URL' and paste it into
const hookUrl = ''
. - Save and run the function
setWebhook()
to set up your Telegram bot's webhook. - Your bot should now be functional. Start a conversation with it in Telegram.
- The bot uses the API provided by russianwarship.rip for data.