[V3 Streams] fix an issue with stream commands not dealing with reruns (#2679)

This commit is contained in:
palmtree5 2019-05-16 18:28:26 -08:00 committed by Michael H
parent db3fb29b30
commit 21a253103e

View File

@ -131,7 +131,7 @@ class Streams(commands.Cog):
@staticmethod @staticmethod
async def check_online(ctx: commands.Context, stream): async def check_online(ctx: commands.Context, stream):
try: try:
embed = await stream.is_online() info = await stream.is_online()
except OfflineStream: except OfflineStream:
await ctx.send(_("That user is offline.")) await ctx.send(_("That user is offline."))
except StreamNotFound: except StreamNotFound:
@ -155,6 +155,14 @@ class Streams(commands.Cog):
_("Something went wrong whilst trying to contact the stream service's API.") _("Something went wrong whilst trying to contact the stream service's API.")
) )
else: else:
if isinstance(info, tuple):
embed, is_rerun = info
ignore_reruns = await self.db.guild(channel.guild).ignore_reruns()
if ignore_reruns and is_rerun:
await ctx.send(_("That user is offline."))
return
else:
embed = info
await ctx.send(embed=embed) await ctx.send(embed=embed)
@commands.group() @commands.group()