exclam: Add "-" parameter to "!react" to remove a reaction
patch abf1d31ddcf3cddd55844900065a3c3dd6bf9c67
Author: E. Bosch <presidev@AT@gmail.com>
Date: Sun Oct 20 02:32:44 CEST 2024
* exclam: Add "-" parameter to "!react" to remove a reaction
diff -rN -u old-irgramd/emoji2emoticon.py new-irgramd/emoji2emoticon.py
--- old-irgramd/emoji2emoticon.py 2024-11-22 03:35:26.485718048 +0100
+++ new-irgramd/emoji2emoticon.py 2024-11-22 03:35:26.489718041 +0100
@@ -89,7 +89,7 @@
'\U0001f970': '":)e>"',
}
-emo_inv = {}
+emo_inv = { '-': None }
for k in reversed(emo):
emo_inv[emo[k][1:-1]] = k
diff -rN -u old-irgramd/exclam.py new-irgramd/exclam.py
--- old-irgramd/exclam.py 2024-11-22 03:35:26.485718048 +0100
+++ new-irgramd/exclam.py 2024-11-22 03:35:26.489718041 +0100
@@ -199,7 +199,7 @@
if chk_msg is not None:
if act in emo_inv:
utf8_emo = emo_inv[act]
- reaction = [ tgty.ReactionEmoji(emoticon=utf8_emo) ]
+ reaction = [ tgty.ReactionEmoji(emoticon=utf8_emo) ] if utf8_emo else None
try:
update = await self.tg.telegram_client(SendReactionRequest(self.tmp_telegram_id, id, reaction=reaction))
except ReactionInvalidError:
@@ -216,8 +216,9 @@
if help == HELP.desc: # rest of HELP.desc
reply += \
(
- ' !react <compact_id> <emoticon reaction>',
+ ' !react <compact_id> <emoticon reaction>|-',
'React with <emoticon reaction> to a message with <compact_id>,',
'irgramd will translate emoticon to closest emoji.',
+ 'Use - to remove a previous reaction.',
)
return reply