Exemplo n.º 1
0
async def info(ctx):
    embed = Embed(title="DiscordSearchBot Info")
    embed.set_author(name=get_config().authors)
    embed.set_footer(text=f"Apache License 2020")

    explanation_fields = [
        {"name": "Beschreibung",
         "value": "Der SearchBot ist ein Bot, mit dem man nach verschiedenene Dingen suchen kann."},
        {"name": "Prefix", "value": await get_prefix(None, ctx.message)},
        {"name": "Version", "value": get_version_name(get_config())},
        {"name": "GitHub", "value": get_config().github_link},
        {"name": "Authors", "value": f"OpenSource Projekt von {get_config().authors}"}
    ]

    for field in explanation_fields:
        embed.add_field(name=field["name"], value=field["value"], inline=False)

    await ctx.send(embed=embed)
Exemplo n.º 2
0
async def help(ctx):
    embed = Embed()

    embed.set_author(
        name="AdriBloober#9372 & TNT2k#7587",
        icon_url=
        "https://pbs.twimg.com/profile_images/843734935022256129/-2pD4h7u_400x400.jpg",
    )
    embed.set_footer(text=f"DiscordSearchBot {get_version_name(get_config())}")

    commands = [
        {
            "name": f"{await get_prefix(None, ctx.message)}help",
            "value": "Hilfe anzeigen",
        },
        {
            "name": f"{await get_prefix(None, ctx.message)}prefix",
            "value": "Prefix anzeigen",
        },
    ]
    admin_commands = [
        {
            "name": f"{await get_prefix(None, ctx.message)}deny @User",
            "value": "Nutzer für Google Anfragen sperren",
        },
        {
            "name": f"{await get_prefix(None, ctx.message)}allow @User",
            "value": "Nutzer für Google Anfragen entsperren",
        },
        {
            "name": f"{await get_prefix(None, ctx.message)}add_role @Role",
            "value": "Eine Admin Rolle hinzufügen",
        },
        {
            "name": f"{await get_prefix(None, ctx.message)}remove_role @Role",
            "value": "Eine Admin Rolle entfernen",
        },
        {
            "name":
            f"{await get_prefix(None, ctx.message)}change_google_reaction :emoji:",
            "value": "Das Google Reaction Emoji ändern",
        },
        {
            "name":
            f"{await get_prefix(None, ctx.message)}change_prefix PREFIX",
            "value": "Prefix ändern",
        },
    ]

    for command in commands:
        embed.add_field(name=command["name"],
                        value=command["value"],
                        inline=False)
    if await has_admin_permissions(ctx.guild, ctx.message.author):
        for command in admin_commands:
            embed.add_field(name=command["name"],
                            value=command["value"],
                            inline=False)

    embed.add_field(name="CX Types",
                    value="Mit diesen Commands kannst du googlen: ")

    for cx_type in get_config().ctx_types:
        embed.add_field(
            name=
            f"{await get_prefix(None, ctx.message)}{cx_type} <search_query>",
            value=f"Auf {cx_type} suchen",
            inline=False,
        )

    await ctx.send(embed=embed)
Exemplo n.º 3
0
from resources import get_config, update_config
"""
config:
{
  'client_id': '<client_id>',
  'client_secret': '<client_secret>',
  'user_agent': '<user_agent>'
}
"""
config = get_config()


def list():
    return config


def edit(client_id, client_secret, user_agent):
    config['client_id'] = client_id
    config['client_secret'] = client_secret
    config['user_agent'] = user_agent
    update_config(config)


def clear():
    edit(None, None, None)
Exemplo n.º 4
0
from resources import client, get_config

client.run(get_config().BOT_TOKEN)