feat: check emoji in promote title

This commit is contained in:
草师傅 2025-09-19 20:26:46 +08:00
parent b13e8533ed
commit 69873b3c8d
3 changed files with 16 additions and 0 deletions

View file

@ -1,5 +1,6 @@
from aiogram.exceptions import TelegramBadRequest
from aiogram.types import Message
from emoji import is_emoji
from config import config
@ -19,6 +20,9 @@ async def handle_promote_command(message: Message) -> None:
if len(title) > 16:
await message.reply('头衔太长了,咱设置不了')
return
if any(is_emoji(s) for s in title):
await message.reply('你这叽里咕噜的杜叔叔也看不懂啊')
return
if member.status == 'creator':
await message.reply('咱不能给群主设置头衔')
return