Make /member command indices 0-based to match autocomplete

This commit is contained in:
Cohee
2024-06-23 16:47:07 +03:00
parent e736283785
commit 2012bb49d2

View File

@@ -246,7 +246,7 @@ export function getGroupMembers(groupId = selected_group) {
/** /**
* Finds the character ID for a group member. * Finds the character ID for a group member.
* @param {string} arg 1-based member index or character name * @param {string} arg 0-based member index or character name
* @returns {number} 0-based character ID * @returns {number} 0-based character ID
*/ */
export function findGroupMemberId(arg) { export function findGroupMemberId(arg) {
@@ -264,8 +264,7 @@ export function findGroupMemberId(arg) {
return; return;
} }
// Index is 1-based const index = parseInt(arg);
const index = parseInt(arg) - 1;
const searchByName = isNaN(index); const searchByName = isNaN(index);
if (searchByName) { if (searchByName) {