This release introduces message replies.
Sending a text reply message
await kitty.sendMessage({
message: message,
body: 'Hello, world!',
});
if (result.succeeded) {
const message = result.message; // Handle message
}
if (result.failed) {
const error = result.error; // Handle error
}
Sending a file reply message
const result = await kitty.sendMessage({
message: message,
file: file,
progressListener: {
onStarted: () => {
// Handle file upload started
},
onProgress: (progress) => {
// Handle file upload process
},
onCompleted: (result) => {
// Handle file upload completed
},
},
});
if (result.succeeded) {
const message = result.message; // Handle message
}
if (result.failed) {
const error = result.error; // Handle error
}
Getting number of replies for a message
const result = await kitty.getMessageRepliesCount({ message: message });
if (result.succeeded) {
const count = result.count; // Handle replies count
}
if (result.failed) {
const error = result.error; // Handle error
}
Getting replies for a messages
const result = await kitty.getMessages({
message: message,
});
if (result.succeeded) {
const replies = result.paginator.items; // Handle replies
}
if (result.failed) {
const error = result.error; // Handle error
}
Retrieving only messages sent on a channel’s main thread (excluding replies)
const result = await kitty.getMessages({
channel: channel,
filter: { mainThread: true },
});
if (result.succeeded) {
const messages = result.paginator.items; // Handle messages
}
if (result.failed) {
const error = result.error; // Handle error
}