I want to make my bot send a random image from a subreddit (r/memes). Here's what I have:
@client.event
async def on_message(message):
if message.content.startswith('.meme'):
memes_submissions = reddit.subreddit('memes').hot()
post_to_pick = random.randint(1, 50)
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)
It doesn't seem to be working, any tips?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…