mirror of
https://github.com/miloszowi/everyone-mention-telegram-bot.git
synced 2025-05-20 17:24:06 +00:00
fixed default group mention if there was a @ sign in any command argument
This commit is contained in:
parent
a02c09d19d
commit
4140098594
@ -26,9 +26,8 @@ class InboundMessage:
|
||||
user_id = str(update.effective_user.id)
|
||||
AccessValidator.validate(user_id)
|
||||
|
||||
if update.edited_message:
|
||||
raise InvalidActionException
|
||||
|
||||
message_content = update.edited_message.text if update.edited_message else update.message.text
|
||||
message_content = message_content.replace("\n", " ")
|
||||
chat_id = str(update.effective_chat.id)
|
||||
group_name = InboundMessage.default_group
|
||||
|
||||
@ -39,8 +38,8 @@ class InboundMessage:
|
||||
GroupNameValidator.validate(group_name)
|
||||
|
||||
# done upon resolving a message handler action
|
||||
if '@' in update.message.text and update.message.text[0] != '/':
|
||||
searched_message_part = [part for part in update.message.text.split(' ') if '@' in part][0]
|
||||
if '@' in message_content:
|
||||
searched_message_part = [part for part in message_content.split(' ') if '@' in part][0]
|
||||
group_name = re.sub(r'\W+', '', searched_message_part).lower()
|
||||
|
||||
if group_name in GroupNameValidator.FORBIDDEN_GROUP_NAMES:
|
||||
|
Loading…
x
Reference in New Issue
Block a user