Fix execute on new chat not saving

This commit is contained in:
Cohee 2024-09-15 18:52:56 +03:00
parent 6393eda81e
commit cc2e82ce8f
2 changed files with 5 additions and 0 deletions

View File

@ -1904,6 +1904,7 @@ export class QuickReply {
executeOnAi: this.executeOnAi, executeOnAi: this.executeOnAi,
executeOnChatChange: this.executeOnChatChange, executeOnChatChange: this.executeOnChatChange,
executeOnGroupMemberDraft: this.executeOnGroupMemberDraft, executeOnGroupMemberDraft: this.executeOnGroupMemberDraft,
executeOnNewChat: this.executeOnNewChat,
automationId: this.automationId, automationId: this.automationId,
}; };
} }

View File

@ -35,6 +35,7 @@ export class SlashCommandHandler {
if (qr.executeOnUser) icons += enumIcons.user; if (qr.executeOnUser) icons += enumIcons.user;
if (qr.executeOnAi) icons += enumIcons.assistant; if (qr.executeOnAi) icons += enumIcons.assistant;
if (qr.executeOnChatChange) icons += '💬'; if (qr.executeOnChatChange) icons += '💬';
if (qr.executeOnNewChat) icons += '🆕';
if (qr.executeOnGroupMemberDraft) icons += enumIcons.group; if (qr.executeOnGroupMemberDraft) icons += enumIcons.group;
return icons; return icons;
} }
@ -265,6 +266,7 @@ export class SlashCommandHandler {
new SlashCommandNamedArgument('user', 'auto execute on user message, e.g., user=true', [ARGUMENT_TYPE.BOOLEAN], false, false, 'false'), new SlashCommandNamedArgument('user', 'auto execute on user message, e.g., user=true', [ARGUMENT_TYPE.BOOLEAN], false, false, 'false'),
new SlashCommandNamedArgument('bot', 'auto execute on AI message, e.g., bot=true', [ARGUMENT_TYPE.BOOLEAN], false, false, 'false'), new SlashCommandNamedArgument('bot', 'auto execute on AI message, e.g., bot=true', [ARGUMENT_TYPE.BOOLEAN], false, false, 'false'),
new SlashCommandNamedArgument('load', 'auto execute on chat load, e.g., load=true', [ARGUMENT_TYPE.BOOLEAN], false, false, 'false'), new SlashCommandNamedArgument('load', 'auto execute on chat load, e.g., load=true', [ARGUMENT_TYPE.BOOLEAN], false, false, 'false'),
new SlashCommandNamedArgument('new', 'auto execute on new chat, e.g., new=true', [ARGUMENT_TYPE.BOOLEAN], false, false, 'false'),
new SlashCommandNamedArgument('group', 'auto execute on group member selection, e.g., group=true', [ARGUMENT_TYPE.BOOLEAN], false, false, 'false'), new SlashCommandNamedArgument('group', 'auto execute on group member selection, e.g., group=true', [ARGUMENT_TYPE.BOOLEAN], false, false, 'false'),
new SlashCommandNamedArgument('title', 'title / tooltip to be shown on button, e.g., title="My Fancy Button"', [ARGUMENT_TYPE.STRING], false), new SlashCommandNamedArgument('title', 'title / tooltip to be shown on button, e.g., title="My Fancy Button"', [ARGUMENT_TYPE.STRING], false),
]; ];
@ -857,6 +859,7 @@ export class SlashCommandHandler {
executeOnUser: isTrueBoolean(args.user), executeOnUser: isTrueBoolean(args.user),
executeOnAi: isTrueBoolean(args.bot), executeOnAi: isTrueBoolean(args.bot),
executeOnChatChange: isTrueBoolean(args.load), executeOnChatChange: isTrueBoolean(args.load),
executeOnNewChat: isTrueBoolean(args.new),
executeOnGroupMemberDraft: isTrueBoolean(args.group), executeOnGroupMemberDraft: isTrueBoolean(args.group),
automationId: args.automationId ?? '', automationId: args.automationId ?? '',
}, },
@ -889,6 +892,7 @@ export class SlashCommandHandler {
executeOnAi: args.bot === undefined ? undefined : isTrueBoolean(args.bot), executeOnAi: args.bot === undefined ? undefined : isTrueBoolean(args.bot),
executeOnChatChange: args.load === undefined ? undefined : isTrueBoolean(args.load), executeOnChatChange: args.load === undefined ? undefined : isTrueBoolean(args.load),
executeOnGroupMemberDraft: args.group === undefined ? undefined : isTrueBoolean(args.group), executeOnGroupMemberDraft: args.group === undefined ? undefined : isTrueBoolean(args.group),
executeOnNewChat: args.new === undefined ? undefined : isTrueBoolean(args.new),
automationId: args.automationId ?? '', automationId: args.automationId ?? '',
}, },
); );