Giter Site home page Giter Site logo

lane-g-smith / discord-bot-vanilla-js-gpt-4 Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 2.0 70 KB

A simple no-code yet customizable JavaScript Discord bot using the new language model Chat GPT-4

License: MIT License

JavaScript 100.00%
chatgpt discord-bot discordjs gpt3 chatbot javascript no-code openai vanillajavascript

discord-bot-vanilla-js-gpt-4's Introduction

Discord-Bot-Vanilla-JS-GPT-4


Discord.js

A simple vanilla javascript Discord bot for interacting with the new language model GPT-4 by OpenAI. This bot can serve a variety of different functions by changing a few lines of its internal prompt. No coding skills are required.

Give personality to a virtual friend in your gaming server

Get answers to random trivia from your PC or phone (Discord Mobile)

Create your very own friendly personal assistant

GPT-4 bot installation and deployment Instructions

!!This bot does NOT respond to DMs, it must be in a server with you!!

Get the bot 'shell' from Discord. It's free, and it takes 5 minutes

https://discord.com/developers/applications

Go to OpenAI and open an account

https://platform.openai.com/signup

Install node.js

https://nodejs.org/en/

Install git

https://git-scm.com/downloads

Create a new folder and navigate to it in the terminal to set up git

git init

Navigate to the new git folder in the terminal and clone this repository

https://github.com/Lane-G-Smith/Discord-Bot-Vanilla-JS-GPT-4.git

Navigate to Discord-Bot-Vanilla-JS-GPT-4 folder and install dependencies

npm install

Rename example_.env to .env

Place your secret Discord bot token from the first step into the .env file

TOKEN=your_unique_Discord_bot_token_here

Place your secret OpenAI API key from the second step into the .env file

OPENAI_API_KEY=your_unique_OpenAI_API_key_here

Modify a few lines of the code (46-59, self-explanatory when you look at it) to personalize the functionality

The characteristics of your AI and how to answer questions, example questions, example answers

Set a trigger word that you want to prompt a response (line 39)

replace "Your-Trigger-Word" with whatever you want

To host the bot locally, open the project in the terminal and run node

node index.js

To host the bot locally and keep it running in the background indefinitely, install PM2

npm install pm2 -g

Run your bot locally using pm2 https://pm2.keymetrics.io/

pm2 start index.js

Congratulations, your bot should now be live & confirmation should be logged in the terminal. Use your personal link from the Discord developer portal to invite your bot to a Discord server

https://discord.com/developers/applications

discord-bot-vanilla-js-gpt-4's People

Contributors

lane-g-smith avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.