Added npm run exec

Added docs for that to README.md
This commit is contained in:
entar 2025-05-23 19:35:25 +07:00
parent 353a2e2013
commit 8dad8dc2ea
4 changed files with 17 additions and 8 deletions

View File

@ -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.
###### Code is F2U, keep it OpenSource
###### Crediting me is optional but i'd prefer to be there.

View File

@ -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

View File

@ -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,6 +135,10 @@ 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

View File

@ -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",