update readmes

This commit is contained in:
2026-08-21 15:51:06 +06:00
parent 016400a821
commit ce48393895
104 changed files with 2615 additions and 333 deletions

View File

@@ -1,9 +1,39 @@
# SlotMachineDetectorBot
This bot must reply with information about slot machine answer
A long-polling example that distinguishes slot-machine dice from other Telegram
dice animations and decodes the slot reels.
## Launch
## Trigger and output
The bot handles every dice message and defines no commands.
- For a slot-machine dice, it calls `calculateSlotMachineResult` and replies in the
exact format `<left-reel>|<center-reel>|<right-reel>`.
- If a slot-machine value cannot be decoded, the handler sends no reply.
- For every other dice animation, it replies
`There is no slot machine dice in message`.
The example reports the three decoded reels only. It does not calculate a numeric
score or decide whether the combination wins.
## Setup, permissions, and privacy
1. Create a bot, obtain its token, and keep the token private.
2. Start a private chat with it, or add it to a group where dice should be observed.
3. Allow the bot to send replies in that chat.
Dice are ordinary non-command messages. In groups, configure Telegram's bot privacy
setting so the desired dice updates are delivered; disable privacy mode if the bot
should inspect all group dice. No administrator-only API methods are used. The bot
stores no message or dice data.
## Run
From the repository root:
```bash
../gradlew run --args="BOT_TOKEN"
./gradlew :SlotMachineDetectorBot:run --args="BOT_TOKEN"
```
The first argument is the required bot token. Omitting it causes startup to fail;
additional arguments are ignored. This launcher has no debug or test-server flag.

View File

@@ -6,6 +6,13 @@ import dev.inmo.tgbotapi.extensions.utils.*
import dev.inmo.tgbotapi.types.dice.SlotMachineDiceAnimationType
import kotlinx.coroutines.*
/**
* Starts the long-polling slot-machine detector.
*
* [args] must contain the bot token first; later elements are ignored. Slot-machine
* dice receive a pipe-separated three-reel reply, while other dice receive an
* explanatory reply. An undecodable slot-machine result is silently ignored.
*/
suspend fun main(args: Array<String>) {
val bot = telegramBot(args.first())