Compare commits
6 Commits
f38f52a78d
...
f14948e497
| Author | SHA1 | Date | |
|---|---|---|---|
| f14948e497 | |||
| 669339f717 | |||
| 3a17d001e1 | |||
| 9cbcfc5b6b | |||
| 6229dd1ade | |||
| e6f3864571 |
@ -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)
|
|
||||||
12
__main__.py
12
__main__.py
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/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
|
This program provides a bot that plays music in a voice chat and fulfills other
|
||||||
commands in text channels.
|
commands in text channels.
|
||||||
@ -12,7 +12,7 @@ Version: 0.1.0
|
|||||||
For detailed documentation, please refer to:
|
For detailed documentation, please refer to:
|
||||||
<url>
|
<url>
|
||||||
Source Code:
|
Source Code:
|
||||||
https://github.com/jtkick/[REDACTED]
|
https://github.com/jtkick/boywife-bot
|
||||||
"""
|
"""
|
||||||
|
|
||||||
PROJECT_VERSION = "0.1.0"
|
PROJECT_VERSION = "0.1.0"
|
||||||
@ -44,19 +44,19 @@ def main():
|
|||||||
root_logger.addHandler(console_handler)
|
root_logger.addHandler(console_handler)
|
||||||
|
|
||||||
# Get bot logger
|
# Get bot logger
|
||||||
logger = logging.getLogger("[REDACTED]-bot")
|
logger = logging.getLogger("boywife-bot")
|
||||||
|
|
||||||
# Load credentials
|
# Load credentials
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
TOKEN = os.getenv('DISCORD_TOKEN')
|
TOKEN = os.getenv('DISCORD_TOKEN')
|
||||||
|
|
||||||
# Create custom bot with database connection
|
# Create custom bot with database connection
|
||||||
class [REDACTED]Bot(commands.Bot):
|
class BoywifeBot(commands.Bot):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self.db = database.Database("[REDACTED]_bot.db")
|
self.db = database.Database("boywife_bot.db")
|
||||||
self.ai = OpenAI()
|
self.ai = OpenAI()
|
||||||
client = [REDACTED]Bot(
|
client = BoywifeBot(
|
||||||
command_prefix = '!',
|
command_prefix = '!',
|
||||||
intents=discord.Intents.all(),
|
intents=discord.Intents.all(),
|
||||||
log_hander=False
|
log_hander=False
|
||||||
|
|||||||
BIN
boywife.png
Normal file
BIN
boywife.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 101 KiB |
@ -10,20 +10,11 @@ import typing
|
|||||||
class Activities(commands.Cog):
|
class Activities(commands.Cog):
|
||||||
"""A cog to track and gather statistics on user activities."""
|
"""A cog to track and gather statistics on user activities."""
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
"""Related commands."""
|
|
||||||
__slots__ = ("nerd", "nerds", [REDACTED], [REDACTED])
|
|
||||||
=======
|
|
||||||
__slots__ = ("nerd", "nerds", "fword", "fwords")
|
__slots__ = ("nerd", "nerds", "fword", "fwords")
|
||||||
>>>>>>> 669339f (Made player controls based on Discord actions.)
|
|
||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.logger = logging.getLogger("activities")
|
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):
|
async def __local_check(self, ctx):
|
||||||
"""A local check which applies to all commands in this cog."""
|
"""A local check which applies to all commands in this cog."""
|
||||||
|
|||||||
@ -68,7 +68,7 @@ class Chatbot(commands.Cog):
|
|||||||
print(e)
|
print(e)
|
||||||
return '😴'
|
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):
|
async def chat_(self, ctx, *text):
|
||||||
await ctx.send(self.prompt(' '.join(text)))
|
await ctx.send(self.prompt(' '.join(text)))
|
||||||
|
|
||||||
|
|||||||
@ -27,9 +27,6 @@ LASTFM_API_KEY = os.getenv("LASTFM_API_KEY")
|
|||||||
|
|
||||||
# TEMORARY LIST OF SONGS
|
# TEMORARY LIST OF SONGS
|
||||||
songs = [
|
songs = [
|
||||||
<<<<<<< HEAD
|
|
||||||
[REDACTED]
|
|
||||||
=======
|
|
||||||
"I Love It - Icona Pop",
|
"I Love It - Icona Pop",
|
||||||
"Vanished - Crystal Castles",
|
"Vanished - Crystal Castles",
|
||||||
"We Like To Party - Vengaboys",
|
"We Like To Party - Vengaboys",
|
||||||
@ -89,7 +86,6 @@ songs = [
|
|||||||
"Baddy On The Floor - Jamix xx",
|
"Baddy On The Floor - Jamix xx",
|
||||||
"SWEET HONEY BUCKIIN' - Beyonce",
|
"SWEET HONEY BUCKIIN' - Beyonce",
|
||||||
"Boots & Boys - Ke$ha",
|
"Boots & Boys - Ke$ha",
|
||||||
>>>>>>> 669339f (Made player controls based on Discord actions.)
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Suppress noise about console usage from errors
|
# Suppress noise about console usage from errors
|
||||||
@ -555,30 +551,6 @@ class Music(commands.Cog):
|
|||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.players = {}
|
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):
|
async def cleanup(self, guild):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -6,11 +6,7 @@ import typing
|
|||||||
from cogs import music_player
|
from cogs import music_player
|
||||||
|
|
||||||
class Database:
|
class Database:
|
||||||
<<<<<<< HEAD
|
|
||||||
def __init__(self, path: str = "[REDACTED]_bot.db"):
|
|
||||||
=======
|
|
||||||
def __init__(self, path: str):
|
def __init__(self, path: str):
|
||||||
>>>>>>> 669339f (Made player controls based on Discord actions.)
|
|
||||||
self.path = path
|
self.path = path
|
||||||
self._ensure_db()
|
self._ensure_db()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user