I'm creating a Discord.py bot and what I want it to do is add a !meme
command on which it pulls a random meme from the r/memes subreddit. I have found some code on Stack Overflow as to how to do that. My problem is that I need 3 parameters, client_id
, client_secret
and user_agent
, which I don't know how to get. Here's the code I found:
reddit = praw.Reddit(client_id='CLIENT_ID HERE',
client_secret='CLIENT_SECRET HERE',
user_agent='USER_AGENT HERE')
@bot.command()
async def meme():
memes_submissions = reddit.subreddit('memes').hot()
post_to_pick = random.randint(1, 10)
for i in range(0, post_to_pick):
submission = next(x for x in memes_submissions if not x.stickied)
await bot.say(submission.url)
Can someone help me get those parameters?