feat: Add basic proxy support.

This commit is contained in:
2023-08-20 12:29:56 +03:00
parent 267eb97fe4
commit d578e7471d
2 changed files with 5 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ from psycopg import sql
from cachetools import TTLCache
import discord
from meta import conf
from data import Table, Registry, Column, RowModel, RegisterEnum
from data.models import WeakCache
from data.columns import Integer, String, Bool, Timestamp
@@ -367,4 +368,6 @@ class CoreData(Registry, name="core"):
token = String()
def as_webhook(self, **kwargs):
return discord.Webhook.partial(self.webhookid, self.token, **kwargs)
webhook = discord.Webhook.partial(self.webhookid, self.token, **kwargs)
webhook.proxy = conf.bot.get('proxy', None)
return webhook