#Gpt Discord bots?
1 messages · Page 1 of 1 (latest)
Hi @serene patio. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Hmm, I don't know enough to give you a confident answer yet. The knowledge sources provided do not contain information about GPT-4 being used in Discord bots. However, OpenAI has developed GPT-4, a large multimodal model that can solve difficult problems with greater accuracy than any of their previous models. It's optimized for chat but also works well for traditional completions tasks. You can learn more about GPT-4 here (https://platform.openai.com/docs/models).
If you're interested in OpenAI's Discord server, you can get an invite here (https://discord.com/invite/openai). Please complete your OpenAI Discord verification to access the server.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@serene patio kapa.ai is still learning and improving, please let us know how it did by reacting below
Not as far as I'm aware but its easy enough coding your own.
- Set up a Discord Bot: Create a bot on the Discord Developer Portal and get its token.
- Install Required Libraries: Use Python with the discord and openai libraries.
import openai
# Replace 'YOUR_DISCORD_BOT_TOKEN' with your actual Discord bot token
DISCORD_TOKEN = 'YOUR_DISCORD_BOT_TOKEN'
# Replace 'YOUR_OPENAI_API_KEY' with your actual OpenAI API key
OPENAI_API_KEY = 'YOUR_OPENAI_API_KEY'
# Set up OpenAI API key
openai.api_key = OPENAI_API_KEY
# Initialize the Discord client
intents = discord.Intents.default()
intents.messages = True
client = discord.Client(intents=intents)
# Define a command prefix (optional)
COMMAND_PREFIX = '!ask'
@client.event
async def on_ready():
print(f'We have logged in as {client.user}')
@client.event
async def on_message(message):
# Ignore messages from the bot itself
if message.author == client.user:
return
# Check if the message starts with the command prefix
if message.content.startswith(COMMAND_PREFIX):
question = message.content[len(COMMAND_PREFIX):].strip()
# Send the question to the OpenAI API
response = openai.Completion.create(
model="text-davinci-003",
prompt=question,
max_tokens=150
)
# Get the response text
answer = response.choices[0].text.strip()
# Send the response to the Discord channel
await message.channel.send(answer)
# Run the Discord bot
client.run(DISCORD_TOKEN)```
that uses davinci and not even chat completions
come on bro.. you had to chatgpt bros question
Actually a snippet from my own code lol, it uses davinci indeed. The cost is way higher using gpt.