mirror of
https://github.com/SEPPDROID/zoizbot.git
synced 2025-10-24 17:04:22 +00:00
Icing on the cake! My main example is done. - Update app.js, bootscreen.js, and 9 more files...
This commit is contained in:
@@ -22,19 +22,10 @@ eval(fs.readFileSync('./commandhandler.js') + '');
|
|||||||
|
|
||||||
console.log(` commandhandler loaded!`)
|
console.log(` commandhandler loaded!`)
|
||||||
console.log(" ==============================================");
|
console.log(" ==============================================");
|
||||||
|
console.log(" ")
|
||||||
console.log(` loading command-files...`)
|
console.log(` loading command-files...`)
|
||||||
|
console.log(" ")
|
||||||
|
|
||||||
fs.readdir(`./commands/`, (err, files) => {
|
eval(fs.readFileSync('./commandloader.js') + ''); // Loading from command folders. easy mode :)
|
||||||
if (err) return console.error(err);
|
|
||||||
files.forEach(file => {
|
|
||||||
if (!file.endsWith(".js")) return; // only load js files. no garbage collection
|
|
||||||
let props = require(`./commands/${file}`); // get the command name from the file.js
|
|
||||||
let commandName = file.split(".")[0];
|
|
||||||
console.log(`attempting to load command ${commandName}`); // adding everything to the collection
|
|
||||||
zoizbot.commands.set(commandName, props);
|
|
||||||
});
|
|
||||||
console.log(`all commands loaded!`);
|
|
||||||
console.log("==============================================");
|
|
||||||
});
|
|
||||||
|
|
||||||
zoizbot.login(config.token).catch(console.error); //reading the "token" from the const config = conf.json btw the one you see is invalid now
|
zoizbot.login(config.token).catch(console.error); //reading the "token" from the const config = conf.json btw the one you see is invalid now
|
||||||
@@ -7,9 +7,9 @@ console.log(" .' .' .' / / |`--'_ .' .' .' ");
|
|||||||
console.log(" ,---, ' ./ . ; ,. : ,' ,'| ,---, ' ./ ");
|
console.log(" ,---, ' ./ . ; ,. : ,' ,'| ,---, ' ./ ");
|
||||||
console.log(" ; | .' / ' | |: : ' | | ; | .' / ");
|
console.log(" ; | .' / ' | |: : ' | | ; | .' / ");
|
||||||
console.log(" `---' / ;--,' | .; : | | : `---' / ;--, ");
|
console.log(" `---' / ;--,' | .; : | | : `---' / ;--, ");
|
||||||
console.log(" / / / .`|| : |' : |__ / / / .`| ");
|
console.log(" / / / .`|| : | ' : | / / / .`| ");
|
||||||
console.log("./__; .' \ \ / | | '.'|./__; .' ");
|
console.log(" ./__; .' \ \ / | | | /__; .' ");
|
||||||
console.log("; | .' `----' ; : ;; | .' ");
|
console.log(" ; | .' `----' ; : | ;; | .' ");
|
||||||
console.log("`---' | , / `---' ");
|
console.log(" `---' | , : `---' ");
|
||||||
console.log(" ---`-' ");
|
console.log(" ---` ");
|
||||||
console.log(" ==============================================");
|
console.log(" ==============================================");
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
zoizbot.on("ready", () => {
|
zoizbot.on("ready", () => {
|
||||||
zoizbot.user.setActivity(config.activity); // change this to whatever you want (in conf.json).
|
zoizbot.user.setActivity(config.activity); // change this to whatever you want (in conf.json).
|
||||||
console.log(`Zoizbot has started, and is serving ${zoizbot.users.cache.size} users, in ${zoizbot.guilds.cache.size} guilds.`); // you can display anything you want here, all the functions are available in de documentation from discord.js
|
console.log(` Zoizbot is listening, `); // you can display anything you want here, all the functions are available in de documentation from discord.js
|
||||||
|
console.log(` and is currently serving ${ zoizbot.users.cache.size } users, in ${ zoizbot.guilds.cache.size } guilds.`)
|
||||||
console.log(" ==================LISTENING===================");
|
console.log(" ==================LISTENING===================");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
69
zoizbot/commandloader.js
Normal file
69
zoizbot/commandloader.js
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
var loaded = 0
|
||||||
|
fs.readdir (`./commands/`, (err, files) => {
|
||||||
|
if (err) return console.error(err);
|
||||||
|
files.forEach(file => {
|
||||||
|
if (!file.endsWith(".js")) return; // only load js files. no garbage collection
|
||||||
|
let props = require(`./commands/${file}`); // get the command name from the file.js
|
||||||
|
let commandName = file.split(".")[0];
|
||||||
|
console.log(` attempting to load command: ${commandName}`); // adding everything to the collection
|
||||||
|
zoizbot.commands.set(commandName, props);
|
||||||
|
loaded++; // beginners trick to check if all the folder-commands where loaded // i really dont know what im doing here hahahaha
|
||||||
|
});
|
||||||
|
if (loaded == 4) { // this is the funniest shit i have ever done. pure for asthetics. please change this to a different way
|
||||||
|
console.log(" ")
|
||||||
|
console.log(` all commands loaded!`);
|
||||||
|
console.log(" ")
|
||||||
|
console.log(" ==============================================");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
fs.readdir (`./commands/fun/`, (err, files) => {
|
||||||
|
if (err) return console.error(err);
|
||||||
|
files.forEach(file => {
|
||||||
|
if (!file.endsWith(".js")) return;
|
||||||
|
let props = require(`./commands/fun/${file}`);
|
||||||
|
let commandName = file.split(".")[0];
|
||||||
|
console.log(` attempting to load command: ${commandName}`);
|
||||||
|
zoizbot.commands.set(commandName, props);
|
||||||
|
loaded++;
|
||||||
|
});
|
||||||
|
if (loaded == 4) {
|
||||||
|
console.log(" ")
|
||||||
|
console.log(` all commands loaded!`);
|
||||||
|
console.log(" ")
|
||||||
|
console.log(" ==============================================");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
fs.readdir(`./commands/general/`, (err, files) => {
|
||||||
|
if (err) return console.error(err);
|
||||||
|
files.forEach(file => {
|
||||||
|
if (!file.endsWith(".js")) return;
|
||||||
|
let props = require(`./commands/general/${file}`);
|
||||||
|
let commandName = file.split(".")[0];
|
||||||
|
console.log(` attempting to load command: ${commandName}`);
|
||||||
|
zoizbot.commands.set(commandName, props);
|
||||||
|
loaded++;
|
||||||
|
});
|
||||||
|
if (loaded == 4) {
|
||||||
|
console.log(" ")
|
||||||
|
console.log(` all commands loaded!`);
|
||||||
|
console.log(" ")
|
||||||
|
console.log(" ==============================================");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
fs.readdir(`./commands/moderation/`, (err, files) => { //copy paste for different folders works fine. dirty fix no.394 haha
|
||||||
|
if (err) return console.error(err);
|
||||||
|
files.forEach(file => {
|
||||||
|
if (!file.endsWith(".js")) return;
|
||||||
|
let props = require(`./commands/moderation/${file}`);
|
||||||
|
let commandName = file.split(".")[0];
|
||||||
|
console.log(` attempting to load command: ${commandName}`);
|
||||||
|
zoizbot.commands.set(commandName, props);
|
||||||
|
loaded++;
|
||||||
|
});
|
||||||
|
if (loaded == 4) {
|
||||||
|
console.log(" ")
|
||||||
|
console.log(` all commands loaded!`);
|
||||||
|
console.log(" ")
|
||||||
|
console.log(" ==============================================");
|
||||||
|
}
|
||||||
|
});
|
||||||
18
zoizbot/commands/moderation/kick.js
Normal file
18
zoizbot/commands/moderation/kick.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
exports.run = async (zoizbot, message, args) => {
|
||||||
|
if (!message.member.hasPermission("KICK_MEMBERS"))
|
||||||
|
return message.reply("Sorry, you don't have permissions to use this!");
|
||||||
|
|
||||||
|
let member = message.guild.member(message.mentions.users.first()) || message.mentions.members.first(args[0])
|
||||||
|
if (!member)
|
||||||
|
return message.reply("Please mention a valid member of this server");
|
||||||
|
if (!member.kickable)
|
||||||
|
return message.reply("I cannot kick this user! Do they have a higher role? Do I have kick permissions?");
|
||||||
|
|
||||||
|
let KickReason = args.slice(1).join(' '); // slicing the arguments
|
||||||
|
if (!KickReason) KickReason = "No reason provided";
|
||||||
|
|
||||||
|
|
||||||
|
await member.kick(KickReason)
|
||||||
|
.catch(error => message.reply(`Sorry ${message.author} I couldn't kick because of : ${error}`)); // now an adios moment
|
||||||
|
message.reply(`${member.user.tag} has been kicked by ${message.author.tag} because: ${KickReason}`);
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
"token": "",
|
"token": "",
|
||||||
"prefix": ">"
|
"prefix": ">",
|
||||||
|
"activity": "Ask me something with >"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,10 +42,16 @@
|
|||||||
<Content Include="commandhandler.js">
|
<Content Include="commandhandler.js">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="commands\hello.js">
|
<Content Include="commandloader.js">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="commands\ping.js">
|
<Content Include="commands\general\hello.js">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Content>
|
||||||
|
<Content Include="commands\general\ping.js">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Content>
|
||||||
|
<Content Include="commands\moderation\kick.js">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="commands\reload.js">
|
<Content Include="commands\reload.js">
|
||||||
@@ -57,6 +63,9 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="commands\" />
|
<Folder Include="commands\" />
|
||||||
|
<Folder Include="commands\general\" />
|
||||||
|
<Folder Include="commands\moderation\" />
|
||||||
|
<Folder Include="commands\fun\" />
|
||||||
<Folder Include="Legacy Commands\" />
|
<Folder Include="Legacy Commands\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- Do not delete the following Import Project. While this appears to do nothing it is a marker for setting TypeScript properties before our import that depends on them. -->
|
<!-- Do not delete the following Import Project. While this appears to do nothing it is a marker for setting TypeScript properties before our import that depends on them. -->
|
||||||
|
|||||||
Reference in New Issue
Block a user