@stripchatdev/ext-helper 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +36 -1
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -100,6 +100,18 @@ export declare type TV1ActionResult = {
100
100
  code: number;
101
101
  };
102
102
 
103
+ declare type TV1ChatEvents = {
104
+ /** Triggered on every new message in chat */
105
+ 'v1.chat.message.received': {
106
+ /** Text of the message */
107
+ messageText: string;
108
+ /** User who sent the message **/
109
+ sender: TV1ExtUser;
110
+ /** Whether message was sent in public or private chat **/
111
+ type: 'private' | 'public';
112
+ };
113
+ };
114
+
103
115
  declare type TV1ChatMethods = {
104
116
  'v1.chat.message.send': {
105
117
  params: {
@@ -109,9 +121,32 @@ declare type TV1ChatMethods = {
109
121
  };
110
122
  result: null;
111
123
  };
124
+ /** Use this method to send a message in the chat as a bot or model
125
+ * The message is sent locally to each user.
126
+ * */
127
+ 'v1.chatbot.message.send': {
128
+ params: {
129
+ /** Sender of the message.
130
+ * If `bot`, the message will be sent with the name of the extension
131
+ * If `model`, the message will be sent with the name of the current model
132
+ * */
133
+ from: 'bot' | 'model';
134
+ /** Text of the message.
135
+ *
136
+ *
137
+ * The message can contain {username} placeholder, which will be replaced with the name of the user receiving the message.
138
+ * If the user is anonymous, the placeholder will be replaced with empty string.
139
+ * If the user is guest, the placeholder will be replaced with "Guest".
140
+ *
141
+ * Example usage: "Hello, {username}! Welcome to the chat!"
142
+ * */
143
+ message: string;
144
+ };
145
+ result: null;
146
+ };
112
147
  };
113
148
 
114
- export declare type TV1Events = TV1ExtEvents & TV1PaymentEvents & TV1ModelEvents & TV1TipEvents;
149
+ export declare type TV1Events = TV1ExtEvents & TV1PaymentEvents & TV1ModelEvents & TV1TipEvents & TV1ChatEvents;
115
150
 
116
151
  export declare type TV1ExtContext = {
117
152
  model?: TV1ExtModel;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stripchatdev/ext-helper",
3
3
  "private": false,
4
- "version": "0.1.13",
4
+ "version": "0.1.14",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "module": "./dist/ext-helper.js",