-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinsult.py
36 lines (29 loc) · 1.16 KB
/
insult.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import aiohttp
import discord
from discord.ext import commands
from discord.ext.commands import BucketType, cooldown
class Fancy(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print("Insult cog loaded successfully")
@commands.command(description="Roasts :)")
async def roast(self, ctx, member: discord.Member = None):
if member == None:
member = ctx.author
async with aiohttp.ClientSession() as session:
async with session.get(
f"https://insult.mattbas.org/api/insult"
) as response:
insult = await response.text()
embed = discord.Embed(
timestamp=ctx.message.created_at,
title=f"{member.name} made roasted 🍳 toast 🍞",
description=f"{insult}",
color=0xFF0000,
)
embed.set_thumbnail(url="https://i.pinimg.com/originals/b4/b6/4a/b4b64a36369525c0f0574bdb0cb5239d.jpg")
await ctx.send(embed=embed)
def setup(client):
client.add_cog(Fancy(client))