Send API KEY as DM

This commit is contained in:
dlinux-host 2025-01-20 17:14:30 -05:00
parent 31fa431cef
commit 7bf95e6fee

View File

@ -393,8 +393,14 @@ try {
// //
case "new-api-key": { case "new-api-key": {
const newKeyResponse = await makeApiRequest("/new-key", token, client); const newKeyResponse = await makeApiRequest("/new-key", token, client);
const reply = `New API Key: ${newKeyResponse.newAPIKey}`; try {
await ts3.sendTextMessage(event.target, targetmode, `${senderNickname}, ${reply}`); // Send a private message to the user to request the token
await client.message(
`New API Key: ${newKeyResponse.newAPIKey}`
);
} catch (error) {
console.error(`Failed to send DM to ${client.nickname}:`, error);
}
break; break;
} }