Experimental Discord bot written in Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

base.py 391B

1234567891011121314151617
  1. from discord import Guild
  2. from discord.ext import commands
  3. from storage import Storage
  4. class BaseCog(commands.Cog):
  5. def __init__(self, bot):
  6. self.bot = bot
  7. def save_setting(guild: Guild, name: str, value):
  8. state: dict = Storage.state_for_guild(guild)
  9. state[name] = value
  10. Storage.save_guild_state(guild)
  11. def warn(guild: Guild):
  12. state: dict = Storage.state_for_guild(guild)