DeleteGame: added a try catch
This commit is contained in:
parent
21810d3b53
commit
fa28e10f27
|
|
@ -127,7 +127,10 @@ class SecretBot(commands.Cog):
|
||||||
gm_role = game.get_gm_role()
|
gm_role = game.get_gm_role()
|
||||||
await game.delete()
|
await game.delete()
|
||||||
await ctx.guild.get_member(self.bot.user.id).remove_roles(gm_role)
|
await ctx.guild.get_member(self.bot.user.id).remove_roles(gm_role)
|
||||||
await ctx.reply(":white_check_mark: Game deleted!")
|
try:
|
||||||
|
await ctx.reply(":white_check_mark: Game deleted!")
|
||||||
|
except discord.NotFound: # If the command is executed in a game channel, then the channel won't exist anymore for the reply
|
||||||
|
pass
|
||||||
|
|
||||||
@commands.command("StartVote")
|
@commands.command("StartVote")
|
||||||
async def start_vote(self, ctx: commands.Context, president: discord.Member, chancellor: discord.Member):
|
async def start_vote(self, ctx: commands.Context, president: discord.Member, chancellor: discord.Member):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue