From 11ddf996228d8855ee25d0a080fc1fb79fa8b7ae Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 11 Dec 2020 11:04:04 +0100 Subject: [PATCH] =?UTF-8?q?identifiants=20reddit=20d=C3=A9plc=C3=A9=20vers?= =?UTF-8?q?=20le=20fichier=20tokens.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cogs/internet.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cogs/internet.py b/cogs/internet.py index d119d94..0e12c9f 100644 --- a/cogs/internet.py +++ b/cogs/internet.py @@ -2,6 +2,7 @@ import discord, praw, json, requests, datetime from discord.ext import commands from random import randint, choice import time +from tokens import token_reddit as token # à l'importation de l'extension, le fichier se retrouve dans le '/' et non dans 'cogs/', ignorez l'erreur pylint def setup(client): client.add_cog(Internet(client)) @@ -34,7 +35,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 = 'nHPaCR8L_jlmwQ', client_secret = 'tSCjb4QvdiNyCYKmW35SEWhjV8w', user_agent = 'disreddit /u/mylloon, http://localhost:8080') + reddit = praw.Reddit(client_id = token['client_id'], client_secret = token['client_secret'], user_agent = f"disreddit /{token['user_agent']}, http://localhost:8080") if args != "": # si il y a un arg différent d'un meme subredditchoix = args