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()
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).
from discord.ext import commands, tasks 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 for tmp file DATA = check_for_run_settings() write_temp() check_for_servers() # sets bot prefix to the one specified in the JSON file if DATA.get("prefix").strip().replace(" ", "") == "": display_start_error() else: intents = discord.Intents.default() intents.members = True bot = commands.Bot(command_prefix=DATA.get("prefix"), intents=intents) # cycle status continously as the bot runs # add or change the status here. make sure to have a minimum of one status = cycle(['against raiders!', f'{DATA.get("prefix")}help for commands!']) # gets rid of the default help command bot.remove_command('help')