fix(bible): added error message if a passage is too long
This commit is contained in:
parent
bb53343ecc
commit
b9fba23415
1 changed files with 4 additions and 0 deletions
|
@ -95,6 +95,10 @@ class Bible(commands.Cog):
|
||||||
else:
|
else:
|
||||||
passage = await self._get_passage(bible_id, f"{book_id}.{passage.replace(':', '.')}")
|
passage = await self._get_passage(bible_id, f"{book_id}.{passage.replace(':', '.')}")
|
||||||
|
|
||||||
|
if len(passage["content"]) > 4096:
|
||||||
|
await ctx.send("The passage is too long to send.")
|
||||||
|
return
|
||||||
|
|
||||||
embed = Embed(title=f"{passage['reference']}", description=passage["content"].replace('¶ ', ''), color=await self.bot.get_embed_color(ctx.channel))
|
embed = Embed(title=f"{passage['reference']}", 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")
|
embed.set_footer(text=f"{ctx.prefix}bible passage - Powered by API.bible")
|
||||||
await ctx.send(embed=embed)
|
await ctx.send(embed=embed)
|
||||||
|
|
Loading…
Reference in a new issue