so many fixes

This commit is contained in:
Lio Young 2021-05-08 01:57:48 +02:00
parent 48f03092ef
commit 253579265a
No known key found for this signature in database
GPG Key ID: 789795A11879E169
12 changed files with 60 additions and 51 deletions

View File

@ -4,9 +4,9 @@
"description": "", "description": "",
"main": "build/shard.js", "main": "build/shard.js",
"scripts": { "scripts": {
"build": "tsc", "build": "rm -rf build/ && tsc",
"start": "node build/shard.js", "start": "node build/shard.js",
"dev": "nodemon --ignore \"./build\" -e js,ts --exec \"npm run build && npm run start\"", "dev": "nodemon --ignore \"build/\" -e js,ts --exec \"npm run build && npm run start\"",
"init": "npm run subs:init && npm run subs:update", "init": "npm run subs:init && npm run subs:update",
"subs:init": "git submodule init && git submodule update", "subs:init": "git submodule init && git submodule update",
"subs:update": "git submodule update --remote" "subs:update": "git submodule update --remote"

View File

@ -2,8 +2,8 @@ import yiff from '../../utils/yiff';
import Command from '../../handler/structures/Command'; import Command from '../../handler/structures/Command';
import { Context } from '../../utils/types'; import { Context } from '../../utils/types';
import { MessageEmbed } from 'discord.js'; import { MessageEmbed } from 'discord.js';
import lingua from './../../utils/lingua'; import lingua from '../../utils/lingua';
import replace from './../../utils/replace'; import replace from '../../utils/replace';
export = class Hug extends Command { export = class Hug extends Command {
constructor() { constructor() {

View File

@ -1,32 +0,0 @@
import Command from '../../handler/structures/Command';
import { Context } from '../../utils/types';
import lingua from '../../utils/lingua';
import { Folders, Commands } from "../../utils/command.amount";
import embed from '../../utils/embed';
export = class Help extends Command {
constructor() {
super({
name: "help",
aliases: ['?', 'h'],
description: "Get help with the Bot",
cooldown: 1,
})
}
// ? [ 'developer', 'general', 'images', 'misc', 'roleplay' ]
async command(ctx: Context) {
if (ctx.args.length === 0) {
embed.setTitle("Help")
await (await Folders()).forEach(async folder => {
if (!ctx.isDeveloper && folder === 'developer') return
// @ts-ignore
embed.addField(`${lingua[ctx.settings.locale].CATEGORIES[folder.toUpperCase()].name || folder} [\`${[...(await Commands(folder, ctx.client))].length}\`]`, `\`${ctx.config.variables.prefix[2]} help ${folder}\``, true)
})
return ctx.channel.send(embed)
}
ctx.channel.send(embed)
}
}

View File

@ -6,9 +6,8 @@ import config from '../../../config';
export = class Info extends Command { export = class Info extends Command {
constructor() { constructor() {
super({ super({
name: "info", name: "about",
description: "Show Information about the Bot", description: "Show Information about the Bot",
aliases: ["about"],
cooldown: 0 cooldown: 0
}) })
} }

View File

@ -1,7 +1,7 @@
import Command from '../../handler/structures/Command'; import Command from '../../handler/structures/Command';
import { Context, Usage } from '../../utils/types'; import { Context, Usage } from '../../utils/types';
import lingua from '../../utils/lingua'; import lingua from '../../utils/lingua';
import embed from '../../utils/embed'; import { MessageEmbed } from 'discord.js';
import CommandUsage from '../../utils/command.usage'; import CommandUsage from '../../utils/command.usage';
export = class Stats extends Command { export = class Stats extends Command {

View File

@ -2,7 +2,6 @@ import yiff from "../../utils/yiff"
import Command from "../../handler/structures/Command" import Command from "../../handler/structures/Command"
import { Context } from "../../utils/types"; import { Context } from "../../utils/types";
import { MessageEmbed } from "discord.js" import { MessageEmbed } from "discord.js"
import embed from "../../utils/embed";
import lingua from "../../utils/lingua"; import lingua from "../../utils/lingua";
export = class E926 extends Command { export = class E926 extends Command {
constructor() { constructor() {
@ -16,6 +15,7 @@ export = class E926 extends Command {
} }
async command(ctx: Context) { async command(ctx: Context) {
let embed = new MessageEmbed().setColor(ctx.config.variables.color).setFooter(`${ctx.config.variables.name}`, ctx.config.variables.avatar)
// @ts-ignore // @ts-ignore
if (ctx.args.length < 1) return ctx.channel.send(embed.setTitle(lingua[ctx.settings.locale].NOT_ENOUGH_TAGS).setDescription(lingua[ctx.settings.locale].NOT_ENOUGH_TAGS_DES)) if (ctx.args.length < 1) return ctx.channel.send(embed.setTitle(lingua[ctx.settings.locale].NOT_ENOUGH_TAGS).setDescription(lingua[ctx.settings.locale].NOT_ENOUGH_TAGS_DES))
let request = await yiff.e926(ctx.args.join(" ")) let request = await yiff.e926(ctx.args.join(" "))

43
src/modules/misc/help.ts Normal file
View File

@ -0,0 +1,43 @@
import Command from '../../handler/structures/Command';
import { Context } from '../../utils/types';
import lingua from '../../utils/lingua';
import { Folders, Commands } from "../../utils/command.amount";
import { MessageEmbed } from 'discord.js';
export = class Help extends Command {
constructor() {
super({
name: "help",
aliases: ['?', 'h'],
description: "Get help with the Bot",
cooldown: 1,
})
}
// ? [ 'developer', 'general', 'images', 'misc', 'roleplay' ]
async command(ctx: Context) {
let embed = new MessageEmbed().setColor(ctx.config.variables.color).setFooter(`${ctx.config.variables.name}`, ctx.config.variables.avatar)
if (ctx.args.length === 0) {
await (await Folders()).forEach(async folder => {
if (!ctx.isDeveloper && folder === 'developer') return
// @ts-ignore
return embed.addField(`${lingua[ctx.settings.locale].CATEGORIES[folder.toUpperCase()].name || folder} [\`${[...(await Commands(folder, ctx.client))].length}\`]`, `\`${ctx.config.variables.prefix[2]} help ${folder}\``, true)
})
embed.setTitle("Help")
return ctx.channel.send(embed)
}
let arg = ctx.args[0]
if (await (await Folders()).includes(arg)) {
let commands = await (await Commands(arg, ctx.client)).map(command => `\`${command.name}\` - ${command.description}`)
embed.addField("Commands", commands.join("\n"))
// @ts-ignore
embed.setTitle(`${lingua[ctx.settings.locale].CATEGORIES[arg.toUpperCase()].name || arg}`)
return ctx.channel.send(embed)
}
}
}

View File

@ -1,7 +1,6 @@
import Command from '../../handler/structures/Command'; import Command from '../../handler/structures/Command';
import { Context } from '../../utils/types'; import { Context } from '../../utils/types';
import lingua from '../../utils/lingua'; import lingua from '../../utils/lingua';
import embed from '../../utils/embed';
import replace from '../../utils/replace'; import replace from '../../utils/replace';
export = class Invite extends Command { export = class Invite extends Command {

View File

@ -2,29 +2,29 @@ import yiff from "../../utils/yiff"
import Command from "../../handler/structures/Command" import Command from "../../handler/structures/Command"
import { Context } from "../../utils/types"; import { Context } from "../../utils/types";
import { MessageEmbed } from "discord.js" import { MessageEmbed } from "discord.js"
import embed from "../../utils/embed";
import lingua from "../../utils/lingua"; import lingua from "../../utils/lingua";
export = class E621 extends Command { export = class E621 extends Command {
constructor() { constructor() {
super({ super({
name: "e926", name: "e621",
description: "Get an Image from E926", description: "Get an Image from E621",
aliases: ['e9', 'enine'], aliases: ['e6', 'esix'],
cooldown: 1 cooldown: 2
}) })
} }
async command(ctx: Context) { async command(ctx: Context) {
let embed = new MessageEmbed().setColor(ctx.config.variables.color).setFooter(`${ctx.config.variables.name}`, ctx.config.variables.avatar)
// @ts-ignore // @ts-ignore
if (ctx.args.length < 1) return ctx.channel.send(embed.setTitle(lingua[ctx.settings.locale].NOT_ENOUGH_TAGS).setDescription(lingua[ctx.settings.locale].NOT_ENOUGH_TAGS_DES)) if (ctx.args.length < 1) return ctx.channel.send(embed.setTitle(lingua[ctx.settings.locale].NOT_ENOUGH_TAGS).setDescription(lingua[ctx.settings.locale].NOT_ENOUGH_TAGS_DES))
let request = await yiff.e926(ctx.args.join(" ")) let request = await yiff.e621(ctx.args.join(" "))
if (ctx.settings.embeds) { if (ctx.settings.embeds) {
embed.setAuthor('e926.net', 'https://thaldrin.media/e621.png', `https://e926.net/post/${request[0].id}`) embed.setAuthor('e621.net', 'https://thaldrin.media/e621.png', `https://e621.net/post/${request[0].id}`)
.setImage(request[0].file.url) .setImage(request[0].file.url)
.setDescription(`[Link](https://e926.net/post/${request[0].id})`) .setDescription(`[Link](https://e621.net/post/${request[0].id})`)
ctx.channel.send(embed) ctx.channel.send(embed)
} else { } else {
ctx.channel.send(`<https://e926.net/post/${request[0].id}>\n\n${request[0].file.url}`) ctx.channel.send(`<https://e621.net/post/${request[0].id}>\n\n${request[0].file.url}`)
} }
} }

@ -1 +1 @@
Subproject commit c13845e8406bd862cdef290414a56044f17918fb Subproject commit 6ef3be5f4e4600ed920f3aed83393cbd9ec6533f