Skip to content

Commit ef8948a

Browse files
authored
Merge pull request #29 from qrexpy/main
Bug Fixes
2 parents 017db21 + 66bdfe7 commit ef8948a

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

bot/controller.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
from bot.helpers import cmdhelper, imgembed
1616
import utils.webhook as webhook_client
1717
from gui.helpers.images import resize_and_sharpen
18-
from pypresence import Presence, ActivityType
18+
from bot.helpers.spypet import Spypet
1919

2020
if getattr(sys, 'frozen', False):
2121
os.chdir(os.path.dirname(sys.executable))
2222

2323
class BotController:
24+
spypet = None
25+
2426
def __init__(self):
2527
self.cfg = Config()
2628
self.bot = None
@@ -31,6 +33,7 @@ def __init__(self):
3133
self.bot_running = False
3234
self.startup_scripts = []
3335
self.presence = self.cfg.get_rich_presence()
36+
self.spypet = Spypet()
3437

3538
def add_startup_script(self, script):
3639
self.startup_scripts.append(script)

bot/helpers/spypet.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Spypet:
2+
def __init__(self):
3+
self.bot = None
4+
self.messages = {}
5+
6+
def set_bot(self, bot):
7+
self.bot = bot
8+
9+
def add_message(self, guild, channel, message):
10+
if guild.name not in self.messages:
11+
self.messages[guild.name] = {}
12+
if channel.name not in self.messages[guild.name]:
13+
self.messages[guild.name][channel.name] = []
14+
self.messages[guild.name][channel.name].append(message)
15+
16+
def clear_messages(self):
17+
self.messages = {}

gui/components/settings/theming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def __init__(self, root, parent, images, config):
1313
self.themes = self.cfg.get_themes()
1414
self.theme_dict = self.cfg.theme.to_dict()
1515

16-
def _save_theme(self, _):
16+
def _save_theme(self, _=None):
1717
for index, (key, _) in enumerate(self.theme_dict.items()):
1818
self.cfg.theme.set(key, self.theme_tk_entries[index].get())
1919

0 commit comments

Comments
 (0)