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

  • @TrhostRaizoxx__
    @TrhostRaizoxx__ Жыл бұрын

    Very big thank you bro !!

  • @UnderCtrl
    @UnderCtrl Жыл бұрын

    OpenAI released the model they use for ChatGPT as an API service now! 🎉 Here's an updated tutorial: kzread.info/dash/bejne/dXZrmMGAdNW2o6g.html

  • @UnderCtrl
    @UnderCtrl Жыл бұрын

    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

    @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

    @UnderCtrl

    Жыл бұрын

    @@Shardso that’s the next video :)

  • @AstraxxTv
    @AstraxxTv Жыл бұрын

    OPENAI ERR: Error: Request failed with status code 429 ERR: TypeError: Cannot read properties of undefined (reading 'data') HELP PLS

  • @whoman0385
    @whoman0385 Жыл бұрын

    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.

  • @esdest
    @esdest Жыл бұрын

    i have question when u write the code....how do you make it to discord ...where you save the file etc...

  • @thebongobeast5345
    @thebongobeast5345 Жыл бұрын

    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

  • @A-Astley
    @A-Astley Жыл бұрын

    how would i excess the moderation settings?

  • @tony0891
    @tony0891 Жыл бұрын

    i can't get my console do display "the bot is online". any thoughts on why this is happening?

  • @waleedalwaeli6637
    @waleedalwaeli6637 Жыл бұрын

    I got Error: no test specified" && exit 1 what does that mean. Also, Error: Cannot find module './context

  • @RogerAshes
    @RogerAshes Жыл бұрын

    I need help SyntaxError: Unexpected identifier 'prompt'

  • @sibiriskiss
    @sibiriskiss Жыл бұрын

    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

    @UnderCtrl

    Жыл бұрын

    You can add a condition, like if (message.content.startsWith(“trigger_word”)) { // do something }

  • @eoin.hamilton
    @eoin.hamilton Жыл бұрын

    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

    @UnderCtrl

    Жыл бұрын

    You’d have to store that information in a database

  • @elmahdibenrami4763
    @elmahdibenrami4763 Жыл бұрын

    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

    @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

    @elmahdibenrami4763

    Жыл бұрын

    @@UnderCtrl thanky you so much

  • @Abdulelahm67
    @Abdulelahm67 Жыл бұрын

    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

    @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.

  • @chrisgosselin92
    @chrisgosselin92 Жыл бұрын

    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

    @UnderCtrl

    Жыл бұрын

    Ctrl C in the terminal will stop the node.js application. To start it again just type “node index.js” again

  • @A-Astley
    @A-Astley Жыл бұрын

    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

    @UnderCtrl

    Жыл бұрын

    Please cross check your Discord token and OpenAI credentials in the .env

  • @A-Astley

    @A-Astley

    Жыл бұрын

    thank found it now had the labels wrong

  • @TrhostRaizoxx__
    @TrhostRaizoxx__ Жыл бұрын

    Can you tell me why the bot does not end up stopping its sentences at the level of the 10th word?

  • @UnderCtrl

    @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.

  • @aunakhter
    @aunakhter Жыл бұрын

    Why is there 13 word reply limit? how can i increase it?

  • @UnderCtrl

    @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.

  • @hectorftraducciones2785
    @hectorftraducciones2785 Жыл бұрын

    I have paid for chat gpt services, how can I put my "organization" to start working? Thanks.

  • @UnderCtrl

    @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

    @hectorftraducciones2785

    Жыл бұрын

    @@UnderCtrl thanks!

  • @22coyi
    @22coyi Жыл бұрын

    My bot replies twice, do you know where that may come from?

  • @UnderCtrl

    @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;

  • @ez_ggluzzx
    @ez_ggluzzx4 ай бұрын

    OPENAI_ORGANIZATION ?

  • @ajaxbetter
    @ajaxbetter Жыл бұрын

    W

  • @firegamer898

    @firegamer898

    Жыл бұрын

    W

  • @BlueShiYTplus

    @BlueShiYTplus

    Жыл бұрын

    W

  • @rolexwatch347

    @rolexwatch347

    Жыл бұрын

    W

  • @DewandaArya

    @DewandaArya

    Жыл бұрын

    W

  • @Ender_Cafe_MDZ
    @Ender_Cafe_MDZ Жыл бұрын

    I want you to make a tutorial clip in slash command style.

  • @EricClapton1945
    @EricClapton1945 Жыл бұрын

    Visual Studio user 💀

  • @UnderCtrl

    @UnderCtrl

    Жыл бұрын

    Visual Studio Code 💀

  • @youush_
    @youush_ Жыл бұрын

    how do i add multiple channels?