Skip to content
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,38 @@ By selecting quick replies instead of typing manually, agents/users can respond

- **`/quick`**: Get started with Quick Reply
- **`/quick create`**: Create a new quick reply
- **`/quick create "<name>" <message>`**: Create a quick reply directly from the message box with a name and message
- **`/quick list`**: List all your quick replies
- **`/quick config`**: Configure your language preferences and AI settings
- **`/quick ai`**: Use AI to generate replies
- **`/quick help`**: Get help with Quick Reply
- **`/qs <reply name>`**: Quickly search and send a reply by name

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add SS

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add SS man why you are not making requested changes before asking for review.


#### Creating Quick Replies from Message Box
**`/quick create "<name>" <message>`**: Create a quick reply using the message box

When you use this command:
1. A modal window opens automatically
2. The name and replybody field is prefilled with your specified values
3. Simply review and click the Submit button to save your quick reply

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not what I meant.

Can you please avoid writing a lot in the README to explain really simple things?

The command works as follows:
- The name must be enclosed in quotes `"..."` if it contains multiple words
- Everything after the name is treated as the message body
- Without quotes, only the first word would be taken as the name

#### Examples:
```sh
# Single word name (quotes optional)
/quick create greeting Hello! How have you been?

# Multi-word name (quotes required)
/quick create "welcome message" Welcome to our channel! How can I help you?
```

Both examples will open a modal with the name and message already filled in. Just click Submit to save your quick reply, which can then be used with **`/qs <name>`**.

Comment on lines +97 to +107

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is just to much for such simple thing

and can't we just do like

/quick create "you can use double quotes to write the name with spaces" you write everything else as a body ??

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this just looks like AI-generated markdown to me

### Using Placeholders:

When creating or configuring a reply, you can use placeholders like `[name]`, `[username]`, and `[email]` in the reply content. These placeholders will automatically be replaced based on the recipient's information when the message is sent.
Expand Down
9 changes: 9 additions & 0 deletions src/commands/CommandUtility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,17 @@ export class CommandUtility implements ICommandUtility {
triggerId: this.triggerId,
threadId: this.threadId,
language,
params: this.params,
});

if(this.params.length && this.params.length > 1){
const subCommand = this.params[0].toLowerCase();
if(subCommand === CommandParam.CREATE){
await this.handleSingleParam(handler)
return;
}
}

switch (this.params.length) {
case 0: {
await handler.sendDefault();
Expand Down
1 change: 1 addition & 0 deletions src/definition/handlers/IHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ export interface IHandler extends Omit<ICommandUtilityParams, 'params'> {

export type IHanderParams = Omit<ICommandUtilityParams, 'params'> & {
language: Language;
params?: string[];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why optinal?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not answered ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again not answered?

};
8 changes: 7 additions & 1 deletion src/handlers/Handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class Handler implements IHandler {
public triggerId?: string;
public threadId?: string;
public language: Language;
public params?: string[];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stilll ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

man ?


constructor(params: IHanderParams) {
this.app = params.app;
Expand All @@ -47,6 +48,8 @@ export class Handler implements IHandler {
this.triggerId = params.triggerId;
this.threadId = params.threadId;
this.language = params.language;
this.params = params.params;

const persistenceRead = params.read.getPersistenceReader();
this.roomInteractionStorage = new RoomInteractionStorage(
params.persis,
Expand All @@ -56,6 +59,8 @@ export class Handler implements IHandler {
}

public async CreateReply(): Promise<void> {
const initialReplyName = this.params?.[1];
const initialReplyBody = this.params?.slice(2).join(' ');
const modal = await CreateReplyModal(
this.app,
this.sender,
Expand All @@ -64,13 +69,14 @@ export class Handler implements IHandler {
this.modify,
this.room,
this.language,
initialReplyName,
initialReplyBody,
);

if (modal instanceof Error) {
this.app.getLogger().error(modal.message);
return;
}

const triggerId = this.triggerId;

if (triggerId) {
Expand Down
1 change: 1 addition & 0 deletions src/modal/common/inputElementComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function inputElementComponent(
text: label,
element: plainTextInputElement,
optional,
blockId,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

});

return plainTextInputBlock;
Expand Down
7 changes: 6 additions & 1 deletion src/modal/createModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export async function CreateReplyModal(
modify: IModify,
room: IRoom,
language: Language,
initialReplyName?: string,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i said already we can make a new type for this or interface

initialReplyBody?: string,
): Promise<IUIKitSurfaceViewParam | Error> {

const { elementBuilder, blockBuilder } = app.getUtils();

const blocks: InputBlock[] = [];
Expand All @@ -39,6 +42,7 @@ export async function CreateReplyModal(
placeholder: placeholderReplyName,
label: labelReplyName,
optional: false,
initialValue: initialReplyName,
},
{
blockId: CreateModalEnum.REPLY_NAME_BLOCK_ID,
Expand All @@ -56,6 +60,7 @@ export async function CreateReplyModal(
label: labelReplyBody,
optional: false,
multiline: true,
initialValue: initialReplyBody,
},
{
blockId: CreateModalEnum.REPLY_BODY_BLOCK_ID,
Expand Down Expand Up @@ -91,4 +96,4 @@ export async function CreateReplyModal(
close,
submit,
};
}
}