mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
To export chat messages, go to `/admin/plugins/chat` and click the Create export button in the _Export chat messages_ section. You'll receive a direct message when the export is finished. Currently, this exports all messages from the last 6 months, but not more than 10000 messages. This exports all chat messages, including messages from private channels and users' direct conversations. This also exports messages that were deleted.
20 lines
386 B
JavaScript
20 lines
386 B
JavaScript
import Service from "@ember/service";
|
|
import { ajax } from "discourse/lib/ajax";
|
|
|
|
export default class ChatAdminApi extends Service {
|
|
async exportMessages() {
|
|
await this.#post(`/export/messages`);
|
|
}
|
|
|
|
get #basePath() {
|
|
return "/chat/admin";
|
|
}
|
|
|
|
#post(endpoint, data = {}) {
|
|
return ajax(`${this.#basePath}${endpoint}`, {
|
|
type: "POST",
|
|
data,
|
|
});
|
|
}
|
|
}
|