ASd
This commit is contained in:
parent
8d43d73d24
commit
2ddde85fca
14
index.js
14
index.js
|
@ -1070,16 +1070,20 @@ dcClient.on('interactionCreate', async interaction => {
|
||||||
// switch subcommand
|
// switch subcommand
|
||||||
switch (interaction.options.getSubcommand()) {
|
switch (interaction.options.getSubcommand()) {
|
||||||
case "silence": // SSH run `asterisk -x "channel request hangup all"
|
case "silence": // SSH run `asterisk -x "channel request hangup all"
|
||||||
await interaction.deferReply({
|
|
||||||
ephemeral: true
|
|
||||||
});
|
|
||||||
sshConn.exec("asterisk -x 'channel request hangup all'", (err, stream) => {
|
sshConn.exec("asterisk -x 'channel request hangup all'", (err, stream) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
interaction.editReply(`Error killing calls: ${err}`);
|
interaction.reply({
|
||||||
|
content: `Error killing calls: ${err}`,
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
sendLog(`${colors.red("[ERROR]")} ${err}`);
|
sendLog(`${colors.red("[ERROR]")} ${err}`);
|
||||||
}
|
}
|
||||||
stream.on("exit", (code) => {
|
stream.on("exit", (code) => {
|
||||||
interaction.editReply("Killed all calls!");
|
interaction.editReply({
|
||||||
|
content: "Killed all calls!",
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
sendLog(`${colors.green("[INFO]")} Silenced all channels`);
|
sendLog(`${colors.green("[INFO]")} Silenced all channels`);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue