Change load order in admin commands

This commit is contained in:
Zeva Rose 2021-06-30 18:05:39 -06:00
parent 919dfcb4a0
commit f77b763566

View file

@ -172,6 +172,7 @@ class OwnerCog(commands.Cog):
self.db.mongo.jarvis.config.update_one( self.db.mongo.jarvis.config.update_one(
{"key": "admins"}, {"$set": {"value": self.admins}} {"key": "admins"}, {"$set": {"value": self.admins}}
) )
reload_config()
await ctx.send( await ctx.send(
f"{user.mention} is now an admin. Use this power carefully." f"{user.mention} is now an admin. Use this power carefully."
) )
@ -182,11 +183,11 @@ class OwnerCog(commands.Cog):
if user.id not in self.admins: if user.id not in self.admins:
await ctx.send(f"{user.mention} is not an admin.") await ctx.send(f"{user.mention} is not an admin.")
return return
self.admins.remove(user.id)
self.db.mongo.jarvis.config.update_one( self.db.mongo.jarvis.config.update_one(
{"key": "admins"}, {"$set": {"value": self.admins}} {"key": "admins"}, {"$set": {"value": self.admins}}
) )
reload_config() reload_config()
self.admins = get_config().admins
await ctx.send(f"{user.mention} is no longer an admin.") await ctx.send(f"{user.mention} is no longer an admin.")