Exemple #1
0
class Dashboard(
        DashboardRolesMixin,
        DashboardWebserverMixin,
        DashboardSettingsMixin,
        DBMixin,
        commands.Cog,
        metaclass=CompositeMetaClass,
):

    __version__ = "0.1.6a"

    def __init__(self, bot: Red, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.bot = bot

        self.config = Config.get_conf(self, identifier=473541068378341376)
        self.config.register_global(
            secret="[Not set]",
            redirect="http://127.0.0.1:42356/callback",
            clientid=0,
            blacklisted=[],
            disallowedperms=[],
            support="",
            defaultcolor="red",
            meta={
                "title": "",
                "icon": "",
                "description": "",
                "color": ""
            },
        )
        self.config.register_guild(roles=[])
        self.configcache = defaultdict(self.cache_defaults)

        self.rpc = DashboardRPC(self)

    def cog_unload(self):
        self.configcache.clear()
        self.rpc.unload()

    def cache_defaults(self):
        return {"roles": []}

    async def initialize(self):
        config = await self.config.all_guilds()
        for k, v in config.items():
            self.configcache[k] = v
Exemple #2
0
    def __init__(self, bot: Red, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.bot = bot

        self.config = Config.get_conf(self, identifier=473541068378341376)
        self.config.register_global(
            secret="[Not set]",
            redirect="http://127.0.0.1:42356/callback",
            blacklisted=[],
            disallowedperms=[],
            owner_perm=15,
            widgets=[],
            testwidgets=[],
            support="",
            defaultcolor="red",
        )
        self.config.register_guild(roles=[])
        self.configcache = defaultdict(self.cache_defaults)

        self.rpc = DashboardRPC(self)
Exemple #3
0
    def __init__(self, bot: Red, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.bot = bot

        self.config = Config.get_conf(self, identifier=473541068378341376)
        self.config.register_global(
            secret="[Not set]",
            redirect="http://127.0.0.1:42356/callback",
            clientid=0,
            blacklisted=[],
            disallowedperms=[],
            support="",
            defaultcolor="red",
            meta={
                "title": "",
                "icon": "",
                "description": "",
                "color": ""
            },
        )
        self.config.register_guild(roles=[])
        self.configcache = defaultdict(self.cache_defaults)

        self.rpc = DashboardRPC(self)