Попытка создать команду разногласий, чтобы показать количество времени, в течение которого моя дочь была жива
@commands.command(hidden=True)
@commands.cooldown(1, 5, commands.BucketType.guild)
async def luxe(self, ctx):
currentDate = datetime.utcnow()
print(currentDate)
deadline = '08/05/2020 10:05:00'
deadlineDate = datetime.strptime(deadline, '%d/%m/%Y %H:%M:%S')
print(deadlineDate)
daysLeft = currentDate-deadlineDate
years = ((daysLeft.total_seconds()) / (365.242 * 24 * 3600))
yearsInt = int(years)
months = (years - yearsInt) * 12
monthsInt = int(months)
weeks = (years - yearsInt) * 52
weeksInt = int(weeks)
days = (months - monthsInt) * (365.242 / 12)
daysInt = int(days)
hours = (days - daysInt) * 24
hoursInt = int(hours)
minutes = (hours - hoursInt) * 60
minutesInt = int(minutes)
seconds = (minutes - minutesInt) * 60
secondsInt = int(seconds)
if yearsInt == 0 and monthsInt == 0:
embed = discord.Embed(title="Luxe Olivia Violet Ellisdon",
description=f"She is exactly {weeksInt} weeks, {daysInt} days, {hoursInt} hours, {minutesInt} minutes, {secondsInt} seconds old.",
colour=ctx.author.colour,
timestamp=datetime.utcnow())
embed.set_author(name=self.bot.user.name, icon_url=self.bot.user.avatar_url)
embed.set_footer(text=f'You found an easter egg')
embed.set_image(url='https://i.ibb.co/M1kb2q0/100868516-10158119041366257-6490464808603746304-n.jpg')
await ctx.send(embed=embed)
elif yearsInt == 0:
embed = discord.Embed(title="Luxe Olivia Violet Ellisdon",
description=f"She is exactly {monthsInt} months, {weeksInt} weeks, {daysInt} days, {hoursInt} hours, {minutesInt} minutes, {secondsInt} seconds old.",
colour=ctx.author.colour,
timestamp=datetime.utcnow())
embed.set_author(name=self.bot.user.name, icon_url=self.bot.user.avatar_url)
embed.set_image(url='https://i.ibb.co/M1kb2q0/100868516-10158119041366257-6490464808603746304-n.jpg')
embed.set_footer(text=f'You found an easter egg')
await ctx.send(embed=embed)
else:
embed = discord.Embed(title="Luxe Olivia Violet Ellisdon",
description=f"she is exactly {yearsInt} years, {monthsInt} months, {weeksInt }weeks, {daysInt} days, {hoursInt} hours, {minutesInt} minutes, {secondsInt} seconds old.",
colour=ctx.author.colour,
timestamp=datetime.utcnow())
embed.set_author(name=self.bot.user.name, icon_url=self.bot.user.avatar_url)
embed.set_image(url='https://i.ibb.co/M1kb2q0/100868516-10158119041366257-6490464808603746304-n.jpg')
embed.set_footer(text=f'You found an easter egg')
await ctx.send(embed=embed)
Это результат
это не совсем верно и Я не понимаю почему, и мне бы очень хотелось, если бы кто-нибудь объяснил, что я делаю неправильно. Ived добавил к нему правку из-за неправильной суммы и неправильного крайнего срока