-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90ae489
commit 865eb72
Showing
14 changed files
with
3,607 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# PteroControl | ||
|
||
This opensource code is currently not recommended for production use as it is not in a stable state. The public bot inviteable [here](https://discord.gg/AMCTzrmRPY) and will receive updates and bug fixes prior to this source code to ensure stability. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
const { | ||
Message, | ||
Client, | ||
MessageEmbed | ||
} = require("discord.js"); | ||
const wait = require("util").promisify(setTimeout); | ||
|
||
module.exports = { | ||
name: "shutdown", | ||
aliases: ['sd'], | ||
permissions: ["ADMINISTRATOR"], | ||
/** | ||
* | ||
* @param {Client} client | ||
* @param {Message} message | ||
* @param {String[]} args | ||
*/ | ||
run: async (client, message, args) => { | ||
const ownerIDs = ['INSERT_OWNER_ID_HERE']; | ||
const shutdownembed = new MessageEmbed() | ||
.setTitle("Shutting down") | ||
.setDescription("Bye bye"); | ||
if (!ownerIDs.includes(message.author.id)) { | ||
|
||
return message.channel.reply({ | ||
content: 'You do not have enough permissions to use this command.', | ||
ephemeral: true, | ||
}); | ||
} | ||
|
||
try { | ||
message.channel.send({ | ||
embeds: [shutdownembed] | ||
}).then(msg => { | ||
msg.react('🆗'); | ||
message.delete() | ||
wait(5000) | ||
msg.delete() | ||
}).then(() => { | ||
wait(10000) | ||
client.destroy() | ||
process.exit() | ||
|
||
}); | ||
} catch (e) { | ||
console.log(e); | ||
} | ||
|
||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.