Host a Python Discord Bot on AWS Lambda (Free and Easy)

preview_player
Показать описание
Learn how to create and host a Python Discord bot on AWS Lambda.

In this tutorial, you'll learn how to create a Discord Bot using Discord's Interaction HTTP endpoints — and then host it for FREE on AWS Lambda. This is a super easy, cost-effective, and scalable way to host Discord bots.

We'll be using Flask and Python for the Discord bot, and AWS CDK to deploy our Lambda infrastructure.

👉 Links

📚 Chapters

00:00 Introduction
02:40 Set Up Discord Bot
04:13 Register Bot Commands
07:21 Creating Bot Endpoints
10:38 Token Validation
13:02 Create Docker Image
16:04 Deploying with AWS CDK
21:15 Wrapping Up
Рекомендации по теме
Комментарии
Автор

I love how much easier it is to understand how to do all of this, thank you!

Pie_Master.
Автор

Thanks for the tutorial! I wanted to try using Lambda instead of hosting on EC2 this time, and this worked well

sesameydmclips
Автор

Please please make a video about making of a Telegram bot!
I know that there are guides out there but your videos are just so clear that I think they add value even on topics which where already covered by others

menisadi
Автор

It took me way too many hours to FINALLY get commands to work. The registration part is not obvious. Thank you!

mozphat
Автор

Fantastic video! However, how do we handle logic that takes more than 3 seconds to execute, considering Discord messages have a 3-second limit?

volodymyrtruba
Автор

All the videos you publish are real gems. Not sure if you take requests but can you create a video on a full stack app creating with FastAPI/Supabase backend and NextJS frontend which would cover authentication, stripe billing, etc.

HashtagTiluda
Автор

This is absolute gold! Really well presented, step by step!! New subscriber 💪 I wonder if you could do an extension of this example where the bot reacts to events that happen on the Discord server like a new user arriving at the server (from an invite link) to do something tricky - check if the email they registered their account on Discord matches the domain that I, the Discord bot owner, will define (it's actually to set a Role for users that belong to my company) 🤔

BrunoAtLoka
Автор

Great video! Regarding performance, e.g a decent amount of users using a lot of commands simultaneously, does AWS Lambda take care of that?

Snred
Автор

Hello! Thank you for the amazing tutorial, even a noob like me could understand everything. I need help with CDK, I successfully installed and set up CDK and CLI with credentials. When I run "cdk bootstrap" it fails because the "aws-cdk-lib" and "constructs" modules are not found, did I miss a step?

danielegurizzan
Автор

But this wouldn't work for events that expect a response, right? like modifying a message in a pool. Because it doesn't maintain the connection. And how do you keep bot from falling when the lamba goes cold?

ProGamingRV
Автор

Thank you for the good video. If I want to use the selenium library, how can I add a layer?

cat.dog
Автор

So I got all the way to the end, with deployment being successful and I got the link. However, when I check to see, my bot its still offline and also there is no function in aws. Does deploying create a function automatically?

Follow up question, when you created your bot it was listed as online, while when I made mine it is automatically offline. What did you do here to get it online?

EDIT

alright I followed the steps again and got it working, but I still don't see the lambda function in AWS, and I don't know how to debug any other way.

EDIT AGAIN

Found it in AWS, I was looking at the wrong region, still can't find a console to do debugging, was wondering exactly how I would test this locally

bigbadbroadcast
Автор

hi there i am facing this error : REGISTER REGISTER_COMMANDS.PY
'REGISTER' is not recognized as an internal or external command,
operable program or batch file. please try help

THEREAL
Автор

I need help with what commands did you use for the command prompt? At 6:38

parYTG
Автор

Hi just asking is this method better hosting than EC2 method

gamersgame
Автор

Thanks for the video. I have a question though, how do you unregister a command? I'm getting a 405 error when I try to request delete.

saphirsatillo
Автор

Just wanna know if its a serverless hosting

bleakaddict
Автор

can i host javascript v14 bot with this?

innerpeacetheskullcollector
Автор

When I attempt to create a bot in discord, it shows as offline instead of online in my server as it is for you. Anyone know the approach to turn it on?

Rohitnansen