/popup: add scroll argument, allow scroll by default

This commit is contained in:
Cohee 2024-10-23 23:03:07 +03:00
parent e03f1b14e6
commit b5cdb29bf3
1 changed files with 8 additions and 0 deletions

View File

@ -1395,6 +1395,13 @@ export function initDefaultSlashCommands() {
callback: popupCallback,
returns: 'popup text',
namedArgumentList: [
SlashCommandNamedArgument.fromProps({
name: 'scroll',
description: 'allows vertical scrolling of the content',
typeList: [ARGUMENT_TYPE.BOOLEAN],
enumList: commonEnumProviders.boolean('trueFalse')(),
defaultValue: 'true',
}),
SlashCommandNamedArgument.fromProps({
name: 'large',
description: 'show large popup',
@ -2108,6 +2115,7 @@ async function popupCallback(args, value) {
/** @type {import('./popup.js').PopupOptions} */
const popupOptions = {
allowVerticalScrolling: !isFalseBoolean(args?.scroll),
large: isTrueBoolean(args?.large),
wide: isTrueBoolean(args?.wide),
wider: isTrueBoolean(args?.wider),