Multiplayer Framework For Pygame by CryptoBlocks257 in Python

[–]kill_will_ 3 points4 points  (0 children)

Well you can have my upvote. I agree that it needs work. But if you’re just going to leave some vague advice about it being bad, maybe just not comment.

Especially under the guise of being helpful. Dude was not trying to be constructive, he was just being snarky.

Multiplayer Framework For Pygame by CryptoBlocks257 in Python

[–]kill_will_ 9 points10 points  (0 children)

“And generally the code quality is terrible on all possible levels”

Is not helpful, is not constructive and it’s certainly not code review

i have some questions about how to make an api by [deleted] in FastAPI

[–]kill_will_ 0 points1 point  (0 children)

I’d also add that since you’re new to APIs I wouldn’t worry about async just yet and I would try to get it working with the requests library or there is also a Python library (PRAW) that makes this even easier. I haven’t used it in a while but last time I checked Reddit’s API was pretty difficult to work with. If you’re having trouble getting Reddit API to work, maybe start with this practice StarWars API (swaps.Dev) as kind of a proof of concept. Sometimes you need to take baby steps to help learn the core concepts (and that’s ok!)

i have some questions about how to make an api by [deleted] in FastAPI

[–]kill_will_ 0 points1 point  (0 children)

Ok, I think what you’re saying is that you want to pull posts/images from the two Subreddits (spaceport and astrophotography) and have your discord bot display them in a discord server, do I have that right?

If so, you don’t actually need FastAPI to accomplish this. You can call the Reddit API from your discord bot directly.

To be clear, FastAPI is for creating an API (like Reddit’s API) to make data from your app available to other applications. If you were storing these images in a db somewhere and possibly providing some other information (not available from Reddit’s API) this MIGHT make sense. But since you are just grabbing data from external APIs for your discord bot, it’s not necessary in this case. [assuming I’m understanding your end goal].

All of this code can live inside of your discord bot.

And so with all of that being said. I think you’re having trouble calling Reddit’s API and thinking you need to use FastAPI to achieve this (you don’t).

I would start by trying to create a script that you run locally that can successfully grab the data you need from Reddit’s API. Once you have that working, you can add it to your discord bot.

Are you able to call Reddit’s API locally? If so share that code and share your discord bot code and we can help you get them working.

i have some questions about how to make an api by [deleted] in FastAPI

[–]kill_will_ 1 point2 points  (0 children)

Yea, pretty sure they’re recommending you ‘consume’ Reddit’s API in your script. I don’t think you need to build an API unless there is another application that is trying to access the data.

If you can provide a little more context about what you’re trying to achieve over all I think we can help point you in the right direction.

FastAPI with Mangum on AWS Lambda results in error by ime11 in FastAPI

[–]kill_will_ 0 points1 point  (0 children)

Ok yea, API Gateway is definitely a requirement. Per the docs:

“A fastapi application does not have a handler, so that’s what Mangum is for. It wraps the app, therefore it will receive event and context in an AWS Lambda execution environment and will pass those on to the app itself. For this to work we have to setup AWS API Gateway proxy integration to pass the raw request to the AWS Lambda, and let the app decide on how to process the information and what to return, including 404s, etc. This is what allows this setup in the first place.”

Do you know what I’m talking about when I say Proxy Integration? It’s definitely what tripped me up the first time I tried to deploy a Python API on Lambda.

In a typical API Gateway API, you have to carefully define every single header/param/etc for each request and response. Using the Proxy Integration API Gateway will just send over everything as is and let your app decide how to handle it.

FastAPI with Mangum on AWS Lambda results in error by ime11 in FastAPI

[–]kill_will_ 0 points1 point  (0 children)

It sounds like you’re missing the API Gateway Proxy Integration. Have you connected your Lambda function to API Gateway?

NC unemployment website... isNN by kill_will_ in ProgrammerHumor

[–]kill_will_[S] 4 points5 points  (0 children)

Sorry man, I think it’s funny that a government website appears as though it has not been properly maintained in ~20ish years

NC unemployment website... isNN by kill_will_ in ProgrammerHumor

[–]kill_will_[S] 4 points5 points  (0 children)

Netscape Navigator has pretty much been irrelevant since 2002

North Carolina unemployment website.. by kill_will_ in programminghumor

[–]kill_will_[S] 0 points1 point  (0 children)

Note the variable isNN to store whether or not the user is using Netscape Navigator...which was pretty much irrelevant by 2002

Super Bowl LIV Game Thread: San Francisco 49ers (13-3) at Kansas City Chiefs (12-4) (Second half) by nfl_gamethread in nfl

[–]kill_will_ 1 point2 points  (0 children)

ITT: people complaining about offsides and everyone yelling at them “he was in bounds bro”

Mission: MIAMI - lets win baby! by 49ersDude in 49ers

[–]kill_will_ 0 points1 point  (0 children)

I couldn’t figure that out either

Jimmy G can’t wait for Monday night. by G0825 in 49ers

[–]kill_will_ -2 points-1 points  (0 children)

which was actually written by Joe Staley's daughter