feat: Add basic proxy support.
This commit is contained in:
@@ -68,6 +68,7 @@ async def main():
|
|||||||
shard_id=sharding.shard_number,
|
shard_id=sharding.shard_number,
|
||||||
shard_count=sharding.shard_count,
|
shard_count=sharding.shard_count,
|
||||||
help_command=None,
|
help_command=None,
|
||||||
|
proxy=conf.bot.get('proxy', None),
|
||||||
translator=translator
|
translator=translator
|
||||||
) as lionbot:
|
) as lionbot:
|
||||||
ctx_bot.set(lionbot)
|
ctx_bot.set(lionbot)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ from psycopg import sql
|
|||||||
from cachetools import TTLCache
|
from cachetools import TTLCache
|
||||||
import discord
|
import discord
|
||||||
|
|
||||||
|
from meta import conf
|
||||||
from data import Table, Registry, Column, RowModel, RegisterEnum
|
from data import Table, Registry, Column, RowModel, RegisterEnum
|
||||||
from data.models import WeakCache
|
from data.models import WeakCache
|
||||||
from data.columns import Integer, String, Bool, Timestamp
|
from data.columns import Integer, String, Bool, Timestamp
|
||||||
@@ -367,4 +368,6 @@ class CoreData(Registry, name="core"):
|
|||||||
token = String()
|
token = String()
|
||||||
|
|
||||||
def as_webhook(self, **kwargs):
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user