This bot works by using the API from openrouter. Nothing much to say, but if you want to browse through any other parts or skip some parts, you can do so by clicking the section button on the top left of this readme!
- Video : it can be found here
- Flask
- Discord
- Python-dotenv
- Requests
- Go to https://openrouter.ai/ and create an account.
- After that, click on API keys
- Then, create a new one
Important
Copy the token, because this is the only time you can copy it. this is important!
- Go to https://discord.com/developers/applications/ or click here and create a new application
- After you're inside your bot's page, name it whatever you'd like, then click on "Bots", like in this picture
- Press "Reset Token" and make sure to copy the token to somewhere you can find.
Important
Make sure to copy it somewhere, because this is the only time you can copy it, or else you have to reset the token again!
- Go to OAuth2, and follow the steps :
- You can then just paste this into any server you want or put it into the browser, and just invite the bot to any server. However, we will not be using it for anything else.
- Python V3.9+
- Any code-editing apps
- Discord bot
- Clone this repository by :
- Github clone :
git clone https://github.com/s16899/Matsuri_V2.git - Download Zip
- Github clone :
- Open any code editing software and create a new context in "contexts" folder
Tip
name it something that matches the character so you won't get confused!
- To create context, just create something like "context.txt", where "context" is the name of character, then just put in the context on what the bot should act like.
- Then, create a .env file, and put in the following :
DISCORD_TOKEN=PUT_YOUR_DISCORD_TOKEN_HERE
API_KEY=PUT_YOUR_OPENROUTER_AI_KEY_HERECaution
Don't forget to change the PUT_YOUR_DISCORD_TOKEN_HERE to your discord token you've copied
And also don't forget to change the PUT_YOUR_OPENROUTER_AI_KEY_HERE to the openrouter.ai secret key!
- Now go to
main.py, and you should see something like this :
- in the terminal, run :
pip install -r requirements.txt - Wait for it to be done
- To run the bot, run the following command inside the terminal :
python main.pyOR if python extension is installed, then you can just click the green play button on the top right of the code, and that should do the same thing. - Find your bot and open its dms, and it should work.
- Click on Code > Codespace > "+"
- Upon opening the Codespace, make sure you install the "Python" extension. By default, there should be a pop up saying "do you want to install Python?", just click Yes. Else, you have to run the command instead of pushing the Green play button!
- Create a new context in "contexts" folder
Tip
name it something that matches the character so you won't get confused!
- To create context, just create something like "context.txt", where "context" is the name of character, then just put in the context on what the bot should act like.
- Then, create a .env file, and put in the following :
DISCORD_TOKEN=PUT_YOUR_DISCORD_TOKEN_HERE
API_KEY=PUT_YOUR_OPENROUTER_AI_KEY_HERECaution
Don't forget to change the PUT_YOUR_DISCORD_TOKEN_HERE to your discord token you've copied
And also don't forget to change the PUT_YOUR_OPENROUTER_AI_KEY_HERE to the openrouter.ai secret key!
- Now go to
main.py, and you should see something like this :
- in the terminal, run :
pip install -r requirements.txt - Wait for it to be done
- To run the bot, run the following command inside the terminal :
python main.pyOR if python extension is installed, then you can just click the green play button on the top right of the code, and that should do the same thing. - Find your bot and open its dms, and it should work.
Currently, here are my goals I would like to try for this project :
- Make a video about it
- Make a video explaining how to use this github repository
- Making an update server
- Adding server compatibility
- Adding extraordinary functions (eg. !resconvos - Resets your conversation with the bot)
What I haven't put inside here yet :
- Putting in the tutorial for hosting the bot for 24 hours
- Server compatible
- Cross DMs compatible
- Single DM compatible (one user per bot)