'"<function status.<locals>.uptimed at 0x000001C35A56FE20>", What is this?
While I was coding my discord bot using disnake, when i use /status, instead of showing all information needed, the uptime gets this: <function status.<locals>.uptimed at 0x000001C35A56FE20> what's happening, and how to solve it?
Code:
@bot.slash_command(description="Mostra a latência do bot", pass_context=True)
async def status(self, interaction: disnake.CommandInteraction):
await interaction.response.defer()
def uptimed():
pass
current_time = time.time()
difference = int(round(current_time - start_time))
text = str(datetime.timedelta(seconds=difference))
text.replace(" years", "Y")
text.replace(" year", "Y")
text.replace(" months", "M")
text.replace(" month", "M")
text.replace(" days", "d")
text.replace(" day", "d")
print(uptimed)
before = time.monotonic()
carregando = disnake.Embed(
description="⏳ - Carregando...",
color=0x00ffff
)
await interaction.edit_original_message(embed=carregando)
ping = (time.monotonic() - before) * 1000
Embed_De_Ping = disnake.Embed(
title="Status:",
description=f"> - Ping da Websocket: **{round(bot.latency * 1000)}**ms \n > - Ping da Client: **{int(ping)}**ms \n> - Uptime: **{uptimed}**",
color=0x2f3136)
await interaction.edit_original_message(embed=Embed_De_Ping)```
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
