Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
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()
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
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
Ejemplo n.º 6
0
def setup(bot: commands.bot.Bot):
    check_folders()
    check_files()

    bot.add_cog(RandGame(bot))
Ejemplo n.º 7
0
def setup(bot: commands.bot.Bot) -> None:
    """Sets up the cog."""
    bot.add_cog(AnimalCog(bot))
Ejemplo n.º 8
0
def setup(bot: commands.bot.Bot):
    bot.add_cog(Playsound(bot))
Ejemplo n.º 9
0
def setup(bot: commands.bot.Bot):
    bot.add_cog(Randimals(bot))
Ejemplo n.º 10
0
def setup(bot: commands.bot.Bot):
    check_folders()
    check_files()

    bot.add_cog(Reviewemoji(bot))
Ejemplo n.º 11
0
def setup(bot: commands.bot.Bot):
    bot.add_cog(Catfact(bot))
Ejemplo n.º 12
0
def setup(bot: commands.bot.Bot):
    bot.add_cog(Massdm(bot))
Ejemplo n.º 13
0
def setup(bot: commands.bot.Bot):
    check_folders()
    check_files()
    bot.add_cog(Quotes(bot))
Ejemplo n.º 14
0
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!')
Ejemplo n.º 15
0
def setup(bot: commands.bot.Bot):
    bot.add_cog(Say(bot))
Ejemplo n.º 16
0
def setup(bot: commands.bot.Bot):
    bot.add_cog(Voice(bot))