mirror of
https://github.com/matrixgpt/matrix-chatgpt-bot.git
synced 2024-09-28 20:15:56 +00:00
Add MATRIX_WELCOME so notice can be turned off
This commit is contained in:
parent
cb028c27bf
commit
c7a9556e18
@ -19,6 +19,7 @@ export const {
|
||||
MATRIX_THREADS,
|
||||
MATRIX_PREFIX_DM,
|
||||
MATRIX_RICH_TEXT,
|
||||
MATRIX_WELCOME,
|
||||
/** Matrix Access Control */
|
||||
MATRIX_BLACKLIST,
|
||||
MATRIX_WHITELIST,
|
||||
@ -48,6 +49,7 @@ export const {
|
||||
MATRIX_THREADS: { schema: z.boolean().default(true), description: "Set to true if you want the bot to answer always in a new thread/conversation" },
|
||||
MATRIX_PREFIX_DM: { schema: z.boolean().default(false), description: "Set to false if you want the bot to answer to all messages in a one-to-one room" },
|
||||
MATRIX_RICH_TEXT: { schema: z.boolean().default(true), description: "Set to true if you want the bot to answer with enriched text" },
|
||||
MATRIX_WELCOME: { schema: z.boolean().default(true), description: "Set to true if you want the bot to post a message when it joins a new chat." },
|
||||
/** Matrix Access Control */
|
||||
MATRIX_BLACKLIST: { schema: z.string().optional(), description: "Set to a spaces separated string of 'user:homeserver' or a wildcard like ':anotherhomeserver.example' to blacklist users or domains" },
|
||||
MATRIX_WHITELIST: { schema: z.string().optional(), description: "Set to a spaces separated string of 'user:homeserver' or a wildcard like ':anotherhomeserver.example' to whitelist users or domains" },
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
} from "matrix-bot-sdk";
|
||||
|
||||
import * as path from "path";
|
||||
import { DATA_PATH, KEYV_URL, OPENAI_API_KEY, MATRIX_HOMESERVER_URL, MATRIX_ACCESS_TOKEN, MATRIX_AUTOJOIN, MATRIX_BOT_PASSWORD, MATRIX_BOT_USERNAME, MATRIX_ENCRYPTION, MATRIX_THREADS, CHATGPT_CONTEXT, CHATGPT_MODEL, KEYV_BOT_STORAGE, KEYV_BACKEND, CHATGPT_PROMPT_PREFIX } from './env.js'
|
||||
import { DATA_PATH, KEYV_URL, OPENAI_API_KEY, MATRIX_HOMESERVER_URL, MATRIX_ACCESS_TOKEN, MATRIX_AUTOJOIN, MATRIX_BOT_PASSWORD, MATRIX_BOT_USERNAME, MATRIX_ENCRYPTION, MATRIX_THREADS, CHATGPT_CONTEXT, CHATGPT_MODEL, KEYV_BOT_STORAGE, KEYV_BACKEND, CHATGPT_PROMPT_PREFIX, MATRIX_WELCOME } from './env.js'
|
||||
import CommandHandler from "./handlers.js"
|
||||
import { KeyvStorageProvider } from './storage.js'
|
||||
import { parseMatrixUsernamePretty, wrapPrompt } from './utils.js';
|
||||
@ -70,10 +70,12 @@ async function main() {
|
||||
|
||||
client.on("room.join", async (roomId: string, _event: any) => {
|
||||
LogService.info("index", `Bot joined room ${roomId}`);
|
||||
if(MATRIX_WELCOME) {
|
||||
await client.sendMessage(roomId, {
|
||||
"msgtype": "m.notice",
|
||||
"body": `👋 Hello, I'm ChatGPT bot! Matrix E2EE: ${MATRIX_ENCRYPTION}`,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Prepare the command handler
|
||||
|
Loading…
Reference in New Issue
Block a user