fix(ping): negative ping (#218)
All checks were successful
Publish latest version / build (push) Successful in 1m10s

Also move the ":" to localization

Reviewed-on: #218
Co-authored-by: Mylloon <kennel.anri@tutanota.com>
Co-committed-by: Mylloon <kennel.anri@tutanota.com>
This commit is contained in:
Mylloon 2025-01-03 12:03:42 +01:00 committed by Mylloon
parent 467fce3a01
commit 43a67cff3c
Signed by: Forgejo
GPG key ID: E72245C752A07631
3 changed files with 10 additions and 9 deletions

View file

@ -23,10 +23,9 @@ export default {
withResponse: true,
});
interaction.editReply(
`${loc?.get("c_ping1")}: \
${sent.resource!.message!.createdTimestamp - interaction.createdTimestamp}ms
${loc?.get("c_ping2")}: ${client.ws.ping}ms.`,
);
const total = sent.resource!.message!.createdTimestamp - interaction.createdTimestamp;
const ws = client.ws.ping == -1 ? loc?.get("c_ping3") : client.ws.ping + "ms";
interaction.editReply(`${loc?.get("c_ping1")} ${total}ms\n${loc?.get("c_ping2")} ${ws}.`);
},
};

View file

@ -6,8 +6,9 @@
"c_ping_name": "Ping",
"c_ping_desc": "Pong!",
"c_ping1": "Roundtrip latency",
"c_ping2": "Web socket heartbeat",
"c_ping1": "Roundtrip latency:",
"c_ping2": "Web socket heartbeat:",
"c_ping3": "Unknown",
"c_help_name": "Help",
"c_help_desc": "Information about commands",

View file

@ -6,8 +6,9 @@
"c_ping_name": "Ping",
"c_ping_desc": "Pong!",
"c_ping1": "Latence totale",
"c_ping2": "Latence du Web socket",
"c_ping1": "Latence totale :",
"c_ping2": "Latence du Web socket :",
"c_ping3": "Inconnu",
"c_help_name": "Aide",
"c_help_desc": "Informations sur les commandes",