fix(bible): handle if the bot is unable to post embeds
This commit is contained in:
parent
4dfbc91ced
commit
6f04290cba
1 changed files with 20 additions and 14 deletions
|
@ -175,13 +175,16 @@ class Bible(commands.Cog):
|
||||||
await ctx.send("The passage is too long to send.")
|
await ctx.send("The passage is too long to send.")
|
||||||
return
|
return
|
||||||
|
|
||||||
embed = Embed(
|
if await ctx.embed_requested():
|
||||||
title=f"{passage['reference']}",
|
embed = Embed(
|
||||||
description=passage["content"].replace("¶ ", ""),
|
title=f"{passage['reference']}",
|
||||||
color=await self.bot.get_embed_color(ctx.channel),
|
description=passage["content"].replace("¶ ", ""),
|
||||||
)
|
color=await self.bot.get_embed_color(ctx.channel),
|
||||||
embed.set_footer(text=f"{ctx.prefix}bible passage - Powered by API.Bible")
|
)
|
||||||
await ctx.send(embed=embed)
|
embed.set_footer(text=f"{ctx.prefix}bible passage - Powered by API.Bible")
|
||||||
|
await ctx.send(embed=embed)
|
||||||
|
else:
|
||||||
|
await ctx.send(f"## {passage['reference']}\n{passage['content']}")
|
||||||
|
|
||||||
@bible.command(name="random")
|
@bible.command(name="random")
|
||||||
async def bible_random(self, ctx: commands.Context):
|
async def bible_random(self, ctx: commands.Context):
|
||||||
|
@ -207,10 +210,13 @@ class Bible(commands.Cog):
|
||||||
await ctx.send(e.message)
|
await ctx.send(e.message)
|
||||||
return
|
return
|
||||||
|
|
||||||
embed = Embed(
|
if await ctx.embed_requested():
|
||||||
title=f"{passage['reference']}",
|
embed = Embed(
|
||||||
description=passage["content"].replace("¶ ", ""),
|
title=f"{passage['reference']}",
|
||||||
color=await self.bot.get_embed_color(ctx.channel),
|
description=passage["content"].replace("¶ ", ""),
|
||||||
)
|
color=await self.bot.get_embed_color(ctx.channel),
|
||||||
embed.set_footer(text=f"{ctx.prefix}bible random - Powered by API.Bible")
|
)
|
||||||
await ctx.send(embed=embed)
|
embed.set_footer(text=f"{ctx.prefix}bible random - Powered by API.Bible")
|
||||||
|
await ctx.send(embed=embed)
|
||||||
|
else:
|
||||||
|
await ctx.send(f"## {passage['reference']}\n{passage['content']}")
|
||||||
|
|
Loading…
Reference in a new issue