I got to know about this assignment from a Discord server.
I never worked on the Discord API before and found this quite fascinating.
- I started working on this by first checking what the Discord API is and found that it's very interesting.
- I created a Typescript-based project and added all the environment variables.
- Created a Discord Bot and got the keys.
- Wrote a program to ensure the Discord Bot is connected to my server.
- I started with a brute approach to by using a database to store the messages and perform search on it provided the word and it's limit.
- Then I wrote logic to use slash command in the chat of the server.
- Now using the Discord API Link, any admin can use the API in their discord server.
Problems faced:-
- Could not understand the flow and how to connect the Discord API.
- Optimizing the logic to get all the messages fetched from Discord API and store them in best way possible in database.
- Discord API can only look up to 100 messages (latest), acting as a drawback thus further optimization is needed.
Future Plans:-
- Optimize the database to store messages efficiently.
- Ensure the Discord Bot has all the permissions and is accessible to large number of people with least complexity.
- Create an application to help people use these Discord Bots for there Discord server.
You can check out the GitHub repo here: https://github.com/VanshikaSabharwal/Discord-Bot
Key Points
- Will create an web application to have different types of discord bots for people to access for their discord server.