From 6d282f28e42b360395e78fc9956db5a62a165b5c Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 11 Dec 2020 15:43:11 +0100 Subject: [PATCH] simplification reddit token --- README.md | 5 ++++- cogs/internet.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d326be8..39a75b5 100755 --- a/README.md +++ b/README.md @@ -12,8 +12,11 @@ ```python token_discord = "ton token discord" token_genius = "ton token genius" -token_reddit = {"client_id": "ton client_id", "client_secret": "ton client_secret", "user_agent": "ton pseudo (exemple u/gotaga)"} +token_reddit = {"client_id": "ton client_id", "client_secret": "ton client_secret", "user_agent": "ton pseudo reddit"} ``` +Pour trouver ton token reddit, va sur [ce site](https://www.reddit.com/prefs/apps) et voici les instructions : ![instructions](https://i.imgur.com/tEzYKDA.png) + +*rediriger uri (pour le copié/collé) : http://localhost:8080* #### __Mise en marche__ diff --git a/cogs/internet.py b/cogs/internet.py index 7255c3c..42895fb 100644 --- a/cogs/internet.py +++ b/cogs/internet.py @@ -17,7 +17,7 @@ class Internet(commands.Cog): async def _memes(self, ctx, *, args = ""): """Envois un meme de reddit.\n ➡ Syntaxe: .memes/meme [subreddit]⁢⁢⁢⁢⁢⁢⁢⁢⁢⁢""" try: - reddit = praw.Reddit(client_id = token['client_id'], client_secret = token['client_secret'], user_agent = f"disreddit /{token['user_agent']}, http://localhost:8080") + reddit = praw.Reddit(client_id = token['client_id'], client_secret = token['client_secret'], user_agent = f"disreddit /u/{token['user_agent']}, http://localhost:8080") if args != "": # si il y a un arg différent d'un meme subredditchoix = args