1
0
mirror of https://github.com/civsocit/olgram.git synced 2025-05-30 23:03:24 +00:00

Compare commits

..

No commits in common. "59da56d46367e6854ae9d27a97c4878585f6de07" and "d0b570baa9627ab157c439d31d652051fb98bbf8" have entirely different histories.

3 changed files with 2 additions and 6 deletions

View File

@ -1,4 +0,0 @@
-- upgrade --
ALTER TABLE "bot_start_message" ALTER COLUMN "locale" TYPE VARCHAR(15) USING "locale"::VARCHAR(15);
-- downgrade --
ALTER TABLE "bot_start_message" ALTER COLUMN "locale" TYPE VARCHAR(5) USING "locale"::VARCHAR(5);

View File

@ -77,7 +77,7 @@ class Bot(Model):
class BotStartMessage(Model):
id = fields.IntField(pk=True)
bot = fields.ForeignKeyField("models.Bot", related_name="start_texts", on_delete=fields.CASCADE)
locale = fields.CharField(max_length=15)
locale = fields.CharField(max_length=5)
text = fields.TextField()
class Meta:

View File

@ -223,7 +223,7 @@ async def handle_operator_message(message: types.Message, super_chat_id: int, bo
else:
await banned_user.delete()
return SendMessage(chat_id=message.chat.id, text=_("Пользователь разбанен"))
if message.text and message.text.startswith("/tag "):
if message.text.startswith("/tag "):
tag = message.text.replace("/tag ", "")[:20].strip()
if tag:
await _redis.set(_tag_uid(bot.pk, chat_id), tag, pexpire=ServerSettings.redis_timeout_ms())