title: Adding a timer to giveaway command discord.py
body: <p>I was trying to create a discord bot with giveaway command which updates time left every 1-2 mins in giveaway embed . I have been trying it since 3 days but wasn't able to find a solution. I managed to make it update seconds, but if I specify time more than 1m i.e. 60 seconds it automatically converts it to seconds and starts giveaway with time left in <strong>just seconds</strong> . I want it to keep time in given unit and  update time in --days, --hours, --minutes, --seconds left.</p>
  <p>Here are a few images what i mean:</p>
  <p>What it currently do:</p>
  <p><a href="https://i.stack.imgur.com/y5v2A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y5v2A.png" alt="enter image description here" /></a></p>
  <p>What i want it to do:</p>
  <p><a href="https://i.stack.imgur.com/xdqxV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xdqxV.png" alt="enter image description here" /></a></p>
  <p>Its just Ends In Or Time remaining what i want to be changed!</p>
  <p>My current code:</p>
  <pre class="lang-py prettyprint-override"><code>@commands.command()
      @commands.guild_only()
      async def gstart(self, ctx, duration, *, prize):
          time = self.convert(duration)
          if time == -1:
              await ctx.send(f'Answer Time With A Proper Unit (s, m, h, d)')
              return
          elif time == -2:
              await ctx.send(f'Time Must Be A Integer!')
              return
          giveawayembed = discord.Embed(
              title=&quot; New Giveaway! &quot;,
              description=f&quot;**Prize:** {prize}\n&quot;
                          f&quot;**Hosted By:** {ctx.author.mention}\n&quot;
                          f&quot;**Ends In:** {time} Seconds&quot;,
              colour=discord.Color.green()
          )
  
          msg = await ctx.send(embed=giveawayembed)
  
          reactions = await msg.add_reaction(&quot;&quot;)
  
          while time:
              await sleep(10)
              time -= 10
              giveawayembed.description= f&quot;**Prize:** {prize}\n**Hosted By:** {ctx.author.mention}\n**Ends In:** {time} Seconds&quot;
              await msg.edit(embed=giveawayembed)
  
          new_msg = await ctx.fetch_message(msg.id)
  
          users = await new_msg.reactions[0].users().flatten()
          users.pop(users.index(self.client.user))
  
          winner = random.choice(users)
  
          endembed = discord.Embed(
              title=&quot;Giveaway ended!&quot;,
              description=f&quot;Prize: {prize}\nWinner: {winner.mention}&quot;)
  
          await msg.edit(embed=endembed)
          await ctx.send(f&quot; Giveaway Winner: {winner.mention} | Prize: {prize}&quot;)
  </code></pre>
  <p>For Converting Time I Have:</p>
  <pre class="lang-py prettyprint-override"><code>class Giveaway(commands.Cog):
      def __init__(self, client):
          self.client = client
  
      def convert(self, time):
          pos = [&quot;s&quot;, &quot;m&quot;, &quot;h&quot;, &quot;d&quot;]
          time_dict = {&quot;s&quot; : 1, &quot;m&quot; : 60, &quot;h&quot; : 3600, &quot;d&quot; : 3600*24}
          unit = time[-1]
  
          if unit not in pos:
              return -1
          try:
              val = int(time[:-1])
          except:
              return -2
  
          return val * time_dict[unit]
  </code></pre>
  <p>Any help is highly appreciated! 
  And I m sorry if I wasn't able to make you understand my problem. </p>