diff --git a/README.md b/README.md index 4707513..01d18c1 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,11 @@ Features: 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 -- Crediting me is optional but i'd prefer to be there. \ No newline at end of file +###### Code is F2U, keep it OpenSource +###### Crediting me is optional but i'd prefer to be there. \ No newline at end of file diff --git a/commands/voice.js b/commands/voice.js index 07a91fa..e56c0df 100644 --- a/commands/voice.js +++ b/commands/voice.js @@ -10,7 +10,7 @@ const players = {} module.exports.commands = [ { 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. run: async (ctx, link) => { // Getting the guild member to get their voice client diff --git a/index.js b/index.js index 4a4cb10..516f414 100644 --- a/index.js +++ b/index.js @@ -2,6 +2,8 @@ const { Client, GatewayIntentBits, Events, ApplicationCommandPermissionType } = require("discord.js") const fs = require("fs") 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) const token = process.env.TOKEN @@ -15,8 +17,7 @@ const client = new Client({ GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.DirectMessages, GatewayIntentBits.Guilds - ] - } + ]} ) // Exporting the client for event and command files to use it @@ -134,8 +135,12 @@ client.on("messageCreate", async (message) => { if (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 if (typeof args[index] != typeof realCommand.arguments[index] && !(args[index] instanceof realCommand.arguments[index])) { wrongArg = true // So it cant continue diff --git a/package.json b/package.json index 67b77f4..fe98002 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "type": "commonjs", "main": "index.js", "scripts": { - "test": "node index.js" + "exec": "node --env-file=.env index.js" }, "dependencies": { "@discordjs/voice": "^0.18.0",