mirror of
https://github.com/matrixgpt/matrix-chatgpt-bot.git
synced 2024-09-30 13:05:50 +00:00
Merge pull request #60 from matrixgpt/match-timeouts
Update handlers.ts
This commit is contained in:
commit
799760e92a
@ -1,6 +1,6 @@
|
|||||||
import { ChatGPTAPIBrowser } from "chatgpt";
|
import { ChatGPTAPIBrowser } from "chatgpt";
|
||||||
import { LogService, MatrixClient, UserID } from "matrix-bot-sdk";
|
import { LogService, MatrixClient, UserID } from "matrix-bot-sdk";
|
||||||
import { MATRIX_DEFAULT_PREFIX_REPLY, MATRIX_DEFAULT_PREFIX, MATRIX_BLACKLIST, MATRIX_WHITELIST, MATRIX_RICH_TEXT, MATRIX_PREFIX_DM } from "./env.js";
|
import { CHATGPT_TIMEOUT, MATRIX_DEFAULT_PREFIX_REPLY, MATRIX_DEFAULT_PREFIX, MATRIX_BLACKLIST, MATRIX_WHITELIST, MATRIX_RICH_TEXT, MATRIX_PREFIX_DM } from "./env.js";
|
||||||
import { RelatesTo, MessageEvent, StoredConversation, StoredConversationConfig } from "./interfaces.js";
|
import { RelatesTo, MessageEvent, StoredConversation, StoredConversationConfig } from "./interfaces.js";
|
||||||
import { sendChatGPTMessage, sendError, sendThreadReply } from "./utils.js";
|
import { sendChatGPTMessage, sendError, sendThreadReply } from "./utils.js";
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ export default class CommandHandler {
|
|||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
this.client.sendReadReceipt(roomId, event.event_id),
|
this.client.sendReadReceipt(roomId, event.event_id),
|
||||||
this.client.setTyping(roomId, true, 10000)
|
this.client.setTyping(roomId, true, CHATGPT_TIMEOUT)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const bodyWithoutPrefix = this.getBodyWithoutPrefix(event, config, shouldBePrefixed);
|
const bodyWithoutPrefix = this.getBodyWithoutPrefix(event, config, shouldBePrefixed);
|
||||||
|
Loading…
Reference in New Issue
Block a user