Send API KEY as DM
This commit is contained in:
parent
31fa431cef
commit
7bf95e6fee
10
teamspeak.js
10
teamspeak.js
@ -393,8 +393,14 @@ try {
|
||||
//
|
||||
case "new-api-key": {
|
||||
const newKeyResponse = await makeApiRequest("/new-key", token, client);
|
||||
const reply = `New API Key: ${newKeyResponse.newAPIKey}`;
|
||||
await ts3.sendTextMessage(event.target, targetmode, `${senderNickname}, ${reply}`);
|
||||
try {
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user