-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* exceptions handling (permissions), small fixes, ref * bot commands description * username errors handling * you are not poll creator error fix * Canceler -> Chancellor * wants you to record the last game -> wants you to record the game
- Loading branch information
1 parent
449f339
commit 1975e5e
Showing
14 changed files
with
139 additions
and
42 deletions.
There are no files selected for viewing
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
Empty file.
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
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
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,10 @@ | ||
class GroupChatRequiredException(Exception): | ||
"""Exception raised when an attempt is made to start a game outside a group chat.""" | ||
|
||
def __init__(self, user_id, message="Game can only be started in a group chat."): | ||
self.user_id = user_id | ||
self.message = message | ||
super().__init__(self.message) | ||
|
||
def __str__(self): | ||
return f"{self.message} User ID: {self.user_id}" |
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
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,12 +1,21 @@ | ||
from telegram import Update | ||
from telegram.ext import ContextTypes | ||
|
||
from src.config import AppConfig | ||
|
||
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: | ||
"""Inform user about what this bot can do""" | ||
|
||
async def start( | ||
update: Update, context: ContextTypes.DEFAULT_TYPE, config: AppConfig = AppConfig() | ||
) -> None: | ||
"""Inform user about what this bot can do""" | ||
await update.message.reply_text( | ||
"Hi this bot will help you to gather statistics about your games. Add it to chat " | ||
"with your friends and start a game by /game command. After game is finished, " | ||
"stop the poll by /save command. You can also /help to get more info." | ||
"Hi this bot will help you to gather statistics about your games. Add it to a chat " | ||
"with your friends and start a game by **/game** command. After game is finished, " | ||
"stop the poll by **/save** command. You can also /help to get more info." | ||
"**Hint**: Give the bot admin rights to delete messages and it will automatically clean up after itself.\n" | ||
"Feel free to contribute to the project: [GitHub](" | ||
"https://github.com/Alex-Kopylov/Secret-Hitler-Telegram-Bot-Statistic-Collector)\n" | ||
"Please report any issues to [GitHub Issues](" | ||
"https://github.com/Alex-Kopylov/Secret-Hitler-Telegram-Bot-Statistic-Collector/issues)", | ||
parse_mode="Markdown", | ||
) |
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