Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Discord Bot using AWS Lambda

I am trying to build a discord bot and was wonderig if i can use AWS lambda for it. So far i haven't seen someone did it already so was confuse if its possible or not. Specially when lambda's aren't active all the time.

like image 512
Em Ae Avatar asked Aug 06 '18 23:08

Em Ae


2 Answers

ancient question, but this is now possible, since discord starting providing outgoing webhooks a few weeks ago

(shameless self plug) i wrote a bit of a guide here

like image 170
quq Avatar answered Sep 28 '22 13:09

quq


This is now possible but following an integration approach rather than the traditional bot approach. This differs as detailed below.

The slash commands official documentation gives us this info:

Slash Commands and Interactions bring something entirely new to the table: the ability to interact with an application without needing a bot user in the guild.

You are now able to receive interaction events via your preferred URL endpoint such as an AWS Lamba function, Firebase Cloud function, Azure Cloud function, etc.

This official receiving an interaction section tells us:

In your application in the Developer Portal, there is a field on the main page called "Interactions Endpoint URL". If you want to receive Interactions via outgoing webhook, you can set your URL in this field.

It is important to remember, though, that the data sent to the endpoint URL for interactions is not the same as running a bot client, in fact they make comment on that here:

In many cases, you may still need a bot user. If you need to receive gateway events, or need to interact with other parts of our API...

like image 28
MysticZA Avatar answered Sep 28 '22 13:09

MysticZA