Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated requirements and application
- Loading branch information
1 parent
cd74249
commit c3dd46e
Showing
5 changed files
with
195 additions
and
61 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from telegram import Bot, Update | ||
from telegram.ext import run_async | ||
|
||
|
||
class StartHandler: | ||
def __init__(self, start_messages: dict): | ||
self.__messages = start_messages | ||
|
||
@run_async | ||
def start(self, bot: Bot, update: Update): | ||
chat_id = update.message.chat_id | ||
user_id = update.message.user_id | ||
bot.sendMessage(chat_id, self.__messages["welcome"]) | ||
|
||
|
||
class HelpHandler: | ||
def __init__(self, help_messages: dict): | ||
self.__messages = help_messages | ||
|
||
@run_async | ||
def help(self, bot: Bot, update: Update, args: list): | ||
chat_id = update.message.chat_id | ||
if len(args) == 0: | ||
print("no args") | ||
else: | ||
bot.sendMessage(chat_id, self.__messages["help"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class DatabaseOperations: | ||
def __init__(self): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
telegram | ||
pip | ||
python-telegram-bot |