def __init__(self, bot): global gcmds self.bot = bot self.tasks = [] gcmds = globalcommands.GlobalCMDS(self.bot) self.bot.loop.create_task(self.init_disboard()) self.check_unsent_reminder.start()
def __init__(self, **kwargs): global gcmds super().__init__(command_prefix=kwargs['command_prefix'], help_command=kwargs["help_command"], shard_count=kwargs['shard_count'], description=kwargs["description"], fetch_offline_members=kwargs['fetch_offline_members'], status=kwargs['status'], activity=kwargs['activity'], intents=kwargs['intents']) self.uptime = kwargs['uptime'] self.db = kwargs.pop("db") gcmds = globalcommands.GlobalCMDS(bot=self) func_checks = (self.check_blacklist, self.disable_dm_exec, context.redirect) func_listen = (self.on_message, self.on_command_error, self.on_guild_join, self.on_guild_remove, self.on_member_join) for func in func_checks: self.add_check(func) for func in func_listen: self.event(func) cogs = [ filename[:-3] for filename in os.listdir('./cogs') if filename.endswith(".py") ] for cog in sorted(cogs): self.load_extension(f'cogs.{cog}') print(f"Cog \"{cog}\" has been loaded") self.loop.create_task(self.init_counters()) self.loop.create_task(self.all_loaded())
def __init__(self, bot: commands.AutoShardedBot): global gcmds self.bot = bot gcmds = globalcommands.GlobalCMDS(self.bot) self.bot.loop.create_task(self.init_logging()) self.guild_dispatch = logdispatcher.GuildDispatcher(self.bot) self.member_dispatch = logdispatcher.MemberDispatcher(self.bot)
def __init__(self, bot): global gcmds self.bot = bot self.messages = {} self.update_server_stats.start() gcmds = globalcommands.GlobalCMDS(bot=self.bot) self.bot.loop.create_task(self.init_requests())
def __init__(self, bot): global gcmds, PROHIB_NAMES self.bot = bot PROHIB_NAMES = [command.name.lower() for command in self.bot.commands] for command in self.bot.commands: if command.aliases: for alias in command.aliases: if not alias.lower() in PROHIB_NAMES: PROHIB_NAMES.append(alias.lower()) gcmds = globalcommands.GlobalCMDS(self.bot) self.bot.loop.create_task(self.init_tags())
def __init__(self, bot): global gcmds self.bot = bot gcmds = globalcommands.GlobalCMDS(self.bot)
import random from datetime import datetime import discord import praw import yaml from discord.ext import commands from utils import globalcommands gcmds = globalcommands.GlobalCMDS() class Reddit(commands.Cog): def __init__(self, bot): global gcmds self.bot = bot gcmds = globalcommands.GlobalCMDS(self.bot) async def get_id_secret(self, ctx): client_id = gcmds.env_check("REDDIT_CLIENT_ID") client_secret = gcmds.env_check("REDDIT_CLIENT_SECRET") user_agent = gcmds.env_check("USER_AGENT") if not all([client_id, client_secret, user_agent]): title = "Missing Reddit Client ID or Client Secret or User Agent" description = "Insert your Reddit Client ID, Client Secret, and User Agent in the `.env` file" embed = discord.Embed(title=title, description=description, color=discord.Color.dark_red()) await ctx.channel.send(embed=embed) return client_id, client_secret, user_agent
def __init__(self, bot: commands.AutoShardedBot): global gcmds self.bot = bot gcmds = globalcommands.GlobalCMDS(self.bot)
def __init__(self, bot): global gcmds self.bot = bot gcmds = globalcommands.GlobalCMDS(self.bot) self.bot.loop.create_task(self.init_c4())
def __init__(self, bot: commands.AutoShardedBot): global gcmds self.bot = bot gcmds = globalcommands.GlobalCMDS(self.bot) self.bot.loop.create_task(self.init_starboard())
def __init__(self, bot: commands.AutoShardedBot): global gcmds self.bot = bot self.bot.loop.create_task(self.init_nintendo()) gcmds = globalcommands.GlobalCMDS(self.bot)
def __init__(self, bot): global gcmds self.bot = bot gcmds = globalcommands.GlobalCMDS(self.bot) self.bot.loop.create_task(self.init_blacklist()) self.bot.loop.create_task(self.init_balance())
def __init__(self, bot: commands.AutoShardedBot): super().__init__() self.bot = bot self.min_level = LogLevel.BASIC self.gcmds = globalcommands.GlobalCMDS(self.bot)
def __init__(self, bot): global gcmds self.bot = bot self.bot.loop.create_task(self.init_cogs_list()) gcmds = globalcommands.GlobalCMDS(self.bot)
def __init__(self, bot: commands.AutoShardedBot): global gcmds self.bot = bot self.messages = {} self.update_server_stats.start() gcmds = globalcommands.GlobalCMDS(bot=self.bot)
def __init__(self, bot): global gcmds self.bot = bot gcmds = globalcommands.GlobalCMDS(self.bot) self.tasks = [] self.bot.loop.create_task(self.init_reminders())