Discord token is now in an env variable

This commit is contained in:
Paillat
2023-02-28 15:28:14 +01:00
parent a35ce1d4c2
commit 37e931978a
3 changed files with 4 additions and 7 deletions

View File

@@ -5,7 +5,7 @@ from discord import Intents
import asyncio # pip install asyncio
import cogs # import the cogs
import datetime # pip install datetime
from config import debug, conn, c # import the debug function and the database connectionimport apsw # pip install apsw. ApSW is a Python interface to SQLite 3
from config import debug, conn, c, discord_token
#add the message content intent to the bot, aka discord.Intents.default() and discord.Intents.message_content
intents = discord.Intents.default()
intents.message_content = True
@@ -22,12 +22,9 @@ async def on_ready():
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="your messages to answer you"))
debug("Bot is ready")
#run the bot
# Replace the following with your bot's token
with open("./key.txt") as f:
key = f.read()
bot.run(key)
bot.run(discord_token) # run the bot
#set the bot's watching status to watcing your messages to answer you
@bot.event
async def on_ready():