Exemplo n.º 1
0
async def recent(ctx):
    response = requests.get(
        'https://devrant.com/api/devrant/rants?app=3&sort=recent&limit=1')

    if response.json()['success'] != True:
        await ctx.send(embed=error_embed(response.json()['error']))
        return

    rant = response.json()['rants'][0]
    await ctx.send(embed=generate_embed(rant))
Exemplo n.º 2
0
async def surprise(ctx):
    response = requests.get(
        'https://devrant.com/api/devrant/rants/surprise?app=3')

    if response.json()['success'] != True:
        await ctx.send(embed=error_embed(response.json()['error']))
        return

    rant = response.json()['rant']
    await ctx.send(embed=generate_embed(rant))
Exemplo n.º 3
0
async def rant(ctx, link):
    id = link.split('/')[4]

    response = requests.get('https://devrant.com/api/devrant/rants/' + id +
                            '?app=3')

    if response.json()['success'] != True:
        await ctx.send(embed=error_embed(response.json()['error']))
        return

    rant = response.json()['rant']
    await ctx.send(embed=generate_embed(rant))