Compare commits

..

6 Commits

7 changed files with 7 additions and 93 deletions

View File

@ -1,45 +0,0 @@
#!/usr/bin/env python3
import asyncio
import discord
from discord.ext import commands
from dotenv import load_dotenv
import logging
import os
import sys
import database
# Create custom logging handler
console_handler = logging.StreamHandler(sys.stdout)
console_formatter = logging.Formatter(
"[%(asctime)s] [%(levelname)s] [%(name)s] %(message)s")
console_handler.setFormatter(console_formatter)
# Make sure all loggers use this handler
root_logger = logging.getLogger()
root_logger.setLevel(logging.INFO)
root_logger.addHandler(console_handler)
# Get bot logger
logger = logging.getLogger("[REDACTED]-bot")
# Load credentials
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
# client = discord.Client()
client = commands.Bot(
command_prefix = '!', intents=discord.Intents.all(), log_hander=False)
# You need to import os for this method
@client.event
async def on_ready():
logger.info(f'{client.user} is now running')
# Load cogs
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
await client.load_extension(f'cogs.{filename[:-3]}')
logger.info(f'Loaded {filename} cog')
client.run(TOKEN, log_handler=None)

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
[REDACTED] - A Discord bot for the [REDACTED] Discord server.
BoywifeBot - A Discord bot for the Gayming Group Discord server.
This program provides a bot that plays music in a voice chat and fulfills other
commands in text channels.
@ -12,7 +12,7 @@ Version: 0.1.0
For detailed documentation, please refer to:
<url>
Source Code:
https://github.com/jtkick/[REDACTED]
https://github.com/jtkick/boywife-bot
"""
PROJECT_VERSION = "0.1.0"
@ -44,19 +44,19 @@ def main():
root_logger.addHandler(console_handler)
# Get bot logger
logger = logging.getLogger("[REDACTED]-bot")
logger = logging.getLogger("boywife-bot")
# Load credentials
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
# Create custom bot with database connection
class [REDACTED]Bot(commands.Bot):
class BoywifeBot(commands.Bot):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.db = database.Database("[REDACTED]_bot.db")
self.db = database.Database("boywife_bot.db")
self.ai = OpenAI()
client = [REDACTED]Bot(
client = BoywifeBot(
command_prefix = '!',
intents=discord.Intents.all(),
log_hander=False

BIN
boywife.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

View File

@ -10,20 +10,11 @@ import typing
class Activities(commands.Cog):
"""A cog to track and gather statistics on user activities."""
<<<<<<< HEAD
"""Related commands."""
__slots__ = ("nerd", "nerds", [REDACTED], [REDACTED])
=======
__slots__ = ("nerd", "nerds", "fword", "fwords")
>>>>>>> 669339f (Made player controls based on Discord actions.)
def __init__(self, bot):
self.bot = bot
self.logger = logging.getLogger("activities")
<<<<<<< HEAD
self.db = database.Database("[REDACTED]_bot.db")
=======
>>>>>>> 669339f (Made player controls based on Discord actions.)
async def __local_check(self, ctx):
"""A local check which applies to all commands in this cog."""

View File

@ -68,7 +68,7 @@ class Chatbot(commands.Cog):
print(e)
return '😴'
@commands.command(name='chat', aliases=[[REDACTED], [REDACTED], [REDACTED], 'bot'], description="Command for chatting with chatbot.")
@commands.command(name='chat', aliases=['boywife', 'bb', 'bw', 'bot'], description="Command for chatting with chatbot.")
async def chat_(self, ctx, *text):
await ctx.send(self.prompt(' '.join(text)))

View File

@ -27,9 +27,6 @@ LASTFM_API_KEY = os.getenv("LASTFM_API_KEY")
# TEMORARY LIST OF SONGS
songs = [
<<<<<<< HEAD
[REDACTED]
=======
"I Love It - Icona Pop",
"Vanished - Crystal Castles",
"We Like To Party - Vengaboys",
@ -89,7 +86,6 @@ songs = [
"Baddy On The Floor - Jamix xx",
"SWEET HONEY BUCKIIN' - Beyonce",
"Boots & Boys - Ke$ha",
>>>>>>> 669339f (Made player controls based on Discord actions.)
]
# Suppress noise about console usage from errors
@ -555,30 +551,6 @@ class Music(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.players = {}
<<<<<<< HEAD
self.last_tag_play_time = datetime.datetime.now()
# Get a reference to the database
# TODO: MAKE THIS INJECTED
self.db = database.Database("[REDACTED]_bot.db")
# def update_cache():
# with yt_dlp.YoutubeDL({'quiet': True}) as ydl:
# self.[REDACTED]_tracks = ydl.extract_info('https://soundcloud.com/[REDACTED]', download=False)['entries']
# with open('soundcloud-cache', 'w') as f:
# f.write(str(self.[REDACTED]_tracks))
# # pickle.dump(self.[REDACTED]_tracks, f)
# if os.path.exists('soundcloud-cache'):
# with open('soundcloud-cache', 'r') as f:
# exec(f'self.[REDACTED]_tracks = {f.read()}')
# # self.[REDACTED]_tracks = pickle.load(f)
# threading.Thread(target=update_cache).start()
# else:
# update_cache()
=======
>>>>>>> 669339f (Made player controls based on Discord actions.)
async def cleanup(self, guild):
try:

View File

@ -6,11 +6,7 @@ import typing
from cogs import music_player
class Database:
<<<<<<< HEAD
def __init__(self, path: str = "[REDACTED]_bot.db"):
=======
def __init__(self, path: str):
>>>>>>> 669339f (Made player controls based on Discord actions.)
self.path = path
self._ensure_db()