Polarcraft/web/server/api/minecraft/message/chattominecraft.js

11 lines
340 B
JavaScript
Raw Normal View History

2023-05-06 13:09:46 +02:00
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}"}`)
2023-05-09 16:01:19 +02:00
return { status: 'success' }
2023-05-06 13:09:46 +02:00
});