n4ze3m / dialoqbase

Create chatbots with ease
https://dialoqbase.n4ze3m.com/
MIT License
1.6k stars 264 forks source link

Commands telegram #225

Closed senavi888 closed 7 months ago

senavi888 commented 7 months ago

Hello! The built-in telegram bot has the commands /clear and /ping Can you tell me what the bot sends to the service if this integration is done through the API? I'm just making my own telegram bot and I can't understand it. Thank you!

n4ze3m commented 7 months ago

Hey, I don't quite understand your question, but if you're creating a Telegram bot, I highly recommend using https://grammy.dev/ for it. For command cases in Dialoqbase https://github.com/n4ze3m/dialoqbase/blob/893ab797ccf706ef533b136730b2cd1dc9024db7/server/src/integration/telegram.ts#L33 I set them using the bot.api.setMyCommands API offered by the Grammy library. However, you can also set commands via Telegram's BotFather.

senavi888 commented 7 months ago

The your native telegram bot has a command /clean What command should I send for this function when I integrate through your API Integration in dialoqbase?

n4ze3m commented 7 months ago

The 'clear' command means it will remove existing chat memory from the bot's conversation. You can edit it here:

https://github.com/n4ze3m/dialoqbase/blob/893ab797ccf706ef533b136730b2cd1dc9024db7/server/src/integration/telegram.ts#L48

n4ze3m commented 7 months ago

There is no API on Dialoqbase for Telegram; everything is managed by Dialoqbase itself. However, for Discord, I think you can set custom commands.

senavi888 commented 7 months ago

Thanks a lot! I owe you coffee.

n4ze3m commented 7 months ago

Haha, thanks! Feel free to ask questions anytime. No need to buy coffee every time. 😜