Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added emoji plugin #167

Merged
merged 2 commits into from
Dec 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
12 changes: 12 additions & 0 deletions src/honeybot/plugins/downloaded/emoji/info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
NAME = "emoji.py"

ORIGINAL_AUTHORS = ["Fumbani Banda"]

ABOUT = """
Given an emoji it returns meaning.
"""

COMMANDS = """
>>> .emoji <<emoji>>
returns emoji meaning.
"""
56 changes: 56 additions & 0 deletions src/honeybot/plugins/downloaded/emoji/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
class Plugin:
def __init__(self):
pass

def __meaning(emoji):
d = {
"😀": "Grinning Face",
"😃": "Grinning Face with Big Eyes",
"😄": "Grinning Face with Smiling Eyes",
"😁": "Beaming Face with Smiling Eyes",
"😆": "Grinning Face with Sweat",
"🤣": "Rolling on the Floor Laughing",
"😂": "Face with Tears of Joy",
"🙂": "Slightly Smiling Face",
"🙃": "Upside-Down Face",
"😉": "Winking Face",
"😊": "Smiling Face with Smiling Eyes",
"😇": "Smiling Face with Halo",
"🥰": "Smiling Face with Hearts",
"😍": "Smiling Face with Heart-Eyes",
"🤩": "Star-Struck",
"😘": "Face Blowing a Kiss",
"😗": "Kissing Face",
"😉": "Winking Face",
"😊": "Smiling Face with Smiling Eyes",
"😇": "Smiling Face with Halo",
"🥰": "Smiling Face with Hearts",
"😍": "Smiling Face with Heart-Eyes",
"🤩": "Star-Struck",
"😘": "Face Blowing a Kiss",
"😗": "Kissing Face",
"😚": "Kissing Face with Closed Eyes",
"😙": "Kissing Face with Smiling Eyes",
"😋": "Face Savoring Food",
"😛": "Face with Tongue",
"😜": "Winking Face with Tongue",
"🤪": "Zany Face",
"😝": "Squinting Face with Tongue",
"🤑": "Money-Mouth Face",
"🤗": "Smiling Face with Open Hands",
"🤭": "Face with Hand Over Mouth",
}
Abdur-rahmaanJ marked this conversation as resolved.
Show resolved Hide resolved
if emoji in d.keys():
return d[emoji]
else:
return "not supported"

def run(self, incoming, methods, info, bot_info):
try:
msgs = info["args"][1:][0].split()
print(len(msgs))
if info["command"] == "PRIVMSG" and msgs[0] == ".emoji":
emoji = str(msgs[1])
methods["send"](info["address"], Plugin.__meaning(emoji))
except Exception as e:
print("woops plugin error ", e)