Added npm run exec
Added docs for that to README.md
This commit is contained in:
parent
353a2e2013
commit
8dad8dc2ea
10
README.md
10
README.md
@ -6,7 +6,11 @@ Features:
|
|||||||
|
|
||||||
Every single part of code is commented to be understandable for others
|
Every single part of code is commented to be understandable for others
|
||||||
|
|
||||||
|
How to use:
|
||||||
|
- ```git clone https://git.squog.ru/entar/SquogAdmin.git```
|
||||||
|
- ```cd SquogAdmin```
|
||||||
|
- ```npm install```
|
||||||
|
- ```npm run exec```
|
||||||
|
|
||||||
|
###### Code is F2U, keep it OpenSource
|
||||||
Code is F2U, keep it OpenSource
|
###### Crediting me is optional but i'd prefer to be there.
|
||||||
- Crediting me is optional but i'd prefer to be there.
|
|
@ -10,7 +10,7 @@ const players = {}
|
|||||||
module.exports.commands = [
|
module.exports.commands = [
|
||||||
{
|
{
|
||||||
name: "play",
|
name: "play",
|
||||||
description: "Hello tested for now",
|
description: "Joins your VC and plays music by youtube link.",
|
||||||
arguments: ["link"], // If its not a OBJECT type you provide it like that lol.
|
arguments: ["link"], // If its not a OBJECT type you provide it like that lol.
|
||||||
run: async (ctx, link) => {
|
run: async (ctx, link) => {
|
||||||
// Getting the guild member to get their voice client
|
// Getting the guild member to get their voice client
|
||||||
|
11
index.js
11
index.js
@ -2,6 +2,8 @@
|
|||||||
const { Client, GatewayIntentBits, Events, ApplicationCommandPermissionType } = require("discord.js")
|
const { Client, GatewayIntentBits, Events, ApplicationCommandPermissionType } = require("discord.js")
|
||||||
const fs = require("fs")
|
const fs = require("fs")
|
||||||
const { type } = require("os")
|
const { type } = require("os")
|
||||||
|
const { parse } = require("path")
|
||||||
|
const types = require("util/types")
|
||||||
|
|
||||||
// TOKEN is stored in the .env file (node --env-file=.env index.js)
|
// TOKEN is stored in the .env file (node --env-file=.env index.js)
|
||||||
const token = process.env.TOKEN
|
const token = process.env.TOKEN
|
||||||
@ -15,8 +17,7 @@ const client = new Client({
|
|||||||
GatewayIntentBits.GuildVoiceStates,
|
GatewayIntentBits.GuildVoiceStates,
|
||||||
GatewayIntentBits.DirectMessages,
|
GatewayIntentBits.DirectMessages,
|
||||||
GatewayIntentBits.Guilds
|
GatewayIntentBits.Guilds
|
||||||
]
|
]}
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Exporting the client for event and command files to use it
|
// Exporting the client for event and command files to use it
|
||||||
@ -134,8 +135,12 @@ client.on("messageCreate", async (message) => {
|
|||||||
if (channel) {
|
if (channel) {
|
||||||
args[index] = channel
|
args[index] = channel
|
||||||
}
|
}
|
||||||
|
} else if (Number(arg)) {
|
||||||
|
args[index] = Number(arg)
|
||||||
|
} else if (Boolean(arg)) {
|
||||||
|
args[index] = Boolean(arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checks if the type is wrong
|
// Checks if the type is wrong
|
||||||
if (typeof args[index] != typeof realCommand.arguments[index] && !(args[index] instanceof realCommand.arguments[index])) {
|
if (typeof args[index] != typeof realCommand.arguments[index] && !(args[index] instanceof realCommand.arguments[index])) {
|
||||||
wrongArg = true // So it cant continue
|
wrongArg = true // So it cant continue
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node index.js"
|
"exec": "node --env-file=.env index.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discordjs/voice": "^0.18.0",
|
"@discordjs/voice": "^0.18.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user