5 votes
Accepted

Python Telegram Quiz Bot

Overall it seems pretty reasonable; some specific points: Do not use the root logger. For a non-trivial application such as this, make your own logger instance for each module. You can configure the ...
Reinderien's user avatar
  • 60.7k
5 votes

Simple C++ Telegram Bot

You are right about using namespace. The purpose of a namespace is to allow types and functions to have the same name in two or more areas of code. Think about ...
Code Gorilla's user avatar
  • 1,582
4 votes
Accepted

JavaScript telegram bot that sends images based on user search

...
Joseph's user avatar
  • 25k
3 votes
Accepted

Python script which sends telegram message if Raspberry Pi's temperature crosses 60 °C

chatId -> chat_id and similar for other members and method names, by PEP8 standard ...
Reinderien's user avatar
  • 60.7k
2 votes

Casting calls with the same parent class

I'm not sure if there is enough context for me to fully understand the restrictions you are wporking with but I will try anyway... 25 years ago an elder university student half-jokingly taught me that ...
TorbenPutkonen's user avatar
2 votes

Telegram Bot that retrieves book information from GoodReads

...
Alex's user avatar
  • 1,622
2 votes
Accepted

Telegram bot that retrieves news articles based on user requests

Just at a very quick glance: You should really think twice about using the @SuppressWarnings annotation. Warnings are usually a sign that something is not doing ...
Joe C's user avatar
  • 1,075
2 votes
Accepted

Telegram Rest API client design

You are right, the code looks messy. Here are some hints that concern only the fragments listed in the question (I looked briefly inside the project repo, but it's too huge to analyze here). ...
Antot's user avatar
  • 3,637
2 votes

A convenient wrapper for Telegram Bot library

Just answering your numbered questions. Static methods are necessary in languages like Java where everything has to be part of a class. But in Python you can just write a function, and so ...
Gareth Rees's user avatar
  • 49.6k
2 votes

Python Telegram Quiz Bot

__location__ Here's a recommendation I have also started implementing recently: Using a definitions.py (naming up to preference ...
riskypenguin's user avatar
  • 3,453
2 votes

Stack Exchange Marathon Bot – Part 1: Bot structure

Disclaimer: I'm currently the maintainer of python-telegram-bot. Hi. TBH I haven't tried to understand every detail of what you presented. I'd still like to ...
CallMeStag's user avatar
1 vote

Validating an input in a chatbot

I think the best option is to implement the validate function inside task class. It should be a behaviour of the task class. And why don't you use polymorphism here? You have ...
Kevin's user avatar
  • 101
1 vote

The right way to implement multiple commands in a Telegram bot

I think your approach would be better if you could make use of methods rather than whole classes. So if we follow your example, we can do something like. ...
Ahmed Mohamed's user avatar
1 vote
Accepted

Optimizing telegram bot

There are a number of issues, but I'm guessing that the major slowdown in s() is due to the unnecessarily repeated calls to ...
JonSG's user avatar
  • 166
1 vote

How to optimize my telegram bot written in Python?

From my point of view you can use a visitor pattern for this with a simple dictionary, specially for your operations, here is a small example: Insead of this ...
camp0's user avatar
  • 795
1 vote

State and Borg design patterns used in a Telegram wizard bot

I mainly decoupled the states from the bots putting a handler_list method inside each state. Briefly I comment some suggestions and good points Gareeth Reese made: Cutting source code lines to 80 ...
madtyn's user avatar
  • 211
1 vote

The Telegram bot for book information

gc is the name of the Garbage Collection interface module. It shouldn't matter too much, but, when reading your code, it feels like that you are asking the garbage ...
Dair's user avatar
  • 5,864
1 vote

Telegram Bot that retrieves book information from GoodReads

while 1: time.sleep(...) would always look bad. The example for telebot even shows to use bot.poll(...) so I'd use that unless ...
ferada's user avatar
  • 11k
1 vote

A wrapper class for Telegram bot API in PHP

[0-9]{0,} is more simply written as \d* [a-zA-z]{0,} is more simply/accurately written as <...
mickmackusa's user avatar
  • 8,574

Only top scored, non community-wiki answers of a minimum length are eligible