“Meme Command Discord.py” Ответ

Meme Command Discord.py

@client.command(pass_context=True)
async def meme(ctx):
    embed = discord.Embed(title="", description="")

    async with aiohttp.ClientSession() as cs:
        async with cs.get('https://www.reddit.com/r/dankmemes/new.json?sort=hot') as r:
            res = await r.json()
            embed.set_image(url=res['data']['children'] [random.randint(0, 25)]['data']['url'])
            await ctx.send(embed=embed)
Long Lark

Discord Bot Python Meme Command

@client.command(pass_context=True)
async def meme(ctx):
    embed = discord.Embed(title="", description="")

    async with aiohttp.ClientSession() as cs:
        async with cs.get('https://www.reddit.com/r/dankmemes/new.json?sort=hot') as r:
            res = await r.json()
            embed.set_image(url=res['data']['children'] [random.randint(0, 25)]['data']['url'])
            await ctx.send(embed=embed)
Thecodecopyer

Ответы похожие на “Meme Command Discord.py”

Вопросы похожие на “Meme Command Discord.py”

Больше похожих ответов на “Meme Command Discord.py” по Python

Смотреть популярные ответы по языку

Смотреть другие языки программирования