User Tools

Site Tools


iab:user_matching

iab User Pattern Matching

For compatible commands, a user is matched if any of the following are equal to the given string:

  1. The user's ID
  2. The user's full user string (john#1000)
  3. The user's username
  4. The user's nickname (case insensitive)
  5. The user's mention

Users are pre-sorted by user string.

For example, consider a guild with six members Jake#1444, Ryan#2041, Mary#5992, Mary#5822, Bob#4674, and Bobbert#9591. Assume that their user IDs are their index in this list, such that Jake's ID is 1, and Bobbert's is 6.

The users list is presorted to the following: { Bob#4674 (5), Bobbert#9591 (6), Jake#1444 (1), Mary#5822 (4), Mary#5992 (3), Ryan#2041 (2) }

The following is a list of input strings and their output.

BobBob#4674 (5)

BOBBob#4674 (5)

MaryMary#5822 (4) (since Mary is ambiguous, the first match is used.)

Mary#5992Mary#5992 (3)

3Mary#5992 (3)

@BobbertBobbert#9591 (6)

One thing to note is that if Bob changes his nickname to Mary, Mary will match his user instead.

iab/user_matching.txt · Last modified: 2021/02/24 06:31 by nuyube