lovvskillz / python-discord-webhook

execute discord webhooks
MIT License
495 stars 77 forks source link

[FEATURE REQUEST] A few different proxy additions. #37

Open GenerelSchwerz opened 3 years ago

GenerelSchwerz commented 3 years ago
  1. If a webhook returns an error such as a 429 error, there should be a way to iterate through the supplied dict of proxies.

  2. As far as I'm aware, setting the proxies for a webhook object does not persist through a While or For-loop if it is nested. As such, proxies (to my albeit mediocre coding skills) can't be changed per n messages sent.

  3. The proxies used by the webhook should be an attribute of the webhook so debugging for proxy usage is easier.

GrandMoff100 commented 2 years ago
  1. Could you iterate through the webhook.proxies attribute of a given webhook that you call .execute() on?

  2. The workaround is a little hacky, but you could modify the .proxies attribute of the webhook object in the for/while loop, given that the webhook object persists, a.k.a. initializing it before entering the loop.

  3. As for you third point, the proxies are available with webhook.proxies, that's where the DiscordWebhook class stores them the proxies to use, until and after executed.

Does this help? And if not, do you have any subsequent questions?