diff --git a/Dolly.ico b/Dolly.ico new file mode 100644 index 0000000..9d2b900 Binary files /dev/null and b/Dolly.ico differ diff --git a/Dolly.png b/Dolly.png new file mode 100644 index 0000000..e1f9b1c Binary files /dev/null and b/Dolly.png differ diff --git a/config.py b/config.py deleted file mode 100644 index 65af4f9..0000000 --- a/config.py +++ /dev/null @@ -1,14 +0,0 @@ -import os -from dotenv import load_dotenv -import discord - -def load_config(): - load_dotenv() - return { - "discord_token": os.getenv("DISCORD_BOT_TOKEN") - } - -def get_intents(): - intents = discord.Intents.default() - intents.message_content = True - return intents \ No newline at end of file diff --git a/database.py b/database.py deleted file mode 100644 index 9abda91..0000000 --- a/database.py +++ /dev/null @@ -1,33 +0,0 @@ -import sqlite3 - -def setup_database(): - conn = sqlite3.connect('todos.db') - cursor = conn.cursor() - cursor.execute('''CREATE TABLE IF NOT EXISTS todos (content TEXT)''') - conn.commit() - return conn - -def add_todo(conn, todo_item): - try: - cursor = conn.cursor() - cursor.execute("INSERT INTO todos (content) VALUES (?)", (todo_item,)) - conn.commit() - return True - except Exception as e: - print(f"Error adding to-do: {e}") - return False - -def list_todos(conn): - cursor = conn.cursor() - cursor.execute("SELECT rowid, content FROM todos") - return cursor.fetchall() - -def remove_todo(conn, todo_id): - try: - cursor = conn.cursor() - cursor.execute("DELETE FROM todos WHERE rowid = ?", (todo_id,)) - conn.commit() - return True - except Exception as e: - print(f"Error removing to-do: {e}") - return False \ No newline at end of file diff --git a/main.py b/main.py deleted file mode 100644 index 4f4dc3b..0000000 --- a/main.py +++ /dev/null @@ -1,47 +0,0 @@ -import discord -from discord.ext import commands -from config import load_config, get_intents -from database import setup_database, add_todo, list_todos, remove_todo - -config = load_config() -intents = get_intents() -bot = commands.Bot(command_prefix='!', intents=intents) - -# Replace 'YOUR_USER_ID' with the actual Discord ID of the user -AUTHORIZED_USER_ID = '96701265748168704' - -conn = setup_database() - -@bot.event -async def on_ready(): - print(f'{bot.user.name} has connected to Discord!') - -@bot.command(name='todo', help='Adds a new to-do item') -async def todo_command(ctx, *, todo_item: str): - if add_todo(conn, todo_item): - await ctx.send(f"Added to-do: {todo_item}") - else: - await ctx.send("Error adding to-do.") - -@bot.command(name='listtodos', help='Lists all to-do items') -async def listtodos_command(ctx): - todos = list_todos(conn) - response = "To-Do List:\n" + "\n".join([f"{id}: {content}" for id, content in todos]) - await ctx.send(response) - -@bot.command(name='removetodo', help='Removes a to-do item by its ID') -async def removetodo_command(ctx, todo_id: int): - if remove_todo(conn, todo_id): - await ctx.send(f"Removed to-do with ID {todo_id}") - else: - await ctx.send("Error removing to-do.") - -@bot.command(name='shutdown', help='Shuts down the bot if authorized') -async def shutdown(ctx): - if str(ctx.author.id) == AUTHORIZED_USER_ID: - await ctx.send('Shutting down. Bye!') - await bot.close() - else: - await ctx.send('You do not have permission to shut down the bot.') - -bot.run(config["discord_token"]) \ No newline at end of file diff --git a/todos.db b/todos.db deleted file mode 100644 index 4c820b9..0000000 Binary files a/todos.db and /dev/null differ