With this bot you can create events in Telegram groups. People can RSVP to the event just by clicking on "zusagen" (it's currently only available in German).
This makes it possible to get much less notifications in large groups. Instead of everyone writing "I'm in" etc. they can click on "zusagen" for which no extra notifications are created. It just shows a nice overview of everyone who already RSVP-ed.
- Open the Telegram group in which you would like to enable events.
- Open group "Info" and click "Edit" to go to group settings.
- Click on "Administrators" and "Add Admin"
- Type "@create_events_bot" in the search and choose the bot named "Event".
- Give the CreateEventsBot the right to "Delete Messages", everything else you can disable if you want.
The bot needs delete rights to work nicely since it deletes messages that start with "/event" and replaces them with the actual event. It will not delete anything else. Actually, the bot can only read messages that start with
/
- Click on "Done" to add the bot to the group. It might ask whether you want to first add the bot as a member to the group and then promote it to admin. In that case click yes.
- In the group, type "/event Blablabla" as a message and send it. This will create an event with the description "Blablabla".
- Now people can RSVP by clicking on "Zusagen" or revert that by clicking on "doch nicht".
If you first want to try out how to use the bot, you can simply start a private message with @create_events_bot and create an event there that only you will see.
In the event description you can also use markdown (e.g. bold text) and several lines (with Shift+Enter on a Computer you create a next line without sending the message) and of course emojis. More information on possible markdown styles here: https://core.telegram.org/bots/api#markdown-style.
Currently, you can't edit or delete events. If you are a developer, Pull Requests are welcome.
- Clone this repository.
- In order to be able to send and receive message via Telegram you first need to create a bot: Create a bot with botfather. There you get a token.
- In the terminal, go to the app's folder with
cd createEventsBot
. - Create a database by running
yarn install
,mkdir data
andnpx sqlite3 ./data/development.db
. - Create the database-tables by running the following three commands:
sqlite3 ./data/development.db
> CREATE TABLE "events" ("id" INTEGER NOT NULL UNIQUE,"chat_id" INTEGER NOT NULL,"message_id" INTEGER NOT NULL,"description" TEXT NOT NULL,PRIMARY KEY("id" AUTOINCREMENT));
> CREATE TABLE "attendees" ("id" INTEGER NOT NULL UNIQUE,"event_id" INTEGER NOT NULL,"user_id" INTEGER NOT NULL,"name" TEXT NOT NULL,FOREIGN KEY("event_id") REFERENCES "events"("id"),PRIMARY KEY("id" AUTOINCREMENT));
- Rename the file
.env_example
to.env
and setDEV_BOT_TOKEN
to the token, you've got from BotFather. - Then run
yarn watch
.
Now the bot is started in watch-mode, i.e. whenever you make changes to the code and save them, the bot automatically updates. You can now open Telegram (on the computer or phone) and use the bot (like in "How to create an event").
Follow the steps under "Local development"
You might find it useful to create two different bots, one for local development and one for production (for the outside world). In that case, create another bot with BotFather and paste the respective token into the .env
-file under PROD_BOT_TOKEN
.
For deployment I found uberspace really nice.
Also, feel free to make a Pull Request here with your changes if they might be useful to integrate into the CreateEventsBot!
Feel free to send me a message if anything doesn't work.
We use node-telegram-bot-api, node-telegram-keyboard-wrapper and sqlite3.
You may find these documentations useful: node-telegram-bot-api documentation, Telegram API documentation.