def setup(bot: aoi.AoiBot) -> None: fun = Fun(bot) async def exec_customcmd(_, ctx: aoi.AoiContext, user: discord.Member): command = ctx.command.name await ctx.embed( title=random.choice(fun.custom_reactions[command].responses) .replace("{user}", ctx.author.display_name) # noqa .replace("{target}", user.display_name), image=random.choice(fun.custom_reactions[command].images) ) bot.add_cog(fun) with open("loaders/custreact.yaml") as fp: doc = YAML().load(fp) for key in doc: fun.custom_reactions[key] = CustomReaction(doc[key]["responses"], doc[key]["images"]) cmd = commands.Command( name=key, func=exec_customcmd, brief=f"{key} custom command", ) cmd.cog = fun fun.bot.add_command(cmd) fun.__cog_commands__ += (cmd,)
def setup(bot: aoi.AoiBot) -> None: if not bot.patreon_id or not bot.patreon_secret: bot.logger.warn("patreon:Not loading cog") bot.logger.warn( "patreon: both PATREON_ID and PATREON_CAMPAIGN must be present in .env" ) bot.add_cog(Patreon(bot))
def setup(bot: aoi.AoiBot) -> None: fun = Roleplay(bot) bot.add_cog(fun) async def get_data(name) -> Tuple[RoleplayResponse, str]: async with aiohttp.ClientSession() as sess: async with sess.get(f"https://api.waifu.pics/sfw/{name}") as resp: return fun.roleplay_responses[name], (await resp.json())["url"] async def exec_multi_rp_command(self: Roleplay, ctx: aoi.AoiContext, user: discord.Member): resp, image = await get_data(ctx.command.name) await ctx.embed(description=random.choice(resp.phrases).format( f"**{ctx.author.display_name}**", f"**{user.display_name}**"), image=image) async def exec_single_rp_command(self: Roleplay, ctx: aoi.AoiContext): resp, image = await get_data(ctx.command.name) await ctx.embed(description=random.choice( resp.phrases).format(f"**{ctx.author.display_name}**"), image=image) with open("loaders/roleplay.yaml") as fp: doc = YAML().load(fp) for key in doc: if doc[key]["enabled"] == "no": continue fun.roleplay_responses[key] = RoleplayResponse( doc[key]["multi"] == "yes", doc[key]["phrases"]) cmd = commands.Command( name=key, func=exec_multi_rp_command if fun.roleplay_responses[key].multi else exec_single_rp_command, brief=f"{key} someone" if fun.roleplay_responses[key].multi else f"{key} roleplay command", usage="@member" if fun.roleplay_responses[key].multi else None) cmd.cog = fun fun.bot.add_command(cmd) fun.__cog_commands__ += (cmd, )
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Guides(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(GuildSettings(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Profile(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Polls(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Colors(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(GlobalShop(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Permissions(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Messages(bot))
def __init__(self, bot: aoi.AoiBot): self.bot = bot bot.slash = SlashCommand(bot, override_type=True, auto_delete=True, auto_register=True) self.bot.slash.get_cog_commands(self) bot.loop.create_task(self.register_commands()) super(Slash, self).__init__()
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Utility(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Slash(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Searches(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Information(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(TaskManagement(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(WelcomeGoodbye(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Moderation(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Currency(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(ErrorHandler(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Quotes(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Channels(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Geolocation(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(XP(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Triggers(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(ServerGambling(bot))
def setup(bot: aoi.AoiBot) -> None: fun = Fun(bot) bot.add_cog(fun)
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Roles(bot))
def setup(bot: aoi.AoiBot) -> None: bot.add_cog(Weather(bot))