Http server for discord bot. #9751
-
Hello, could you please recommend http server to add into my discord bot to be able to trigger discord functions from custom webhooks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
@denisyakimov07 You would use AIOHTTP, but your case is different than most usecases. You want to trigger some Discord function based off when webhooks are emitted. This simply is not possible, as it's not possible to listen for webhooks with discord.py. Instead of relying on an weak link such as depending on an custom webhook event as this exposes the weak links in your chain, an alternative must be used. I would be interested in what exactly you are trying to do. In short, what is your goal with your feature? |
Beta Was this translation helpful? Give feedback.
-
@No767 My game server send logs to API, and I want to post that info to channel. |
Beta Was this translation helpful? Give feedback.
@denisyakimov07 You would ideally want to restructure this into an stronger link. From game sever to the bot directly would be better. Trying to get the logs to an API and then back down doesn't make any sense as now you have weaker links between those services and the risk of failures would increase. You want to design your infra to minimize points of failure. So that's why I suggested directly hitting the bot instead. If you do go that route, then I would propose hooking up an aiohttp web server along your bot, and maintaining an websocket connection between your game server and aiohttp web server.
One of the factors that I would think about here is whether it's worth it to take these l…