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": {
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user