If your files aren't at the right levels, the calls won't be able to find your folders, or files. But for learners, the way you're making your calls will be defined in your code. For people who know what they're doing, this is basic stuff.If you have old packages installed, or are not using upto date Objects that will lead to serious errors. To counter act this, if you reference my code, await ferReply() The Defer keyword delays the execution of a function until the surrounding function returns. If it doesn't receive it within that time, it believes that the service isn't work, and it kills the process. This is the max amount of time that Discord will wait to receive a response.OpenAI API call taking longer than 3 seconds If that's the case you will most likely want to add funding to your account.But things to take note of that may cause problems are as follows:Įxceeding the Token Amount causing your OpenAI API call to fail You should be able to copy and paste my code verbatum to get the functionality of what it's designed for, which is given in the Description. With the text-davinci-003 version I'm using in the code, I've spent roughly $0.12 a day with my 5 buddies abusing it. If you and your buddies are using this, that won't be enough. So if you set your token limit to 50, or leave it maxed out with the free account, that leaves you with about 13-15 words per minute. The problem is that 1000 tokens is roughly 750 English words. I saw that when I first started the project, but don't see any documentation at the moment. Secondly, you are probably going to want to add payment information because you get a preset amount of about 50 tokens per minute if I remember correctly. This is how you're going to get access to your API Token, and also your Organization Token. First, you have to register for an account with OpenAI if you don't have one already. There are other ways to do it, but this is the most simple and secure way to do it that I've found. env file to be able to securely house all of my Tokens. Uninstall the above packages: npm uninstall discord-api-types If you currently have those installed, you will want to remove those before continuing on with the project. V14 now has all packages needed inside of the discord.js file, so no need to download or discord-api-types. install the latest stable version of Node: npm i -g.To check your Node version, use node -v in your terminal or command prompt. V14 requires Node 16.9 or higher to use, so make sure you're up to date. You'll need to download your package.json to get started For the most up to terms reference this artical and MAKE SURE if you look at anything from stackoverflow that you check the date it was posted. A lot of the documentation you're going to run into if you're new will show you out dated code. Second is that this is the latest version of Discords API (v14). I'll list out all of the dependacies below, but two things that I want to highlight. End goal is to have it be able to interpret audio into functions, and the functions to extend to Moderation, Music playing, Image fetching, HTTPS fetching, and much more! Come again soon to see the updates! Getting Started This is going to be a template I'll be using to make more complex ChatGPT Discord Bots. This project took me about 2 and a half days. Originally start by trying to build a Music Bot, but I failed it pretty miserably, so I decided to move on. I've always wanted to learn how to code, so I decided that I'd start with a Discord Bot as my first project. This bot's functionality mirrors the same text model and reply functions as what you use in the browser version. This Bot was designed with the intented functionality of Chat-GPT model 'text-davinci-003'. This is my fully built code (my first ever coding project with no prior experiance!) Description=Description
0 Comments
Leave a Reply. |