Added a .bat file to allow for Dolly to run on windows.
This commit is contained in:
11
main.py
11
main.py
@ -7,6 +7,9 @@ config = load_config()
|
|||||||
intents = get_intents()
|
intents = get_intents()
|
||||||
bot = commands.Bot(command_prefix='!', intents=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()
|
conn = setup_database()
|
||||||
|
|
||||||
@bot.event
|
@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}")
|
await ctx.send(f"Removed to-do with ID {todo_id}")
|
||||||
else:
|
else:
|
||||||
await ctx.send("Error removing to-do.")
|
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"])
|
bot.run(config["discord_token"])
|
5
start_dolly.bat
Normal file
5
start_dolly.bat
Normal 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
|
Reference in New Issue
Block a user