summaryrefslogtreecommitdiffstats
path: root/plugin.py
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2024-08-22 01:04:18 +0200
committerGeorg Pfuetzenreuter2024-08-22 01:04:18 +0200
commitc35277bf59c021d2baaec5c90d9896201ac9a116 (patch)
tree189178bd4f7a2775b7b89abaa90720183725fa35 /plugin.py
parentfbc58b0f7d3587bf81a735f44b46959d73b9e55a (diff)
downloadunicodeemoji-c35277bf59c021d2baaec5c90d9896201ac9a116.tar.gz
unicodeemoji-c35277bf59c021d2baaec5c90d9896201ac9a116.tar.bz2
unicodeemoji-c35277bf59c021d2baaec5c90d9896201ac9a116.zip
More resilient lookup
To improve the user experience: - on queries of non-existent emotes, fall back to a default instead of returning KeyError - allow lookup of emotes regardless of capitalization Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Diffstat (limited to 'plugin.py')
-rw-r--r--plugin.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugin.py b/plugin.py
index 3f3e1b9..0ad0c0c 100644
--- a/plugin.py
+++ b/plugin.py
@@ -160,7 +160,9 @@ class UnicodeEmoji(callbacks.Plugin):
Prints the Unicode emoji as listed here https://gist.github.com/mogad0n/476c3880dc0e0a059ed03efa265e50f7
"""
- re = emoji[emote]
+ re = emoji.get(emote.lower())
+ if re is None:
+ re = emoji['fuck-off']
irc.reply('%s' % re, msg=msg, prefixNick=False )
e = wrap(e, ['text'])