Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Send Close Chat Message to Client #172

Merged
merged 9 commits into from
Oct 6, 2022
4 changes: 2 additions & 2 deletions enum/Dialogflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ export enum Message {

export enum CloseChatDescription {
CLOSED_BY_VISITOR = 'Closed by visitor',
CLOSED_BY_AGENT = 'Closed by agent',
CLOSED_BY_AGENT = 'Closed by agent bot',
Shailesh351 marked this conversation as resolved.
Show resolved Hide resolved
CUSTOMER_IDLE_TIMEOUT = 'Customer Timeout',
INVALID_TARGET_DEPARTMENT = 'Escalation failed due to invalid target department',
SAME_TARGET_DEPARTMENT = 'Escalation failed due to same target department',
LIVEAGENT_BOT_OFFLINE_OR_DISABLED = 'Escalation failed due to liveagent bot offline or disabled',
NETWORK_OR_APP_ERROR = 'Escalation failed due to network or app error',
NETWORK_OR_APP_ERROR = 'Escalation failed due to network or DF app error',
AGENT_UNASSIGNED = 'Agent is unassigned',
INVALID_EVENT_DATA = 'Invalid Dialogflow event data',
CLOSED_BY_API_ENDPOINT = 'Closed by incoming API/Endpoint',
Expand Down
5 changes: 2 additions & 3 deletions lib/Room.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IModify, IPersistence, IRead } from '@rocket.chat/apps-engine/definition/accessors';
import { IModify, IRead } from '@rocket.chat/apps-engine/definition/accessors';
import { IApp } from '@rocket.chat/apps-engine/definition/IApp';
import { IDepartment, ILivechatRoom, ILivechatTransferData, IVisitor } from '@rocket.chat/apps-engine/definition/livechat';
import { IButtonElement } from '@rocket.chat/apps-engine/definition/uikit';
Expand Down Expand Up @@ -74,8 +74,7 @@ export const updateRoomLogData = async (rid: string, data: IRoomCustomField, rea
}
};

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const closeChat = async (modify: IModify, read: IRead, rid: string, app: IApp, closeChatDesc?: string, _persistence?: IPersistence) => {
export const closeChat = async (modify: IModify, read: IRead, rid: string, app: IApp, closeChatDesc?: string) => {
const room: ILivechatRoom = (await read.getRoomReader().getById(rid)) as ILivechatRoom;
if (!room) {
throw new Error(Logs.INVALID_ROOM_ID);
Expand Down