QOL Updates

This commit is contained in:
Marco Thomas
2021-03-03 17:44:47 +01:00
parent e14a1ef2a3
commit 87bce0be57
12 changed files with 24 additions and 104 deletions

View File

@@ -5,10 +5,9 @@
\__,_|\__, |\__,_|\__,_|_.__/ \___/ \__|
|_|
created by Marc.
by MarcMK
This project uses discordpy:
https://discordpy.readthedocs.io/en/latest/intro.html
This project uses discordpy: https://discordpy.readthedocs.io/en/latest/intro.html
"""
import discord
@@ -17,7 +16,7 @@ import logging
import platform
import os
# Environment
PREFIX = os.environ['PREFIX']
TOKEN = os.environ['TOKEN']
REDDIT_CLIENT_ID = os.environ['REDDIT_CLIENT_ID']
@@ -25,33 +24,26 @@ REDDIT_CLIENT_SECRET = os.environ['REDDIT_CLIENT_SECRET']
REDDIT_CLIENT_USERAGENT = os.environ['REDDIT_CLIENT_USERAGENT']
AVATAR = "https://i.redd.it/0uajctrps9u41.jpg"
# Logger
logger = logging.getLogger("discord")
logger.setLevel(logging.INFO)
handler = logging.FileHandler(
filename="logs/discord.log",
encoding="utf-8",
mode="w")
handler.setFormatter(
logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(message)s"))
handler = logging.FileHandler(filename="logs/discord.log", encoding="utf-8", mode="w")
handler.setFormatter(logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(message)s"))
logger.addHandler(handler)
bot = commands.Bot(
command_prefix=PREFIX,
description="Holy Goddess Aqua!")
# Bot declaration
bot = commands.Bot(command_prefix=PREFIX, description="Holy Goddess Aqua!")
# Preloaded Cogs
cogs = [
"cogs.admin",
cogs = ["cogs.admin",
"cogs.anime",
"cogs.help",
"cogs.jikan",
"cogs.meme",
"cogs.music",
# "cogs.music",
"cogs.reddit",
"cogs.utility",
"cogs.welcome"
]
"cogs.welcome"]
for cog in cogs:
try:
@@ -61,13 +53,9 @@ for cog in cogs:
else:
print(f"SUCCESS: Loaded {cog}")
########## Start Bot
# Start Bot
@bot.event
async def on_ready():
"""
This prints some information about the bot, while starting up
"""
bot.AppInfo = await bot.application_info()
startup = f"""
@@ -76,17 +64,15 @@ async def on_ready():
Command Prefix: {PREFIX}\n
discord.py Version: {discord.__version__}\n
python Version: {platform.python_version()}\n
OS: {platform.system()} {platform.release()} {platform.version()}\n
"""
print(startup)
name = f"with water | {PREFIX}aquabot"
activity = discord.Activity(name=name, type=discord.ActivityType.playing)
activity_name = f"with water | {PREFIX}aquabot"
activity = discord.Activity(activity_name=name, type=discord.ActivityType.playing)
await bot.change_presence(activity=activity)
print("AquaBot is ready!\n")
bot.run(TOKEN,
bot=True,
reconnect=True)