server/plugins/test.plugin.ts

13 lines
388 B
TypeScript
Raw Permalink Normal View History

import type { Server } from "./types";
import { HookTypes } from "./types";
2023-11-22 07:13:09 +01:00
const registerPlugin = (server: Server) => {
server.on(HookTypes.OnPostCreate, (req, newPost, author) => {
console.log("New post created!");
console.log(`Post details: ${newPost.content} (${newPost.id})`);
console.log(`Made by ${author.username} (${author.id})`);
});
};
export default registerPlugin;