We are continuously developing to fit with the modern and developing world!
DarkImpulseX-DiscordAIBot is a versatile discord bot. It is end-to-end trained to work in your server. It uses our language model as well as openai. Also it can use NLP to understand the language with which users are interacting.
- Features
- Responds to users query using openai π
- Greets if anyone joins your discord channel with a joke π
- Joins and leaves voice channel π£
- Play, stop, resume, previous and next music playing
- Image generation
- List commands
- Discord Management
- and more.......
- openai
- discord.py
- discord.py[voice] pip install discord.py[voice]
- requests
- Prompt Engineering is very essential part to make a good AI chat application
While using the OpenAI API, we have used a very cool prompt so to give our bot a particular behaviour. See the code example below where we have told hpw the bot would behave and how it should give answers-
- Greeting User The bot checks the default text channel using the below code
guild.text_channels[0]
a "member" represents a user within the context of a specific server (guild) A "guild" is Discord's term for a server. It represents a collection of channels, roles, and members on Discord.
The bot greets the user by making requests to jokeapi - we appreciate it a lot.
-
Joins and leaves voice channel uses python discord.py[voice]
- command to join - join We get the voice channel that user has joined with this code :-
channel = message.author.voice.channel
and stores the channel in
self.voiceChannel
.-
command to leave - leave Leaves the channel on user command by using the same code above to get the channel
-
leaves automatically checks the number of users using the code
len(self.voiceChannel.channel.members) == 1
then, disconnects after waiting for 1 minute
We have developed our bot such that it takes into consideration those chats which mentions the bot while chatting.
All you need is python installed in your computer.
-
Add the bot to your server
-
Clone the repo
git clone https://github.com/Dark-Impulse-X/DarkImpulseX-DIscordAIBot.git
- Install the libraries
pip install requirements.txt
- Extra installation
pip install discord.py[voice]
-
Collect all the tokens and openai keys.
-
Make a .env file and make two variables TOKEN and OPENAI_API_KEY and store the value in it.
-
Run the main.py file from the src to run locally.
python src/main.py
-
Invite the bot here
-
Enjoy your bot!
THE BOT WILL BE ONLINE UNTILL YOU CLOSE main.py ON YOUR PC!!!
How to make use of the bot?
- Mention the bot whilist your message to get responses
Contributions are accepted. Read the contribution guidelines before contributing and follow the rules properly.
DarkImpulseX-DiscordAIBot is licensed under the MIT License. You are permitted to use, copy, modify, distribute, sublicense, and sell copies of the software.