hey guys sorry if i'm on the wrong channel i'm pretty lost but the bot is saying random stuff in:
import discord
from discord.ext import commands
import openai
intents = discord.Intents.all()
intents.message_content = True
bot = commands.Bot(command_prefix='gpt!', intents=intents)
openai.api_key = 'API_KEY'
@bot.event
async def on_ready():
print(f'Logged in as {bot.user.name}')
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="The Cloud Group"))
@bot.event
async def on_message(message):
if message.author == bot.user:
return
if message.channel.id != 1113049687008739391:
return
if message.channel.id == 1113049687008739391:
async with message.channel.typing():
response = openai.Completion.create(
engine="text-davinci-002",
prompt=f"{message.content}",
max_tokens=2048,
temperature=0.2,
)
await message.channel.send(response.choices[0].text)```
