Esempio n. 1
0
async def create_db_pool():
    try:
        bot.pg_con = await asyncpg.create_pool(
            database="levels_db",
            user="******",
            password=DATA.get("postgresql_password"))
    except BaseException:
        display_start_error()
Esempio n. 2
0
from itertools import cycle
from cogs.anubis_methods import DATA, check_for_run_settings, write_temp, check_for_servers, display_start_error, display_title_screen, search_for_updates
from colorama import Fore, init
init()


# Check for basic files needed and write the temp file.

DATA = check_for_run_settings()
write_temp()
check_for_servers()


# Sets the bot prefix to the prefix specified in the JSON file.

if DATA.get("prefix").strip().replace(" ", "") == "":
    display_start_error("No prefix!")
else:
    intents = discord.Intents.default()
    intents.members = True
    bot = commands.Bot(command_prefix=DATA.get("prefix"), intents=intents)


# Status' to be cycled continously as the bot runs.
# You add or change these status' here - make sure to have at least one.

status = cycle(['against raiders!', f'{DATA.get("prefix")}help for commands!'])


# Removes the default help command (Help command is replaced by an embed
# further down in the code).