From 8f7515fb30dec8c0ea6265fe2af18fa10881acb1 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Fri, 20 Sep 2024 17:57:44 +0200 Subject: [PATCH] Handle duplicates Duplicate dictionary elements are not supported in Python, replace duplicates with a list which is then randomly picked from. Signed-off-by: Georg Pfuetzenreuter --- plugin.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugin.py b/plugin.py index 13a8841..0033f7e 100644 --- a/plugin.py +++ b/plugin.py @@ -28,6 +28,7 @@ ### +from random import choice from supybot import utils, plugins, ircutils, callbacks from supybot.commands import * try: @@ -101,7 +102,10 @@ emoji = {'innocent':'ʘ‿ʘ', 'shy':'(๑•́ ₃ •̀๑)', 'fly-away':'⁽⁽ଘ( ˊᵕˋ )ଓ⁾⁾', 'careless':'◔_◔', - 'love':'♥‿♥', + 'love': [ + '♥‿♥', + '-`ღ´-', + ], 'ididit':'ԅ(≖‿≖ԅ)', 'kissing':'( ˘ ³˘)♥', 'shark-face':'( ˇ෴ˇ )', @@ -140,7 +144,6 @@ emoji = {'innocent':'ʘ‿ʘ', 'fuck-off':'(° ͜ʖ͡°)╭∩╮', 'smiley-toast':'ʕʘ̅͜ʘ̅ʔ', 'exorcism':'ح(•̀ж•́)ง †', - 'love':'-`ღ´-', 'taking-a-dump':'(⩾﹏⩽)', 'dab':'ヽ( •_)ᕗ', 'wave-dance':'~(^-^)~', @@ -167,6 +170,8 @@ class UnicodeEmoji(callbacks.Plugin): re = emoji.get(emote.lower()) if re is None: re = emoji['fuck-off'] + elif isinstance(re, list): + re = choice(re) irc.reply('%s' % re, msg=msg, prefixNick=False ) e = wrap(e, ['text']) -- 2.35.3