Skip to content

Commit

Permalink
Not supported model on /start
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaGusev committed Jul 7, 2024
1 parent ea6f8de commit 6abeeb2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,14 @@ async def start_polling(self) -> None:

async def start(self, message: Message) -> None:
assert message.from_user
user_id = message.from_user.id
chat_id = message.chat.id
self.db.create_conv_id(chat_id)
model = self.db.get_current_model(chat_id)
if model not in self.providers:
await message.reply(self.localization.MODEL_NOT_SUPPORTED)
return

self.db.create_conv_id(chat_id)
user_id = message.from_user.id
remaining_count = self._count_remaining_messages(user_id=user_id, model=model)
mode = "standard" if self.db.get_subscription_info(user_id) <= 0 else "subscribed"
limits = {name: provider.limits for name, provider in self.providers.items()}
Expand Down

0 comments on commit 6abeeb2

Please sign in to comment.