Send root pass as DM

This commit is contained in:
dlinux-host 2025-01-20 17:13:07 -05:00
parent 8734ca8a9f
commit 31fa431cef

View File

@ -377,8 +377,14 @@ try {
//
case "root-password": {
const rootPassResponse = await makeApiRequest("/rootpass", token, client);
const reply = `Root Password:\nNew Root Password: ${rootPassResponse.newRootPass}`;
await ts3.sendTextMessage(event.target, targetmode, `${senderNickname}, ${reply}`);
try {
// Send a private message to the user to request the token
await client.message(
`Root Password:\nNew Root Password: ${rootPassResponse.newRootPass}`
);
} catch (error) {
console.error(`Failed to send DM to ${client.nickname}:`, error);
}
break;
}