mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
13 lines
412 B
TypeScript
13 lines
412 B
TypeScript
import type { Server } from "./types";
|
|
import { HookTypes } from "./types";
|
|
|
|
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;
|