示例#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)
示例#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)
示例#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()
示例#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)
示例#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
示例#6
0
def setup(bot: commands.bot.Bot):
    check_folders()
    check_files()

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

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