Update /caption mesId argument name

This commit is contained in:
Cohee 2024-09-13 20:28:19 +03:00
parent 73c14711e1
commit 084eebf610

View File

@ -358,10 +358,10 @@ function onRefineModeInput() {
*/ */
async function captionCommandCallback(args, prompt) { async function captionCommandCallback(args, prompt) {
const quiet = isTrueBoolean(args?.quiet); const quiet = isTrueBoolean(args?.quiet);
const id = args?.id; const mesId = args?.mesId ?? args?.id;
if (!isNaN(Number(id))) { if (!isNaN(Number(mesId))) {
const message = getContext().chat[id]; const message = getContext().chat[mesId];
if (message?.extra?.image) { if (message?.extra?.image) {
try { try {
const fetchResult = await fetch(message.extra.image); const fetchResult = await fetch(message.extra.image);
@ -546,7 +546,7 @@ jQuery(async function () {
'quiet', 'suppress sending a captioned message', [ARGUMENT_TYPE.BOOLEAN], false, false, 'false', 'quiet', 'suppress sending a captioned message', [ARGUMENT_TYPE.BOOLEAN], false, false, 'false',
), ),
SlashCommandNamedArgument.fromProps({ SlashCommandNamedArgument.fromProps({
name: 'id', name: 'mesId',
description: 'get image from a message with this ID', description: 'get image from a message with this ID',
typeList: [ARGUMENT_TYPE.NUMBER], typeList: [ARGUMENT_TYPE.NUMBER],
enumProvider: commonEnumProviders.messages(), enumProvider: commonEnumProviders.messages(),