Polarcraft/web/server/api/minecraft/message/chattominecraft.js
2023-05-06 13:09:46 +02:00

11 lines
333 B
JavaScript

export default defineEventHandler(async (event) => {
const { discordId, content } = await readBody(event);
const coll = db.collection('users');
const doc = await coll.findOne({ 'discord.id': discordId });
await sendRconCommand(`tellraw @a {"text":"(DC) ${doc.discord.username} > ${content}"}`)
return { whoo: 'hi' }
});