More protection - State does it's own saving

This commit is contained in:
Marc Di Luzio 2024-08-13 23:43:15 +01:00
parent cbea7abca2
commit 57f65b265c
5 changed files with 27 additions and 29 deletions

View file

@ -3,7 +3,7 @@ Owner bot cog
"""
import logging
from discord.ext import commands
from state import State, AuthScope, save_to_file
from state import State, AuthScope
logger = logging.getLogger("owner")
logger.setLevel(logging.INFO)
@ -49,7 +49,6 @@ class OwnerCog(commands.Cog):
"""
if user.isdigit():
self._state.set_user_scope(str(user), AuthScope.MATCHER)
save_to_file(self._state)
logger.info("Granting user %s matcher scope", user)
await ctx.reply("Done!", ephemeral=True)
else: