telegram-bot-boilerplate | Telegram bot boilerplate based on Falcon framework | Bot library
kandi X-RAY | telegram-bot-boilerplate Summary
kandi X-RAY | telegram-bot-boilerplate Summary
Telegram bot boilerplate based on Falcon framework and python-telegram-bot library
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Start bot
- Get a user from an update
- Process a command
- Create a new log command
- Process an event
- Start the bot
- Send an unknown command
- Delete webhook
telegram-bot-boilerplate Key Features
telegram-bot-boilerplate Examples and Code Snippets
Community Discussions
Trending Discussions on telegram-bot-boilerplate
QUESTION
I'm new on Elixir and I write telegram bot. I use this project as template: https://github.com/lubien/elixir-telegram-bot-boilerplate
It works fine, but I have a couple of questions.
How can I split "Commands" if it would be too big? I have an idea to create a new module NewCommands with
use App.Commander
and add it tohandle_cast
in Matcher. Is that a right way?Why does Matcher runs as a GenServer? I don't think it needs any state or smth.
ANSWER
Answered 2017-Jan-14 at 06:24- Please start with reading about the difference between
use
,import
, andrequire
in Elixir.
We use
import
whenever we want to easily access functions or macros from other modules without using the fully-qualified name.
So no, use
should not be used here: import
should. Other way round would be to define commands as macros and require
them, or write an ad-hoc function generation inside __using__
macro of NewCommands
and only then use
it.
- I did not dig into the code, but I guess you want
Matcher
to be automatically respawned is something went wrong and it crashed, right? Erlang philosophy is “crash soon,” hence instead of cumbersome error handling we just let the process crash. Aftwerwards, if you still want to match, it should be respawned, to serve further requests.
Also, it is used as a dispatcher before Commands
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install telegram-bot-boilerplate
You can use telegram-bot-boilerplate like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page