Open liquidnya opened 2 years ago
Commands, that check the queue for someones level, e.g. !add (to prevent submitting 2 or more levels), !replace, !position, !list (if the current user is present in that short list of levels), !odds, ... (command list might not be complete) could also rename users automatically if possible. Automatically means, that if their user id is found and their username or displayName is different, then the queue will be updated automatically when those commands are used, or if their username is found (on an entry where the user id is null), then their displayName should be updated automatically! In those cases a separate bot message should be emitted.
isForced
: usually only the broadcaster can force a rename (required)currentUsername
(required)currentDisplayName
(required)currentUserId
(optional)previousName
: a username or a displayName (optional)levels
: level list concatenated with the current level containing the following information per level
entryUsername
(required)entryDisplayName
(required)entryUserId
(optional)Any of these:
UpdatedResult
containing previousUsername
, previousDisplayName
, previousMatch
, and level
Their username and/or displayName was updated to previousUsername
and previousDisplayName
respectively and previousMatch
can contain the following results:
null
if the previousName
is not presenttrue
if and only if the previousName
matchesfalse
otherwiselevel
contains the level of the user
NoRenameResult
containing level
If they are in the queue and there is no need to rename anything
level
contains the level of the userNoPermissionResult
containing fromUsername
, fromDisplayName
, fromName
, toName
, and level
If they do not have the permission to rename themselves
fromUsername
contains their potential previous username
fromDisplayName
contains their potential previous displayName
fromName
contains the fromDisplyName
with an optional leading '@'
, to be used as the first argument of the modRename command
toName
contains the currentDisplayName
with an optional leading '@'
, to be used as the second argument of the modRename command
level
contains the level of the userNoEntryResult
containing suggestPreviousName
suggestPreviousName
is true
if there is a chance of finding a level if previousName
would have been provided, and false
otherwiselevels
matching entryUserId
with the currentUserId
if both are present
level
is set)
Check if the currentUsername
is different than the entryUsername
or if the currentDisplayName
is different than the entryDisplayName
NoRenameResult
levels
matching previousName
with entryUsername
or entryDisplayName
if previousName
is present, ignoring an optional leading '@'
in previousName
level
is set)
Check if the currentUsername
is different than the entryUsername
or if the currentDisplayName
is different than the entryDisplayName
entryUserId
is null
and entryUsername
is currentUsername
then run the updateLevel algorithm
If isForced
is true
then run the updateLevel algorithm
Otherwise run the noPermissions algorithmNoRenameResult
levels
matching entryUsername
with currentUsername
and entryUserId
and/or currentUserId
needs to be null
:
level
is set)
Check if the currentUsername
is different than the entryUsername
or if the currentDisplayName
is different than the entryDisplayName
entryUserId
is null
then run the updateLevel algorithm
If isForced
is true
then run the updateLevel algorithm
Otherwise run the noPermissions algorithmNoRenameResult
suggestPreviousName
to true
if there are any levels in the queue where entryUserId
is not present, otherwise set it to false
NoEntryResult
previousUsername
to entryUsername
previousDisplayName
to entryDisplayName
entryUsername
to currentUsername
entryDisplayName
to currentDisplayName
entryUserId
to currentUserId
if and only if entryUserId
is null
previousMatch
to:
null
if prevousName
is not presenttrue
if and only if the previousName
matches previousUsername
or previousDisplayName
, ignoring an optional leading '@'
in previousName
false
otherwisepreviousUsername
to currentUsername
UpdatedResult
fromUsername
to entryUsername
fromDisplayName
to entryDisplayName
prevousName
is present and if the previousName
matches fromUsername
or fromDisplayName
, ignoring an optional leading '@'
in previousName
fromName
to previousName
fromName
to '@'
+ fromDisplayName
toName
to '@'
+ currentDisplayName
NoPermissionResult
!rename
(automatic rename, not as the broadcaster)→ Call the rename algorithm with the following arguments:
isForced
: false
currentUsername
, currentDisplayName
, and currentUserId
: the respectively values of the user who put the command in chat
previousName
: null
or undefined
levels
: the levels list concatenated with the current level
!rename [previousName]
(manual rename, not as the broadcaster)→ Call the rename algorithm with the following arguments:
isForced
: false
currentUsername
, currentDisplayName
, and currentUserId
: the respectively values of the user who put the command in chat
previousName
: the previousName argument
levels
: the levels list concatenated with the current level
!rename [name]
(automatic rename as the broadcaster)→ Call the rename algorithm with the following arguments:
isForced
: true
currentUsername
, currentDisplayName
, and currentUserId
: find those values in the current_chatters
list by matching the name argument with currentUsername
or currentDisplayName
, ignoring an optional leading '@' in name
previousName
: null
or undefined
levels
: the levels list concatenated with the current level
!rename [fromName] [toName]
(manual rename as the broadcaster)→ Call the rename algorithm with the following arguments:
isForced
: true
currentUsername
, currentDisplayName
, and currentUserId
: find those values in the current_chatters
list by matching the toName argument with currentUsername
or currentDisplayName
, ignoring an optional leading '@' in toName
previousName
: the fromName argument
levels
: the levels list concatenated with the current level
Important note: People can not just rename other people and they can not rename themselves to just anyone. Only the broadcaster could change someones name to something that is not their actual username.
Settings for this feature could be of interest, enabling: fully automatic rename, enabling the automatic rename commands (which still would need to be manually invoked), or enabling the manual rename commands, etc.
A
!rename
command might be practical if the queue is not cleared between streams. A user's username or display name (or both) could change and that may lead to some issues.