Skip to content

echoooooooboooot#8

Open
dragonpuffle wants to merge 3 commits intoryabchi:mainfrom
dragonpuffle:22pmi-1/podvigin
Open

echoooooooboooot#8
dragonpuffle wants to merge 3 commits intoryabchi:mainfrom
dragonpuffle:22pmi-1/podvigin

Conversation

@dragonpuffle
Copy link
Copy Markdown

No description provided.

from todobot.config import TELEGRAM_TOKEN

TASKS= dict()
commands = {'/help' : 'view commands','/start':'hi)',
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Лучше в аппер кейсе

"""Send a message when the command /help is issued."""
await update.message.reply_text("Help!")
for command,description in commands.items():
await update.message.reply_text(f'{command} - {description}')
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Не нужно отправлять разными сообщениями - лучше отформатируй и отправь одним

user = update.effective_user
if user.id not in TASKS or not TASKS[user.id]:
message='У вас нет задач'
await update.message.reply_text(message)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

ниже можно вписать return и сдвинуть нижний код левее

старайся держать код левее - это хорошая практика

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants