starting bot with token

This commit is contained in:
Andrei Stoica 2025-01-15 22:00:37 -05:00
parent e99ac43c9b
commit 431a86b74d
1 changed files with 7 additions and 1 deletions

8
bot.py
View File

@ -1,6 +1,7 @@
import discord import discord
from discord.ext import commands from discord.ext import commands
from discord.ext.commands.context import Context from discord.ext.commands.context import Context
from os import environ
from dice import Dice, DiceTextError from dice import Dice, DiceTextError
@ -35,4 +36,9 @@ async def roll(ctx: Context, *args: str):
await ctx.send(msg) await ctx.send(msg)
bot.add_command(roll) token = environ.get("DISCORD_TOKEN")
if token is None:
print("Could not load token")
quit()
bot.run(token)