Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
wiki:software:beuthbot:bot [12.12.2019 13:10] Christopher Lehmann |
wiki:software:beuthbot:bot [07.05.2020 16:31] (aktuell) Thomas Ziemer |
||
---|---|---|---|
Zeile 2: | Zeile 2: | ||
> [[https:// | > [[https:// | ||
+ | |||
+ | {{page> | ||
==== Table of content ==== | ==== Table of content ==== | ||
Zeile 34: | Zeile 36: | ||
After cloning the repository, install the dependencies. You can then run the project. | After cloning the repository, install the dependencies. You can then run the project. | ||
+ | |||
+ | |||
< | < | ||
Zeile 62: | Zeile 66: | ||
- **Message**: | - **Message**: | ||
+ | \\ | ||
- **Callback Queries**: The bot can answer with a question, providing the user a simple interface, using a button matrix. When the user clicks on of these buttons we get a //callback query//.\\ | - **Callback Queries**: The bot can answer with a question, providing the user a simple interface, using a button matrix. When the user clicks on of these buttons we get a //callback query//.\\ | ||
+ | \\ | ||
- **Inline Queries**: Users can call our bot from within another chat by prefixing the botname with an ' | - **Inline Queries**: Users can call our bot from within another chat by prefixing the botname with an ' | ||
Zeile 69: | Zeile 75: | ||
The '' | The '' | ||
- | < | + | < |
const commands = { | const commands = { | ||
'/ | '/ | ||
Zeile 112: | Zeile 118: | ||
=== Functions === | === Functions === | ||
- | The `commands.js`-file provides several functions. Eg. functions to check if a message contains an command and to find out if the requested command is in the `commands`-object, which means it is an supported command. | + | The 'commands.js'-file provides several functions. Eg. functions to check if a message contains an command and to find out if the requested command is in the 'commands'-object, which means it is an supported command. |
- | Further are functions provided to handle Messages (containing normal | + | Further are functions provided to handle Messages (containing normal |
The bot has the following functionalities, | The bot has the following functionalities, | ||
- | - getTimestamp: | + | - getTimestamp: |
- | - getFormatedTimestamp: | + | - getFormatedTimestamp: |
- | - renderHelpString: | + | - renderHelpString: |
- | - supportedMarkdown: | + | - supportedMarkdown: |
=== BotFather === | === BotFather === | ||
- | The [BotFather](https:// | + | The [[https:// |
Further you can register the commands and inline queries your bot supports. This allows a cleaner user experience since the bot will then suggest commands and inline queries while the user types. So absolutely do register them! | Further you can register the commands and inline queries your bot supports. This allows a cleaner user experience since the bot will then suggest commands and inline queries while the user types. So absolutely do register them! | ||
Zeile 131: | Zeile 137: | ||
The neccessary commands are: | The neccessary commands are: | ||
- | - `/ | + | - '/ |
- | - `/setinline` | + | - '/setinline' |
==== Further Development ==== | ==== Further Development ==== | ||
- | New commands can simply added to the `commands`-object but have to follow the presented structure under [Commands](#commands). | + | New commands can simply added to the 'commands'-object but have to follow the presented structure under [[wiki: |
==== Further Reading ==== | ==== Further Reading ==== | ||
- | - [Telegram Bot APi](https:// | + | - [[https:// |
==== Built With ==== | ==== Built With ==== | ||
- | - [Node.js](https:// | + | - [[https:// |
- | - [Express.js](https:// | + | - [[https:// |
- | - [Node-Telegram-Bot-API](https:// | + | - [[https:// |
==== Versioning ==== | ==== Versioning ==== | ||
- | We use [SemVer](http:// | + | We use [[http:// |
==== Authors ==== | ==== Authors ==== | ||
- | - **Tobias Klatt** - _Initial work_ - [GitHub](https: | + | - **Tobias Klatt** - //Initial work// - [[https:// |
- | + | ||
- | See also the list of [contributors](https:// | + | |
+ | See also the list of [[https:// | ||
+ | <WRAP pagebreak></ |