diff --git a/main.py b/main.py index 2c1a344..4f4dc3b 100644 --- a/main.py +++ b/main.py @@ -7,6 +7,9 @@ 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 @@ -32,5 +35,13 @@ async def removetodo_command(ctx, todo_id: int): 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/start_dolly.bat b/start_dolly.bat new file mode 100644 index 0000000..6050e4b --- /dev/null +++ b/start_dolly.bat @@ -0,0 +1,5 @@ +@echo off +echo Starting Dolly the TODO Bot... +python main.py +echo Dolly stopped. Press any key to exit. +pause > nul diff --git a/todos.db b/todos.db index e7bc118..4c820b9 100644 Binary files a/todos.db and b/todos.db differ