From 038b1a294c3bef3da0ef120aabd7e7b7dfccf96e Mon Sep 17 00:00:00 2001 From: klemek Date: Fri, 8 Jan 2021 12:43:55 +0100 Subject: [PATCH] fixes from moving to src --- src/emojis.py | 3 ++- src/{bot.py => main.py} | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) rename src/{bot.py => main.py} (93%) diff --git a/src/emojis.py b/src/emojis.py index cbe4617..7c9bf76 100644 --- a/src/emojis.py +++ b/src/emojis.py @@ -1,6 +1,7 @@ import re import json import logging +from os import path EXTRA_EMOJI = { "thumbup": "1f44d", @@ -67,7 +68,7 @@ regex = re.compile("(|:[\\w\\-\\~]+:)") def load_emojis(): global global_list, unicode_list, regex emoji_list = [] - with open("emoji.json", mode="r") as f: + with open(path.join(path.dirname(__file__), "emoji.json"), mode="r") as f: emoji_list = json.loads(f.readline().strip()) for emoji in EXTRA_EMOJI: emoji_list += [{"short_name": emoji, "unified": EXTRA_EMOJI[emoji]}] diff --git a/src/bot.py b/src/main.py similarity index 93% rename from src/bot.py rename to src/main.py index a427025..1cedc02 100644 --- a/src/bot.py +++ b/src/main.py @@ -2,7 +2,7 @@ from miniscord import Bot import logging import emojis -from emotes import EmotesScanner +from emotes_scanner import EmotesScanner logging.basicConfig( format="[%(asctime)s][%(levelname)s][%(module)s] %(message)s", level=logging.INFO