def setup(bot: commands.bot.Bot): check_folders() check_files() n = Customjoinleave(bot) bot.add_listener(n.voice_state_update, "on_voice_state_update") bot.add_cog(n)
def setup(bot: commands.bot.Bot): check_folders() check_files() n = Membership(bot) bot.add_listener(n.member_join, "on_member_join") bot.add_listener(n.member_leave, "on_member_remove") bot.add_listener(n.member_ban, "on_member_ban") bot.add_listener(n.member_unban, "on_member_unban") bot.add_cog(n)
async def impersonate(bot: commands.bot.Bot, message: str, user: discord.User, channel: discord.TextChannel): if type(channel) == int: channel = bot.get_channel(channel) if type(user) == int: user = bot.get_user(user) member = channel.guild.get_member(user.id) webhook = await channel.create_webhook( name=f"[HWBot] {member.name} impersonator") username = f"[Bot] {member.display_name}" await webhook.send(message, username=username, avatar_url=user.avatar_url) await webhook.delete()
async def ready(bot: commands.bot.Bot) -> None: channel = check(bot) bot.channel = channel # necessary from cron tasks, context.channel is used in others functions log.info('CTFdBot is coming !') to_send = f'Hello, it seems that it\'s the first time you are using my services.\nYou might use ' \ f'`{bot.command_prefix}help` to know more about my features.' embed_color, embed_name = 0x000000, "CTFd Bot" await interrupt(channel, to_send, embed_color=embed_color, embed_name=embed_name)
async def multiple_wait_for(bot: commands.bot.Bot, events: list[dict[str, int, Callable]]): done, pending = await asyncio.wait([ bot.wait_for(event['event_type'], timeout=event['timeout'], check=event['check']) for event in events ], return_when=asyncio.FIRST_COMPLETED) try: stuff = done.pop().result() except asyncio.TimeoutError: stuff = asyncio.TimeoutError for future in done: future.exception() for future in pending: future.cancel() return stuff
def setup(bot: commands.bot.Bot): check_folders() check_files() bot.add_cog(RandGame(bot))
def setup(bot: commands.bot.Bot) -> None: """Sets up the cog.""" bot.add_cog(AnimalCog(bot))
def setup(bot: commands.bot.Bot): bot.add_cog(Playsound(bot))
def setup(bot: commands.bot.Bot): bot.add_cog(Randimals(bot))
def setup(bot: commands.bot.Bot): check_folders() check_files() bot.add_cog(Reviewemoji(bot))
def setup(bot: commands.bot.Bot): bot.add_cog(Catfact(bot))
def setup(bot: commands.bot.Bot): bot.add_cog(Massdm(bot))
def setup(bot: commands.bot.Bot): check_folders() check_files() bot.add_cog(Quotes(bot))
async def ready(bot: commands.bot.Bot) -> None: channel = check(bot) bot.channel = channel # necessary from cron tasks, context.channel is used in others functions log.info('CTFdBot is ready!')
def setup(bot: commands.bot.Bot): bot.add_cog(Say(bot))
def setup(bot: commands.bot.Bot): bot.add_cog(Voice(bot))