Skip to content

Commit

Permalink
Merge pull request #79 from Pho3nix-Jacki3/Pho3nix-Jacki3-cat-updat-a…
Browse files Browse the repository at this point in the history
…nd-dog-api-add

Cat update and add doggo command
  • Loading branch information
MEhrn00 authored Apr 2, 2024
2 parents e956b93 + 0415cf0 commit db72ca4
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions JHDBot/cogs/veteran.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ async def not_your_personal_avengers(self, ctx):
# Cat command - to embed wholesomeness in chat
@commands.command(
name="cat",
help="Command to add wholesomeness to chat."
help="Command to add wholesomeness to chat...or change the subject"
)
async def cat(self, ctx):
if await self.check_perms(ctx):
async with aiohttp.ClientSession() as session:
async with session.get('https://api.thecatapi.com/api/images/get?format=json') as response:
async with session.get('https://api.thecatapi.com/v1/images/search?format=json') as response:
html = json.loads(await response.text())
emb = discord.Embed(description=f'Kato <3', colour=0x3CFF4C)
emb.set_footer(text=f"Cute isn't it/kawaii da ne?")
Expand All @@ -93,6 +93,23 @@ async def cat(self, ctx):
else:
return

# Dog command - to embed more wholesomeness in chat
@commands.command(
name="dog",
help="Another command to add wholesomeness to chat...or change the subject."
)
async def dog(self, ctx):
if await self.check_perms(ctx):
async with aiohttp.ClientSession() as session:
async with session.get('https://api.thedogapi.com/v1/images/search?format=json') as response:
html = json.loads(await response.text())
emb = discord.Embed(description=f'Inu <3', colour=0x3CFF4C)
emb.set_footer(text=f"Cute isn't it/kawaii da ne?")
emb.set_image(url=(html[0]["url"]))
await ctx.send(embed=emb)
else:
return

# blackhat command
@commands.command(
name="blackhat",
Expand Down

0 comments on commit db72ca4

Please sign in to comment.