Skip to content

Commit

Permalink
[Animals] use send & reference instead od reply
Browse files Browse the repository at this point in the history
  • Loading branch information
japandotorg committed Sep 23, 2023
1 parent 50e5e8c commit c6b9e25
Showing 1 changed file with 46 additions and 23 deletions.
69 changes: 46 additions & 23 deletions animals/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,10 @@ async def _dog(self, ctx: commands.Context, *, breed: Optional[str] = None):
)
embed.set_image(url=image)
embed.set_author(name=name)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand Down Expand Up @@ -256,9 +257,10 @@ async def bear(self, ctx: commands.Context):
description=description,
)
embed.set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -275,9 +277,10 @@ async def bird(self, ctx: commands.Context):
description=description,
)
embed.set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -291,9 +294,10 @@ async def _dolphin(self, ctx: commands.Context):
embed: discord.Embed = discord.Embed(
color=await ctx.embed_color(),
).set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -305,9 +309,10 @@ async def _duck(self, ctx: commands.Context):
await ctx.typing()
image = await AnimalAPI(self.session).image("duck")
embed: discord.Embed = discord.Embed(color=await ctx.embed_color()).set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -319,9 +324,10 @@ async def _elephant(self, ctx: commands.Context):
await ctx.typing()
image = await AnimalAPI(self.session).image("elephant")
embed: discord.Embed = discord.Embed(color=await ctx.embed_color()).set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -338,9 +344,10 @@ async def _giraffe(self, ctx: commands.Context):
description=description,
)
embed.set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -352,9 +359,10 @@ async def _hippo(self, ctx: commands.Context):
await ctx.typing()
image = await AnimalAPI(self.session).image("hippo")
embed: discord.Embed = discord.Embed(color=await ctx.embed_color()).set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -366,9 +374,10 @@ async def _horse(self, ctx: commands.Context):
await ctx.typing()
image = await AnimalAPI(self.session).image("horse")
embed: discord.Embed = discord.Embed(color=await ctx.embed_color()).set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -380,9 +389,10 @@ async def _killerwhale(self, ctx: commands.Context):
await ctx.typing()
image = await AnimalAPI(self.session).image("killerwhale")
embed: discord.Embed = discord.Embed(color=await ctx.embed_color()).set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -399,9 +409,10 @@ async def _lion(self, ctx: commands.Context):
description=description,
)
embed.set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -418,9 +429,10 @@ async def _panda(self, ctx: commands.Context):
description=description,
)
embed.set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -432,9 +444,10 @@ async def _pig(self, ctx: commands.Context):
await ctx.typing()
image = await AnimalAPI(self.session).image("pig")
embed: discord.Embed = discord.Embed(color=await ctx.embed_color()).set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -449,9 +462,10 @@ async def _redpanda(self, ctx: commands.Context):
embed: discord.Embed = discord.Embed(
description=description, color=await ctx.embed_color()
).set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -468,9 +482,10 @@ async def _shark(self, ctx: commands.Context):
description=description,
)
embed.set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -487,9 +502,10 @@ async def _snake(self, ctx: commands.Context):
description=description,
)
embed.set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -501,9 +517,10 @@ async def _spider(self, ctx: commands.Context):
await ctx.typing()
image = await AnimalAPI(self.session).image("spider")
embed: discord.Embed = discord.Embed(color=await ctx.embed_color()).set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -515,9 +532,10 @@ async def _turtle(self, ctx: commands.Context):
await ctx.typing()
image = await AnimalAPI(self.session).image("turtle")
embed: discord.Embed = discord.Embed(color=await ctx.embed_color()).set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -534,9 +552,10 @@ async def _fox(self, ctx: commands.Context):
description=description,
)
embed.set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -553,9 +572,10 @@ async def _koala(self, ctx: commands.Context):
description=description,
)
embed.set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -572,9 +592,10 @@ async def _kangaroo(self, ctx: commands.Context):
description=description,
)
embed.set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -591,9 +612,10 @@ async def _raccoon(self, ctx: commands.Context):
description=description,
)
embed.set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

@commands.bot_has_permissions(embed_links=True)
Expand All @@ -605,7 +627,8 @@ async def _lizard(self, ctx: commands.Context):
await ctx.typing()
image = await AnimalAPI(self.session).image("lizard")
embed: discord.Embed = discord.Embed(color=await ctx.embed_color()).set_image(url=image)
await ctx.reply(
await ctx.send(
embed=embed,
allowed_mentions=discord.AllowedMentions(replied_user=False),
reference=ctx.message.to_reference(fail_if_not_exists=False),
)

0 comments on commit c6b9e25

Please sign in to comment.