Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ESLint, improve code, and fix scripts #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"extends": "eslint:recommended",
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2021
},
"rules": {
"arrow-spacing": ["warn", { "before": true, "after": true }],
"brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": "error",
"comma-style": "error",
"curly": ["error", "multi-line", "consistent"],
"dot-location": ["error", "property"],
"handle-callback-err": "off",
"indent": ["error", "tab"],
"keyword-spacing": "error",
"max-nested-callbacks": ["error", { "max": 4 }],
"max-statements-per-line": ["error", { "max": 2 }],
"no-console": "off",
"no-floating-decimal": "error",
"no-lonely-if": "error",
"no-multi-spaces": "error",
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }],
"no-shadow": ["error", { "allow": ["err", "resolve", "reject"] }],
"no-trailing-spaces": ["error"],
"no-var": "error",
"object-curly-spacing": ["error", "always"],
"prefer-const": "error",
"semi": ["error", "always"],
"space-before-blocks": "error",
"space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}],
"space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": "error",
"yoda": "error"
}
}
16 changes: 7 additions & 9 deletions SlashCommands/info/ping.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
const { Client, CommandInteraction } = require("discord.js");

module.exports = {
name: "ping",
description: "returns websocket ping",
type: "CHAT_INPUT",
run: async (client, interaction, args) => {
interaction.followUp({ content: `${client.ws.ping}ms!` });
},
name: "ping",
description: "returns websocket ping",
type: "CHAT_INPUT",
run: async (client, interaction) => {
interaction.followUp({ content: `${client.ws.ping}ms!` });
},
};
/*
* ———————————————[Credits]———————————————
Expand All @@ -15,7 +13,7 @@ module.exports = {
* Youtube : youtube.com/DrakeZee
* Please Help Me Reach 1k Subs DJs Codes And More Amazing * Stuff!
* Also Add Me Friend When Using This, I Have No Friends :(
*
*
* This Was Only Possible By Following People :
*
* recon#8448 | youtube.com/reconlxx | discord.gg/recon
Expand Down
55 changes: 27 additions & 28 deletions command-format.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
const Discord = require("discord.js");
//Import Packages
// Import Packages

module.exports = {
name: "nameOfTheCommand",
//Name Of The Command
aliases: ["alias1", "alias2", "alias3"],
//Aliases For Command.
cooldowns: 1000, //1 second
//Cooldown For The Command [Milliseconds]
description: "This Command Tells About You",
//Description Of The Command [The Purpose Etc...]
usage: "<user>",
//Usage For Command. [like ?nameOfTheCommand <user> <reason>]
toggleOff: false,
//Disable The Command If Emergency. [true = off | false = on]
developersOnly: false,
//If Command Is Only For Bot Owners. [true = yes | false = no]
/*
To Make Yourself Developer, Go Ahead to
botconfig/main.json, set the ids in it.
name: "nameOfTheCommand",
// Name Of The Command
aliases: ["alias1", "alias2", "alias3"],
// Aliases For Command.
cooldowns: 1000, // 1 second
// Cooldown For The Command [Milliseconds]
description: "This Command Tells About You",
// Description Of The Command [The Purpose Etc...]
usage: "<user>",
// Usage For Command. [like ?nameOfTheCommand <user> <reason>]
toggleOff: false,
// Disable The Command If Emergency. [true = off | false = on]
developersOnly: false,
// If Command Is Only For Bot Owners. [true = yes | false = no]
/*
To Make Yourself Developer, Go Ahead to
botconfig/main.json, set the ids in it.
*/
userpermissions: ["SEND_MESSAGES", "VIEW_CHANNEL"],
//Permissions Required For The Author To Use The CMD.
botpermissions: ["ADMINISTRATOR"],
//Permissions Required For The Bot To Run The CMD.
userpermissions: ["SEND_MESSAGES", "VIEW_CHANNEL"],
// Permissions Required For The Author To Use The CMD.
botpermissions: ["ADMINISTRATOR"],
// Permissions Required For The Bot To Run The CMD.

run: async (client, message, args) => {
const member = message.mentions.members.first();
if (!member) return message.reply("Provide Some User To Tell About...");
run: async (client, message) => {
const member = message.mentions.members.first();
if (!member) return message.reply("Provide Some User To Tell About...");

message.reply(`About ${member}: \`He/She Looks Cool!\``);
},
message.reply(`About ${member}: \`He/She Looks Cool!\``);
},
};
21 changes: 11 additions & 10 deletions command-template.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/* eslint-disable no-unused-vars */
const Discord = require("discord.js");
module.exports = {
name: "",
aliases: ["", "", ""],
cooldowns: 3000,
description: "",
usage: "",
toggleOff: false,
developersOnly: false,
userpermissions: ["SEND_MESSAGES", "VIEW_CHANNEL"],
botpermissions: ["ADMINISTRATOR"],
name: "",
aliases: ["", "", ""],
cooldowns: 3000,
description: "",
usage: "",
toggleOff: false,
developersOnly: false,
userpermissions: ["SEND_MESSAGES", "VIEW_CHANNEL"],
botpermissions: ["ADMINISTRATOR"],

run: async (client, message, args) => {},
run: async (client, message, args) => {},
};
34 changes: 16 additions & 18 deletions commands/basic/ping.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
const Discord = require("discord.js");

module.exports = {
name: "ping",
aliases: ["p", "pong"],
description: "Returns Websocket Ping",
botpermissions: ["ADMINISTRATOR"],
usage: "How Fast The Bot is?",
cooldowns: 2000,
developersOnly: false,
toggleOff: false,
run: async (client, message, args) => {
message.channel.send(`Pinging...`).then((m4) => {
setTimeout(() => {
m4.edit(`\`${client.ws.ping}ms\` is my latency`);
}, 2000);
});
},
name: "ping",
aliases: ["p", "pong"],
description: "Returns Websocket Ping",
botpermissions: ["ADMINISTRATOR"],
usage: "How Fast The Bot is?",
cooldowns: 2000,
developersOnly: false,
toggleOff: false,
run: async (client, message) => {
message.channel.send(`Pinging...`).then((m4) => {
setTimeout(() => {
m4.edit(`\`${client.ws.ping}ms\` is my latency`);
}, 2000);
});
},
};
/*
* ———————————————[Credits]———————————————
Expand All @@ -24,7 +22,7 @@ module.exports = {
* Youtube : youtube.com/DrakeZee
* Please Help Me Reach 1k Subs DJs Codes And More Amazing * Stuff!
* Also Add Me Friend When Using This, I Have No Friends :(
*
*
* This Was Only Possible By Following People :
*
* recon#8448 | youtube.com/reconlxx | discord.gg/recon
Expand Down
Loading