title: trying to make an afk command for my bot but i am getting this error
body: <pre><code>  async def afk(self, ctx, *args):
      msg = ' '.join(args)
      self.data.append(ctx.author.id)
      self.data.append(msg)
      await ctx.author.edit(nick=f'[AFK] {ctx.author.name}')
      await ctx.send(&quot;afk set!&quot;)
  
    @commands.Cog.listener()
    async def on_message(self, message):
      for i in range(len(self.data)):
        if (f&quot;&lt;@{self.data[i]}&gt;&quot; in message.content) and (not message.author.bot):
          await message.channel.send(f&quot;&lt;@{self.data[i]}&gt; is away right now, they said: {self.data[i+1]}&quot;)
          return None
          break
  
    @commands.Cog.listener()
    async def on_typing(self, channel, user, when):
      if user.id in self.data:
        i = self.data.index(user.id)
        self.data.remove(self.data[i+1])
        self.data.remove(user.id)
        nick = ctx.author.name.replace('[AFK]', '')
        await ctx.author.edit(nick=nick)
        await channel.send(f&quot;{user.mention}, Welcome back!&quot;)
  </code></pre>
  <p>But it is showing <em>ctx</em> is not found <code>nick = ctx.author.name.replace('[AFK]', '')</code> i have been trying various methods to solve it, but i am not able to fix this, pls help me</p>