InternalThe config object for configuring the Rettiwt instance.
Get the full conversation history for a specific conversation, ordered recent to oldest. Use this to load complete message history for a conversation identified from the inbox.
The ID of the conversation (e.g., "394028042:1645287614").
OptionalcursorOrOptions: string | IDMConversationOptionsEither the oldest event ID from the previous page or decoding options for this call.
Optionaloptions: IDMConversationOptionsDecoding options when a pagination cursor is supplied as the second argument.
The conversation with full message history, or undefined if not found.
import { Rettiwt } from 'rettiwt-api';
// Creating a new Rettiwt instance using the given 'API_KEY'
const rettiwt = new Rettiwt({ apiKey: API_KEY });
// Fetching a specific conversation
rettiwt.dm.conversation('394028042:1645287614')
.then(conversation => {
if (conversation) {
console.log(`Conversation with ${conversation.participants.length} participants`);
console.log(`${conversation.messages.length} messages loaded`);
}
})
.catch(err => {
console.log(err);
});
Delete a conversation. You will leave the conversation and it will be removed from your inbox.
The ID of the conversation to delete.
A promise that resolves when the conversation is deleted.
import { Rettiwt } from 'rettiwt-api';
// Creating a new Rettiwt instance using the given 'API_KEY'
const rettiwt = new Rettiwt({ apiKey: API_KEY });
// Deleting a conversation
rettiwt.dm.deleteConversation('394028042-1712730991884689408')
.then(() => {
console.log('Conversation deleted successfully');
})
.catch(err => {
console.log('Failed to delete conversation:', err);
});
Get your inbox, ordered recent to oldest.
Optionalcursor: stringThe cursor to the inbox items to fetch. Is equal to the ID of the last inbox conversation.
The required inbox. Returns initial inbox if no cursor is provided.
import { Rettiwt } from 'rettiwt-api';
// Creating a new Rettiwt instance using the given 'API_KEY'
const rettiwt = new Rettiwt({ apiKey: API_KEY });
// Fetching the initial DM inbox state
rettiwt.dm.inbox()
.then(inbox => {
console.log(`Found ${inbox.conversations.length} conversations`);
console.log('First conversation:', inbox.conversations[0]);
})
.catch(err => {
console.log(err);
});
Permanently clear the internally recovered keys and disable automatic XChat decryption.
Makes an HTTP request according to the given parameters.
The requested resource.
The args to be used for the request.
The raw Axios response.
import { FetcherService, ResourceType } from 'rettiwt-api';
// Creating a new FetcherService instance using the given 'API_KEY'
const fetcher = new FetcherService({ apiKey: API_KEY });
// Fetching the details of the User with username 'user1'
fetcher.request(ResourceType.USER_DETAILS_BY_USERNAME, { id: 'user1' })
.then(res => {
console.log(res);
})
.catch(err => {
console.log(err);
});
Recover this account's XChat identity with its existing chat PIN.
The account's existing XChat PIN as text or UTF-8 bytes.
Handles interacting with resources related to direct messages