title: Is there a way to stop discord bit from running this code?
body: <p>Heyyyyy
  I’m making a discord bot and it has a !kill command in it. You would use it like this:</p>
  <p>!kill MySecretCode
  !yes
  Or
  !no
  Is there a way to prevent the code from listening to the !yes function after I do !no? Here’s the code (Python):</p>
  <pre><code>
  @client.command()
  @commands.has_any_role(&quot;Server Owner&quot;)
  async def kill(ctx, code):
    if code == &quot;MySecretCode&quot;:
      channel = discord.utils.get(ctx.author.guild.text_channels, name=&quot;new-channel&quot;)
      emb = discord.Embed(color=discord.Color.orange(), title=&quot;**Terminate Bot?**&quot;,description=f&quot;Are you sure you want to terminate this bot?\nTo continue with termination, type '!yes'.\nTo cancel the termination, type '!no'.&quot;)
      await channel.send(embed=emb)
      @client.command()
      async def yes(ctx):
        channel = discord.utils.get(ctx.author.guild.text_channels, name=&quot;new-channel&quot;)
        emb = discord.Embed(color=discord.Color.red(), title=&quot;**Terminating**&quot;,description=f&quot;Process terminating...&quot;)
        await channel.send(embed=emb)
        await client.close()
        print(&quot;Bot terminated&quot;)
      @client.command()
      async def no(ctx):
        channel = discord.utils.get(ctx.author.guild.text_channels, name=&quot;new-channel&quot;)
        emb = discord.Embed(color=discord.Color.green(), title=&quot;**Termination Canceled**&quot;,description=f&quot;You canceled the termination process&quot;)
        await channel.send(embed=emb)
  
  
  </code></pre>