Urlfetch to retun None

Asked Mar 26, 2023·4 replies·Last activity 3 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

In current state if the api doesn't respond with anything it says "​Error Connecting To Remote Server"

why this problem exists in first place ?
i have a string of 600 character
so if i want to send it to chat. i need to split it with 200 characters each

now lets say i send the last one as the response to the request. and the first and second to Nightbot-Response-Url

due to timeout between each message sent to reponse-url the original request will raise the error 500.

if there was a way to not send anything back it would be nice.

4 replies

also i can't even send a extra message of something like "Done" as by then request is timed out.

Hiya, Nightbot only waits for a couple of seconds for your API to respond, otherwise you'll see that error message. If you don't want to return anything return a space " ", and just use the response-url to send all 3 messages. Or if you do want to do it your current way, depending on your programming language, return the first part directly to Nightbot, and run response-url calls from the background.

Yeah I thought of returning a " "
but as far as i remember i can't do it in flask (py)
as it based on functions and you "return" responses. and then and their function ends.

i think i can overcome this by scheduling a task that take cares of it.
I will take a look into it.