Replace deprecated String#substr with String#slice (#8314)

This commit is contained in:
CommanderRoot 2022-04-14 09:52:42 +02:00 committed by GitHub
parent 0e68c16a90
commit c35fc169f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 37 additions and 37 deletions

View file

@ -55,7 +55,7 @@ export default class CommandProvider extends AutocompleteProvider {
// check if the full match differs from the first word (i.e. returns false if the command has args)
if (command[0] !== command[1]) {
// The input looks like a command with arguments, perform exact match
const name = command[1].substr(1); // strip leading `/`
const name = command[1].slice(1); // strip leading `/`
if (CommandMap.has(name) && CommandMap.get(name).isEnabled()) {
// some commands, namely `me` don't suit having the usage shown whilst typing their arguments
if (CommandMap.get(name).hideCompletionAfterSpace) return [];