From 45eb1419c41bb0857810daca106679fc0cbc18f7 Mon Sep 17 00:00:00 2001 From: louis chauvet Date: Sat, 1 Sep 2018 20:43:34 +0200 Subject: [PATCH] Update config when join a new guild --- main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.py b/main.py index c98d065..5f56ca4 100644 --- a/main.py +++ b/main.py @@ -81,6 +81,7 @@ class Guild: self.modules = [] self.load_config() self.update_modules() + self.save_config() def load_config(self): if self.bot.fileSystem.exists(self.config_file): @@ -211,6 +212,11 @@ class FoBot(discord.Client): async def on_resumed(self): info("foBot is resumed.") + async def on_guild_join(self, guild): + self.load_modules() + self.load_config() + self.save_config() + async def on_error(self, event, *args, **kwargs): error("foBot encounter an error.", exc_info=True) if os.environ.get("DROPBOX_ACCESS_TOKEN", False):