Added a .bat file to allow for Dolly to run on windows.

This commit is contained in:
Dani
2023-12-21 15:10:19 -05:00
parent 3b5652ebb9
commit e7f1d38e36
3 changed files with 16 additions and 0 deletions

11
main.py
View File

@ -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"])

5
start_dolly.bat Normal file
View File

@ -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

BIN
todos.db

Binary file not shown.