I'm building a website that lets users add new items in their profiles. Users can also do the same using Discord bot's commands. In both cases the Discord bot sends a message New item added by @user
in a certain channel.
I'm thinking of how to design the application. Should I have the POST
addItem
endpoint on the website's server which the bot would call?
onNewDiscordMessage():
if (addItemCommand):
sendPostRequest(websiteUrl, data)
sendMessageInChannel("New item added!")
But then the website would also need to have the message be sent in the Discord channel. Should I make the Discord
bot a web app too? Have the bot be imported as a dependency and be manageable using POST
endpoint?
POST("send_discord_message")
void sendMessage(String message)
Or should I use RabbitMQ/Kafka queues for this? Or websockets/webhooks?
EDIT:
I'm using Spring Boot for website, Hibernate&PostgreSQL for persistence, and JDA for Discord Bot currently. No specific requirements apart from that. I'd like to understand what good design would look like for such an application.