Change load order in admin commands
This commit is contained in:
parent
919dfcb4a0
commit
f77b763566
1 changed files with 2 additions and 1 deletions
|
@ -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.")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue