Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
If you want to run locally, you will need to set up a .env file with some info that the bot requires to work, and that is all. When you run the main function, it should create a web server where you can send a post request to it and store your photos dynamically. Again if you want a more detailed version of how to set up and run this service in your cloud infrastructure, you can check the source code repo. In this post, I will focus on how I did it.
In this first part of the main function, we have created the fiber HTTP server, and the creation of the /sendFile route. When this route is called, passing the file field, we have the creation of our discord bot using this excellent library called discordgo. We also open the WebSocket to talk to the Discord servers.