mirror of
https://github.com/Paillat-dev/presentator.git
synced 2026-01-02 01:06:20 +00:00
Update main.py
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import openai
|
import openai
|
||||||
# from openai import api_key
|
# from openai import api_key
|
||||||
import discord
|
import discord
|
||||||
from discord import Intents
|
from discord import Intents, ApplicationCommandOptionType
|
||||||
from discord.commands import slash_command, option
|
from discord.commands import slash_command, option
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import re
|
import re
|
||||||
@@ -163,6 +163,10 @@ async def on_ready():
|
|||||||
#if the data directory doesn't exist we create it
|
#if the data directory doesn't exist we create it
|
||||||
if not os.path.exists("data"):
|
if not os.path.exists("data"):
|
||||||
os.mkdir("data")
|
os.mkdir("data")
|
||||||
|
@bot.event
|
||||||
|
async def on_application_command_error(ctx, error):
|
||||||
|
#if there is an error we send a message to the user
|
||||||
|
await ctx.respond(f"An error occured: {error}", ephemeral=True)
|
||||||
#get the openai key drom he key.env file
|
#get the openai key drom he key.env file
|
||||||
token = os.getenv("TOKEN")
|
token = os.getenv("TOKEN")
|
||||||
apikey = os.getenv("OPENAI")
|
apikey = os.getenv("OPENAI")
|
||||||
|
|||||||
Reference in New Issue
Block a user