Some small improvements

This commit is contained in:
Marco Thomas
2020-10-08 10:05:58 +02:00
parent 24c416a80b
commit 4a5933729b
12 changed files with 48 additions and 71 deletions

View File

@@ -13,18 +13,13 @@ This project uses discordpy:
https://discordpy.readthedocs.io/en/latest/intro.html
"""
# IMPORTS - external
import discord
from discord.ext import commands
import logging
from datetime import datetime
import platform
import random
import asyncio
import sys
import os
# SET VARS
PREFIX = os.environ['PREFIX']
TOKEN = os.environ['TOKEN']
REDDIT_CLIENT_ID = os.environ['REDDIT_CLIENT_ID']
@@ -33,9 +28,7 @@ REDDIT_CLIENT_USERAGENT = os.environ['REDDIT_CLIENT_USERAGENT']
AVATAR = "https://i.redd.it/0uajctrps9u41.jpg"
# LOGGING
logger = logging.getLogger("discord")
logger.setLevel(logging.INFO)
handler = logging.FileHandler(
filename="logs/discord.log",
@@ -45,12 +38,13 @@ handler.setFormatter(
logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(message)s"))
logger.addHandler(handler)
# INIT
bot = commands.Bot(
command_prefix=PREFIX,
description="Holy Goddess Aqua!")
# LOAD COGS
########## Load Cogs
cogs = [
"cogs.admin",
"cogs.anime",
@@ -70,7 +64,8 @@ for cog in cogs:
else:
print(f"SUCCESS: Loaded {cog}")
# BOT STARTING EVENT
########## Start Bot
@bot.event
async def on_ready():
"""
@@ -92,9 +87,9 @@ async def on_ready():
activity = discord.Activity(name=name, type=discord.ActivityType.playing)
await bot.change_presence(activity=activity)
print(f"AquaBot is ready!\n")
print("AquaBot is ready!\n")
# START BOT
bot.run(
TOKEN,
bot=True,