Skip to content

Commit

Permalink
feat: add self-repeat condition (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
piyoki authored Dec 2, 2023
1 parent edc97fe commit e2cd660
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/component/repeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,15 @@ def repeat(update: Update, context: CallbackContext):
if len([True for char in char_lib if char in t]) > 0:
repeated[chat_id] = True
context.bot.send_message(chat_id=chat_id, text=t)
# repeat with self
if "复读" in update.message.text:
repeated[chat_id] = True
t = t.replace("你", "我")
t = t.replace("机", "鹅")
t = t.replace("鸡", "鹅")
context.bot.send_message(chat_id=chat_id, text=t * 3)
# repeat 3 times with "!"
if 1 <= len(update.message.text) <= 30 and (
elif 1 <= len(update.message.text) <= 30 and (
update.message.text.endswith("!") or update.message.text.endswith("!")
):
repeated[chat_id] = True
Expand Down

0 comments on commit e2cd660

Please sign in to comment.