Beispiel #1
0
async def send_rules(client, message, args):
    await delete_user_message(message)
    for key, val in help_text("bot_admin", "rule_set").items():
        is_ger = True if key == "ger_ruleset" else False
        channel = client.get_channel(
            EX_GER_RULE_CHANNEL) if is_ger else client.get_channel(
                EX_ENG_RULE_CHANNEL)

        embed = discord.Embed(description=val["description"],
                              color=discord.Color.red())
        for idx, rule in enumerate(val["rules"].values()):
            embed.add_field(name=f"{'Regel' if is_ger else 'Rule'} {idx + 1}",
                            value=rule,
                            inline=False)
        embed.add_field(name=f"{'Abschluss' if is_ger else 'End'}",
                        value=val["end"],
                        inline=False)
        await channel.send(embed=embed)

        try:
            for name, text in val["supplement"].items():
                embed = discord.Embed(title=name,
                                      description=text,
                                      color=discord.Color.red())
                await channel.send(embed=embed)
        except AttributeError:
            pass
Beispiel #2
0
async def send_welcome(client, message, args):
    await delete_user_message(message)
    channel = client.get_channel(EX_WELCOME_CHANNEL)
    for key, val in help_text("bot_bot", "welcome_set").items():
        if key == "warning":
            await channel.send(content=val)
        else:
            mes = await channel.send(embed=discord.Embed(description=val, color=333333))
            if key == "command_overview":
                for emoji in roles.keys():
                    await mes.add_reaction(emoji)
Beispiel #3
0
async def on_member_join(mem: discord.Member):
    if mem.guild.id == EX_SERVER:
        await send_log_message(client, mem,
                               f"{mem.display_name} has joined the server")
        channel = client.get_channel(EX_WELCOME_CHANNEL)
        mention = await channel.send(f"<@!{mem.id}>")
        text = help_text("bot_admin", "welcome_set")["member_join"]
        member_mes = await channel.send(
            embed=discord.Embed(description=text, color=333333))
        await asyncio.sleep(300)
        await delete_user_message(member_mes)
        await delete_user_message(mention)
Beispiel #4
0
async def getn(client, message, args):
    await delete_user_message(message)
    em = discord.Embed(title="You need help for getnative?", description=help_text("bot_bot", "getnative_links"))
    await message.channel.send(embed=em)
Beispiel #5
0
async def ffmpeg(client, message, args):
    await delete_user_message(message)
    em = discord.Embed(title="ffmpeg?", description=help_text("bot_bot", "ffmpeg_links"))
    await message.channel.send(embed=em)
Beispiel #6
0
async def vapoursynth(client, message, args):
    await delete_user_message(message)
    em = discord.Embed(title="You need help for VapourSynth?", description=help_text("bot_bot", "vs_links"))
    await message.channel.send(embed=em)
Beispiel #7
0
    ]:
        await private_msg(message, f"```\n{val}```")


NAMES = [
    "Satan", "God", "Myself", "yuri", "GNU/Linux", "a brigher future",
    "hopelessness", "weeabooism", "Tatsuya", "eXmendiC (F*****T)", "Infi",
    "pipapo", "proprietary", "Arch", "trash"
]


@register_command(description='Select one of the given choices.')
@add_argument('choices', nargs='+')
async def choose(client, message, args):
    choice = random.choice(args.choices)
    name = random.choice(NAMES + [message.author.name])

    await message.channel.send(f"In the name of {name} I choose: {choice}")


async def text_handler(_, message, args, *, name, text):
    await delete_user_message(message)
    em = discord.Embed(title=f"Helpful links for {name}", description=text)
    await message.channel.send(embed=em)


for _name, _text in help_text("bot_bot").items():
    callback = partial(text_handler, name=_name, text=_text)
    register_command(_name,
                     description=f"[Link] Helpful links for {_name}")(callback)