Improve login, replace deprecated substr calls

This commit is contained in:
Casper Warden
2023-11-29 16:01:50 +00:00
parent 09db20682e
commit 58c5a1a08e
14 changed files with 114 additions and 78 deletions

View File

@@ -88,9 +88,9 @@ class GroupChat extends ExampleBot
}
else if (event.from.toString() === this.bot.agentID().toString())
{
if (event.message.substr(0, 5) === 'ping ')
if (event.message.substring(0, 5) === 'ping ')
{
const pingID = event.message.substr(5);
const pingID = event.message.substring(5);
if (this.pings[pingID])
{
const time = (new Date().getTime()) - this.pings[pingID];