| 1968 | 1968 | SlashCommandParser.addCommandObject(SlashCommand.fromProps({ |
| 1969 | 1969 | name: 'chat-render', |
| 1970 | 1970 | helpString: 'Renders a specified number of messages into the chat window. Displays all messages if no argument is provided.', |
| 1971 | 1971 | callback: (_args, number) => { |
| 1972 | 1972 | showMoreMessages(number && !isNaN(Number(number)) ? Number(number) : Number.MAX_SAFE_INTEGER); |
| 1973 | + if (isTrueBoolean(String(args?.scroll ?? ''))) { |
| 1974 | + $('#chat').scrollTop(0); |
| 1975 | + } |
| 1973 | 1976 | return ''; |
| 1974 | 1977 | }, |
| 1978 | + namedArgumentList: [ |
| 1979 | + SlashCommandNamedArgument.fromProps({ |
| 1980 | + name: 'scroll', |
| 1981 | + description: 'scroll to the top after rendering', |
| 1982 | + typeList: [ARGUMENT_TYPE.BOOLEAN], |
| 1983 | + defaultValue: 'false', |
| 1984 | + enumList: commonEnumProviders.boolean('trueFalse')(), |
| 1985 | + }), |
| 1986 | + ], |
| 1975 | 1987 | unnamedArgumentList: [ |
| 1976 | 1988 | new SlashCommandArgument( |
| 1977 | 1989 | 'number of messages', [ARGUMENT_TYPE.NUMBER], false, |