Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bugs in run.py and constants.py #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
)

keyboards = SimpleNamespace(
main=create_keyboard(keys.settings),
main=create_keyboard(keys.settings, keys.exit),
)
6 changes: 3 additions & 3 deletions src/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def echo(message):

def send_message(self, chat_id, text, reply_markup=None, emojize=True):
"""
Send message to telegram bot.
Send message to Telegram user
"""
if emojize:
text = emoji.emojize(text, use_aliases=True)
Expand All @@ -58,5 +58,5 @@ def send_message(self, chat_id, text, reply_markup=None, emojize=True):

if __name__ == '__main__':
logger.info('Bot started')
nashenas_bot = Bot(telebot=bot)
nashenas_bot.run()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not right. You're just deleting the run part.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that part was extra. we add bot.infinity_pulling in init and we do not have run method in our class. out bot start running when initialized

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. So nashenas_bot name should be fixed cause this is a template bot. Can you change it to

logger.info('Bot started...')
Bot(telebot=bot)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea that's right. I will do that

Bot(telebot=bot)