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
|
|
|
});
|