From e7f1d38e3621c3119d04e375a3485ee46ad50fe8 Mon Sep 17 00:00:00 2001 From: Dani Date: Thu, 21 Dec 2023 15:10:19 -0500 Subject: [PATCH] Added a .bat file to allow for Dolly to run on windows. --- main.py | 11 +++++++++++ start_dolly.bat | 5 +++++ todos.db | Bin 8192 -> 8192 bytes 3 files changed, 16 insertions(+) create mode 100644 start_dolly.bat 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 e7bc118971a2580a798ff28f337eff12a467f439..4c820b9303b7a1bc0a51ca53671bccd1b36712a4 100644 GIT binary patch delta 92 zcmZp0XmFSy&B#1a#+i|MW5N=C4krFZ4E(qF7i|_4n8t5m#>7;r