25 lines
No EOL
658 B
Text
25 lines
No EOL
658 B
Text
import discord
|
|
from discord.ext.commands import Cog
|
|
from os import getenv, path, makedirs
|
|
import logging
|
|
|
|
if not path.exists('.logs'):
|
|
makedirs('.logs')
|
|
|
|
logger = logging.getLogger(__name__)
|
|
logger.setLevel(logging.WARNING)
|
|
fh = logging.FileHandler('.logs/mumble.log')
|
|
formatter = logging.Formatter('%(asctime)s | %(name)s | [%(levelname)s] %(message)s', '%Y-%m-%d %H:%M:%S')
|
|
fh.setFormatter(formatter)
|
|
if not len(logger.handlers):
|
|
logger.addHandler(fh)
|
|
|
|
def setup(bot: discord.Bot):
|
|
bot.add_cog(Mumble(bot))
|
|
|
|
class Mumble(Cog):
|
|
"""Bridge to Mumble"""
|
|
|
|
def __init__(self, bot: discord.Bot):
|
|
self.bot: discord.Bot = bot
|
|
print("Initialized Music cog") |