I Built a Discord Bot with ChatGPT

I Built a Discord Bot with ChatGPT

Clever Programmer

1 год назад

26,948 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@opijkkk4918
@opijkkk4918 - 13.09.2023 19:00

code doesnt work. it says TypeError: Configuration is not a constructor

const openAPIKey = process.env['OpenAPIKey']
const discrodKey = process.env['DiscrodKey']
const openAiOrg = process.env['OpenAiOrg']

const {Client, GatewayIntentBits } = require('discord.js')
const client = new Client({
intents: [
GatewayIntentBits. Guilds,
GatewayIntentBits. GuildMessages,
GatewayIntentBits.MessageContent
]
})

// Setup OpenAI
const { Configuration, OpenAIApi } = require('openai')
const configuration = new Configuration({
organization: openAiOrg,
apiKey: openAPIKey
})

const openai = new OpenAIApi(configuration)

client.on('messageCreate', async (message) => {
try {
if (message.author.bot) return // Prevents infinite loop
const response = await openai.createCompletion({
model: "text-davinci-003",
prompt: message.content,
temperature: 0.9,
max_tokens: 150,
top_p: 1,
frequency_penalty: 0.0,
presence_penalty: 0.6,
stop: ["Human:", "AI:"],
});
message.reply(`${response.data.choices[0].text}`)
} catch (error) {
console.log(error)
}
})

Ответить
@trentconley4374
@trentconley4374 - 08.09.2023 23:44

Thats nutty. Thanks for tutorial

Ответить
@jguillengarcia
@jguillengarcia - 01.08.2023 19:19

If i want to create a custom chatbot trained with info... what steps should be different to those of the video?

Ответить
@user-xl5sv5yf3t
@user-xl5sv5yf3t - 16.06.2023 15:30

absoulut useless nothing works from that and i wrote everything with my own hands within 12 hours because i can not find the problem he did

Ответить
@faraz6912
@faraz6912 - 30.04.2023 10:18

Now thats something premium

Ответить
@tli5783
@tli5783 - 26.04.2023 05:24

It says “error cannot find module ‘openai’ “ I need help I followed everything

Ответить
@m3w3k
@m3w3k - 18.04.2023 02:35

Nice, but how to add a "keyword" or something like this: [ ! ] or [BOT_NAME]
Without [ ]

Ответить
@Stitchmaniac2
@Stitchmaniac2 - 08.04.2023 01:36

I will not follow your ad links and get my own, thanks <3

Ответить
@BharatiRamchairy-pu7vy
@BharatiRamchairy-pu7vy - 28.03.2023 10:34

Thanks for exposing The api key ☠️💀

Ответить
@Jingizz
@Jingizz - 18.03.2023 02:10

hey the replit is pretty much empty

Ответить
@romanandruk8528
@romanandruk8528 - 16.03.2023 07:25

This was REALLY good, i just needed gPT-4 to help me with some of the code due to syntax errors because it was hard for me to copy and paste everything but overall, amazing job man.

Ответить
@PeterYap0608
@PeterYap0608 - 15.03.2023 07:00

the bot is not 24/7?

Ответить
@themobilegamer7333
@themobilegamer7333 - 12.03.2023 20:09

there's nothing in it, it's a blank page with installed packages

Ответить
@abubakarsadiq8212
@abubakarsadiq8212 - 04.03.2023 20:22

Are you a Muslim?

Ответить
@christian.rhodes
@christian.rhodes - 04.03.2023 13:25

I too built a Discord bot with ChatGPT; and gave it the personality of a fictional character...
...and that was a week before this video showed up. 👀👀

Ответить
@Nguyenexthuw
@Nguyenexthuw - 04.03.2023 09:58

How to fix repl process died unexpectedly: exit status 1?

Ответить
@PoppSoundProductions
@PoppSoundProductions - 01.03.2023 23:13

Question - can I use my PRO account and not have to pay extra for the API usage??

Ответить
@PoppSoundProductions
@PoppSoundProductions - 01.03.2023 23:10

Thank you

Ответить
@thuglifeinventor
@thuglifeinventor - 26.02.2023 05:27

from free version or paid?

Ответить
@NinjaLives-rg8vl
@NinjaLives-rg8vl - 26.02.2023 04:34

finally a good video

Ответить
@kaysarsolna
@kaysarsolna - 25.02.2023 20:58

the code it is you wrote or ChatGPT on ciscort? sir

Ответить
@TeamJWxAaDi
@TeamJWxAaDi - 25.02.2023 20:32

I don't know how to run it please help @CleverProgrammer

Ответить
@sahidulalammiddya-qu1if
@sahidulalammiddya-qu1if - 25.02.2023 20:21

Talented person...love you Brother ❤

Ответить
@mr.revengaming8603
@mr.revengaming8603 - 25.02.2023 20:14

can you make music bot

Ответить
@t-production
@t-production - 25.02.2023 20:11

Nice 👍

Ответить