Skip to content

Commit

Permalink
fix: fix /set message encounter error
Browse files Browse the repository at this point in the history
  • Loading branch information
adolphnov committed Jul 29, 2024
1 parent 4cb7c41 commit 11e0c3a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/buildinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"sha": "e0baa51", "timestamp": 1722257700}
{"sha": "4cb7c41", "timestamp": 1722259800}
10 changes: 6 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ var Environment = class {
// -- 版本数据 --
//
// 当前版本
BUILD_TIMESTAMP = 1722257700;
BUILD_TIMESTAMP = 1722259800;
// 当前版本 commit id
BUILD_VERSION = "e0baa51";
BUILD_VERSION = "4cb7c41";
// -- 基础配置 --
/**
* @type {I18n | null}
Expand Down Expand Up @@ -302,7 +302,7 @@ var Environment = class {
// 快速修改变量:'model:':'/setenv OPENAI_CHAT_MODEL=' 'pro:':'/setenv AI_PROVIDER='
PROMPT = prompt_default;
// /set 指令映射变量 | 分隔多个关系,:分隔映射
MAPPING_KEY = "-p:SYSTEM_INIT_MESSAGE|-n:MAX_HISTORY_LENGTH|-a:AI_PROVIDER|-ai:AI_IMAGE_PROVIDER|-om:OPENAI_CHAT_MODEL|-v:OPENAI_VISION_MODEL|-t :OPENAI_TTS_MODEL";
MAPPING_KEY = "-p:SYSTEM_INIT_MESSAGE|-n:MAX_HISTORY_LENGTH|-a:AI_PROVIDER|-ai:AI_IMAGE_PROVIDER|-m:CHAT_MODEL|-v:OPENAI_VISION_MODEL|-t :OPENAI_TTS_MODEL";
// /set 指令映射值 | 分隔多个关系,:分隔映射
MAPPING_VALUE = "";
// MAPPING_VALUE = "c35son:claude-3-5-sonnet-20240620|haiku:claude-3-haiku-20240307|g4m:gpt-4o-mini|g4:gpt-4o|rp+:command-r-plus";
Expand Down Expand Up @@ -2640,8 +2640,10 @@ async function handleCommandMessage(message, context) {
try {
const result = await command.fn(message, key, subcommand, context);
console.log("[DONE] Command: " + key + " " + subcommand);
if (message.text.length === 0 || result instanceof Response)
if (result instanceof Response)
return result;
if (message.text.length === 0)
return new Response("None question");
} catch (e) {
return sendMessageToTelegramWithContext(context)(e.message);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1722257700
1722259800
2 changes: 1 addition & 1 deletion src/config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class Environment {
// 快速修改变量:'model:':'/setenv OPENAI_CHAT_MODEL=' 'pro:':'/setenv AI_PROVIDER='
PROMPT = PROMPT;
// /set 指令映射变量 | 分隔多个关系,:分隔映射
MAPPING_KEY = '-p:SYSTEM_INIT_MESSAGE|-n:MAX_HISTORY_LENGTH|-a:AI_PROVIDER|-ai:AI_IMAGE_PROVIDER|-om:OPENAI_CHAT_MODEL|-v:OPENAI_VISION_MODEL|-t :OPENAI_TTS_MODEL';
MAPPING_KEY = '-p:SYSTEM_INIT_MESSAGE|-n:MAX_HISTORY_LENGTH|-a:AI_PROVIDER|-ai:AI_IMAGE_PROVIDER|-m:CHAT_MODEL|-v:OPENAI_VISION_MODEL|-t :OPENAI_TTS_MODEL';
// /set 指令映射值 | 分隔多个关系,:分隔映射
MAPPING_VALUE = "";
// MAPPING_VALUE = "c35son:claude-3-5-sonnet-20240620|haiku:claude-3-haiku-20240307|g4m:gpt-4o-mini|g4:gpt-4o|rp+:command-r-plus";
Expand Down
3 changes: 2 additions & 1 deletion src/telegram/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,8 @@ export async function handleCommandMessage(message, context) {
try {
const result = await command.fn(message, key, subcommand, context);
console.log('[DONE] Command: ' + key + ' ' + subcommand);
if (message.text.length === 0 || result instanceof Response) return result;
if (result instanceof Response) return result;
if (message.text.length === 0) return new Response('None question');
} catch (e) {
return sendMessageToTelegramWithContext(context)(e.message);
}
Expand Down

0 comments on commit 11e0c3a

Please sign in to comment.