From 9f0075b7f6f450ae25a4a956d74d66519655f626 Mon Sep 17 00:00:00 2001
From: Kurisu <mael.martin31@gmail.com>
Date: Thu, 24 Dec 2020 10:31:13 +0100
Subject: [PATCH] Allowing for proxy in .env

---
 launch.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/launch.py b/launch.py
index 8a6d00c..fd8c846 100644
--- a/launch.py
+++ b/launch.py
@@ -14,6 +14,7 @@ SECRET = os.getenv('REDDIT_SECRET')
 REDDIT_ID = os.getenv('REDDIT_ID')
 REDDIT_AGENT = os.getenv('REDDIT_AGENT')
 
+PROXY = os.getenv('PROXY')
 postLimit = int(os.getenv('POST_LIMIT'))
 
 subreddits = dict()
@@ -75,7 +76,11 @@ def create_embed(post,author,posturl):
     return embed
 
 refresh_all_posts()
-client = discord.Client()
+
+if PROXY != "":
+    client = discord.Client(proxy=PROXY)
+else:
+    client = discord.Client()
 
 @client.event
 async def on_ready():
-- 
GitLab