Create a Chat GPT ChatBot in Discord 🤖
Create a Chat GPT ChatBot in Discord 🤖
🤔 If you have any issues join our community Discord:
discord.underctrl.io
🌐 Important links:
Learn JavaScript for beginners: developer.mozilla.org/en-US/d...
Node.js: nodejs.org/en/
Visual Studio Code: code.visualstudio.com
OpenAI: openai.com/api/
Discord Developer Portal: / discord
Patreon: / underctrl
Buy me a coffee (one-time donation): buymeacoffee.com/underctrl
My own chat bot (I had to increase the token usage for better user experience on my community. However you can decrease the tokens limit from the code): github.com/notunderctrl/disco...
Thanks for watching!
Пікірлер: 46
Very big thank you bro !!
OpenAI released the model they use for ChatGPT as an API service now! 🎉 Here's an updated tutorial: kzread.info/dash/bejne/dXZrmMGAdNW2o6g.html
Update: If your prompts are not complete you can increase the number of tokens used in a single message. OpenAI recommends setting 256 for the Davinci model. To change the number of tokens used per completion you can add the "max_tokens" property to your createCompletion method. Here's an example: srcshare.io/63e73e58a51113ab369ad956
@Shardso
Жыл бұрын
Davinci model and gpt-3.5 are different things gpt-3.5 is what chat gpt uses. Would be cool to see a discord bot with it
@UnderCtrl
Жыл бұрын
@@Shardso that’s the next video :)
OPENAI ERR: Error: Request failed with status code 429 ERR: TypeError: Cannot read properties of undefined (reading 'data') HELP PLS
if you cant pay for the api i would highly recommend to just host your own model on the same server you are hosting the bot (this will work on replit, glitch etc.. use a vps to host). when the free trial runs out or you use all your credits you wont have access to the api anymore and you will have to change a lot of your code.
i have question when u write the code....how do you make it to discord ...where you save the file etc...
Can anyone help with the npm init -y section. i am using visual studio, i have downloaded node.js but i keep getting error: npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + npm init -y + ~~~ + CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
how would i excess the moderation settings?
i can't get my console do display "the bot is online". any thoughts on why this is happening?
I got Error: no test specified" && exit 1 what does that mean. Also, Error: Cannot find module './context
I need help SyntaxError: Unexpected identifier 'prompt'
Hi, I never coded before in my life but I managed to get it working on my own server, and it's working great, however, I was wondering how can I make the bot answer ONLY when I write a specific word before the message? Lets say I want the bot to ignore all messages except those which start with "$wag", for example "$wag can you tell me what 2+2 is?" I just don't want the bot to answer literally every single message I send, and I don't want to make a seperate channel just to chat with the bot.
@UnderCtrl
Жыл бұрын
You can add a condition, like if (message.content.startsWith(“trigger_word”)) { // do something }
is there a way to make a command to set the channel that the bot speaks in? like if i were to have it in multiple servers?
@UnderCtrl
Жыл бұрын
You’d have to store that information in a database
i want to use the last one you mention in your video but i don't know how to link it with the discord server
@UnderCtrl
Жыл бұрын
Hey, sorry I realized I forgot to provide the GitHub repository for my personal chat bot. It's now linked in the description. Enjoy!
@elmahdibenrami4763
Жыл бұрын
@@UnderCtrl thanky you so much
hi i'm not good at coding but i think i did everything good and i have 2 problems if u can help please, Fisrt: when the bot says it is online, i get below that message another message which say's ReferenceError: consloe is not defined. Second: when i type hey! in the discord chat the bot does not respond. also the bot goes offline i need to wake it up every time by typing index.js if u can help that would be wounderful.
@UnderCtrl
Жыл бұрын
The first error is because it’s “console”, not “consloe”. Please check your code again and fix the typo. The second: your bot goes offline because it’s being hosted in your computer during development. To make your bot stay online you have to host it on a server.
How do you "restart the bot"? I'm a complete n00b following along but you don't describe how to do that. You showed us how to turn it on with the node.js prompt.
@UnderCtrl
Жыл бұрын
Ctrl C in the terminal will stop the node.js application. To start it again just type “node index.js” again
Hi i have use your github script and got it so looks like its typing but i get a error code 401 in terminal, do you know what i am missing?
@UnderCtrl
Жыл бұрын
Please cross check your Discord token and OpenAI credentials in the .env
@A-Astley
Жыл бұрын
thank found it now had the labels wrong
Can you tell me why the bot does not end up stopping its sentences at the level of the 10th word?
@UnderCtrl
Жыл бұрын
If your prompts are not complete you can increase the number of tokens used in a single message. OpenAI recommends setting 256 for the Davinci model. To change the number of tokens used per completion you can add the "max_tokens" property to your createCompletion method.
Why is there 13 word reply limit? how can i increase it?
@UnderCtrl
Жыл бұрын
Hi, unfortunately I forgot to mention in the video, alongside the property “prompt” you can also add a property called “max_tokens”. Adjust that to your liking and you’ll get more characters out of your reply.
I have paid for chat gpt services, how can I put my "organization" to start working? Thanks.
@UnderCtrl
Жыл бұрын
When defining your configuration you can add a new property called "organisation" alongside your "apiKey". It should look something like this. const configuration = new Configuration({ organization: "org-12345", apiKey: "api-key", });
@hectorftraducciones2785
Жыл бұрын
@@UnderCtrl thanks!
My bot replies twice, do you know where that may come from?
@UnderCtrl
Жыл бұрын
2 possible reasons for that 1. You have 2 message.reply methods in your code. 2. You are not ignoring bot messages in your code. In this case add the following line at the top of your messageCreate event listener. if (message.author.bot) return;
OPENAI_ORGANIZATION ?
W
@firegamer898
Жыл бұрын
W
@BlueShiYTplus
Жыл бұрын
W
@rolexwatch347
Жыл бұрын
W
@DewandaArya
Жыл бұрын
W
I want you to make a tutorial clip in slash command style.
Visual Studio user 💀
@UnderCtrl
Жыл бұрын
Visual Studio Code 💀
how do i add multiple channels?