auto update roles
@@ -41,12 +41,20 @@ class Loops(commands.Cog):
await asyncio.sleep(43200)
system("pg_dump villagerbot | gzip > ../database-backups/{0}.gz".format(arrow.utcnow().ctime().replace(" ", "_").replace(":", ".")))
+ async def update_roles(self):
+ while self.bot.is_ready():
+ await asyncio.sleep(10*60)
+ econ = self.bot.get_cog("Econ")
+ for user in self.bot.get_guild(641117791272960031).members:
+ await econ.update_user_role(user.id)
+
@commands.Cog.listener()
async def on_ready(self):
self.bot.loop.create_task(self.update_activity())
self.bot.loop.create_task(self.reset_cmd_vect_counter())
self.bot.loop.create_task(self.reset_vote_vect_counter())
self.bot.loop.create_task(self.backup_database())
+ self.bot.loop.create_task(self.update_roles())
def setup(bot):
