File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,20 @@ async def start_command(update: Update, _: ContextTypes.DEFAULT_TYPE) -> None:
3939 await update .message .reply_text (_START_MESSAGE )
4040
4141
42+ async def get_model_command (
43+ update : Update ,
44+ _ : ContextTypes .DEFAULT_TYPE ,
45+ db_client : DBClient ,
46+ ) -> None :
47+ """Get the current model being used by the user."""
48+ user_id = update .message .from_user .id
49+ username = update .message .from_user .username
50+ account = db_client .get_or_create_account (user_id = user_id , username = username )
51+ await update .message .reply_text (
52+ f"You are currently using { account .model .value } provided by { account .provider .value } ."
53+ )
54+
55+
4256async def rewrite (
4357 update : Update ,
4458 context : ContextTypes .DEFAULT_TYPE ,
@@ -80,6 +94,9 @@ async def rewrite(
8094 app = ApplicationBuilder ().token (os .getenv (_TELEGRAM_BOT_TOKEN_VAR_NAME )).build ()
8195
8296 app .add_handler (CommandHandler ("start" , start_command ))
97+ app .add_handler (
98+ CommandHandler ("model" , partial (get_model_command , db_client = db_client ))
99+ )
83100 app .add_handler (
84101 MessageHandler (
85102 filters .TEXT & (~ filters .COMMAND ),
You can’t perform that action at this time.
0 commit comments