mirror of https://github.com/thaldrin/thaldrin.git
add module-alias stuff
This commit is contained in:
parent
014e18f72a
commit
e134e65045
|
@ -23,7 +23,8 @@
|
||||||
"module-alias": "^2.2.2",
|
"module-alias": "^2.2.2",
|
||||||
"revolt-api": "^0.5.3-alpha.0-patch.0",
|
"revolt-api": "^0.5.3-alpha.0-patch.0",
|
||||||
"revolt.js": "^5.1.0-alpha.0-patch.0",
|
"revolt.js": "^5.1.0-alpha.0-patch.0",
|
||||||
"wavy": "^1.0.4"
|
"wavy": "^1.0.4",
|
||||||
|
"yiff": "^3.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/express": "^4.17.13",
|
"@types/express": "^4.17.13",
|
||||||
|
|
|
@ -14,6 +14,7 @@ specifiers:
|
||||||
revolt.js: ^5.1.0-alpha.0-patch.0
|
revolt.js: ^5.1.0-alpha.0-patch.0
|
||||||
typescript: ^4.4.3
|
typescript: ^4.4.3
|
||||||
wavy: ^1.0.4
|
wavy: ^1.0.4
|
||||||
|
yiff: ^3.1.2
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
'@thaldrin/sourcefinder': 1.0.3
|
'@thaldrin/sourcefinder': 1.0.3
|
||||||
|
@ -26,6 +27,7 @@ dependencies:
|
||||||
revolt-api: 0.5.3-alpha.0-patch.0
|
revolt-api: 0.5.3-alpha.0-patch.0
|
||||||
revolt.js: 5.1.0-alpha.0-patch.0_typescript@4.4.3
|
revolt.js: 5.1.0-alpha.0-patch.0_typescript@4.4.3
|
||||||
wavy: 1.0.4
|
wavy: 1.0.4
|
||||||
|
yiff: 3.1.2
|
||||||
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@types/express': 4.17.13
|
'@types/express': 4.17.13
|
||||||
|
@ -149,6 +151,13 @@ packages:
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/ansi-styles/4.3.0:
|
||||||
|
resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
|
||||||
|
engines: {node: '>=8'}
|
||||||
|
dependencies:
|
||||||
|
color-convert: 2.0.1
|
||||||
|
dev: false
|
||||||
|
|
||||||
/argparse/2.0.1:
|
/argparse/2.0.1:
|
||||||
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
|
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
|
||||||
dev: false
|
dev: false
|
||||||
|
@ -185,6 +194,25 @@ packages:
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/chalk/4.1.2:
|
||||||
|
resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
|
||||||
|
engines: {node: '>=10'}
|
||||||
|
dependencies:
|
||||||
|
ansi-styles: 4.3.0
|
||||||
|
supports-color: 7.2.0
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/color-convert/2.0.1:
|
||||||
|
resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
|
||||||
|
engines: {node: '>=7.0.0'}
|
||||||
|
dependencies:
|
||||||
|
color-name: 1.1.4
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/color-name/1.1.4:
|
||||||
|
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/combined-stream/1.0.8:
|
/combined-stream/1.0.8:
|
||||||
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
|
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
|
||||||
engines: {node: '>= 0.8'}
|
engines: {node: '>= 0.8'}
|
||||||
|
@ -291,6 +319,11 @@ packages:
|
||||||
resolution: {integrity: sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=}
|
resolution: {integrity: sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/has-flag/4.0.0:
|
||||||
|
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
|
||||||
|
engines: {node: '>=8'}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/is-obj/2.0.0:
|
/is-obj/2.0.0:
|
||||||
resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==}
|
resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==}
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
|
@ -450,6 +483,13 @@ packages:
|
||||||
ansi-regex: 5.0.0
|
ansi-regex: 5.0.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/supports-color/7.2.0:
|
||||||
|
resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
|
||||||
|
engines: {node: '>=8'}
|
||||||
|
dependencies:
|
||||||
|
has-flag: 4.0.0
|
||||||
|
dev: false
|
||||||
|
|
||||||
/through/2.3.8:
|
/through/2.3.8:
|
||||||
resolution: {integrity: sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=}
|
resolution: {integrity: sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=}
|
||||||
dev: false
|
dev: false
|
||||||
|
@ -536,3 +576,12 @@ packages:
|
||||||
utf-8-validate:
|
utf-8-validate:
|
||||||
optional: true
|
optional: true
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/yiff/3.1.2:
|
||||||
|
resolution: {integrity: sha512-F31hg2bGcLozNtw7vmD+LM/IRBNWreOzM/Fx1wIlaXOVKE8HS6iBaVw0dQROrFrcWpIftf1uVHrDe4GPWAPMDg==}
|
||||||
|
dependencies:
|
||||||
|
axios: 0.21.4
|
||||||
|
chalk: 4.1.2
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- debug
|
||||||
|
dev: false
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
import { Context } from "../../utils/types"
|
|
||||||
import { Command } from "../../modules/eu/src/index"
|
|
||||||
|
|
||||||
export = class TestingCommand extends Command {
|
|
||||||
constructor() {
|
|
||||||
super({
|
|
||||||
name: "testing",
|
|
||||||
aliases: ["t"],
|
|
||||||
})
|
|
||||||
// console.log(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
async run(context: Context): Promise<any> {
|
|
||||||
// console.log(context)
|
|
||||||
// console.log(this.nsfw)
|
|
||||||
console.log("testing")
|
|
||||||
return "Generic command"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +1,22 @@
|
||||||
|
// import "../../src/utils/patch"
|
||||||
|
|
||||||
import { Message, Collection, TextChannel, MessageEmbed } from 'discord.js';
|
import { Message, Collection, TextChannel, MessageEmbed } from 'discord.js';
|
||||||
import { Context } from '../../utils/types';
|
import { Context } from '@utils/types';
|
||||||
import { EuClient } from '../../modules/eu/src/misc/types';
|
import { EuClient } from '@modules/eu/src/misc/types';
|
||||||
import modulus from '../../utils/modulus'
|
import modulus from '@utils/modulus'
|
||||||
import prefixHandler from '../../utils/prefix'
|
import prefixHandler from '@utils/prefix'
|
||||||
import config from '../../utils/config';
|
import config from '@utils/config';
|
||||||
import language from '../../utils/language';
|
import language from '@utils/language';
|
||||||
import replace from '../../utils/replace';
|
import replace from '@utils/replace';
|
||||||
export = {
|
export = {
|
||||||
name: "messageCreate",
|
name: "messageCreate",
|
||||||
run: async (Eu: EuClient, message: Message) => {
|
run: async (Eu: EuClient, message: Message) => {
|
||||||
if (message.author.bot) return;
|
if (message.author.bot) return;
|
||||||
|
|
||||||
let helper = await prefixHandler(message.guild.id, message.content)
|
let helper = await prefixHandler(message.guild.id, message.content)
|
||||||
if (!helper.success) return
|
if (!helper.success) return
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const cmd = Eu.commands.find((c) => c.name == helper.command || (c.aliases && c.aliases.includes(helper.command)))
|
const cmd = Eu.commands.find((c) => c.name.toLowerCase() == helper.command || (c.aliases && c.aliases.includes(helper.command)))
|
||||||
if (!cmd) return
|
if (!cmd) return
|
||||||
|
|
||||||
if (!Eu.cooldowns.has(cmd.name)) {
|
if (!Eu.cooldowns.has(cmd.name)) {
|
||||||
|
@ -69,7 +70,7 @@ export = {
|
||||||
try {
|
try {
|
||||||
await cmd.run(ctx)
|
await cmd.run(ctx)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
let ErrorEmbed = new MessageEmbed().setTitle(replace(/COMMAND/g, cmd.name, language.get(ctx.settings.locale).error.error)).setDescription(`\`${error.message}\`\n\n\`${error}\``).setColor("RED")
|
let ErrorEmbed = new MessageEmbed().setTitle(replace(/COMMAND/g, cmd.name, language.get(ctx.settings.locale).error.error)).setDescription(`\`${error.message}\`\n\n\`${error}\``).setColor("RED")
|
||||||
return message.channel.send({ embeds: [ErrorEmbed] })
|
return message.channel.send({ embeds: [ErrorEmbed] })
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { Message } from 'discord.js';
|
import { Message } from 'discord.js';
|
||||||
import Shortlink from '../../utils/shortlink';
|
import { EuClient } from '@modules/eu/src/misc/types';
|
||||||
import { EuClient } from '../../modules/eu/src/misc/types';
|
import modulus from '@utils/modulus'
|
||||||
import modulus from '../../utils/modulus'
|
import sauce from '@utils/sourcefinder'
|
||||||
import sauce from '../../utils/sourcefinder'
|
|
||||||
export = {
|
export = {
|
||||||
name: "messageCreate",
|
name: "messageCreate",
|
||||||
run: async (Eu: EuClient, message: Message) => {
|
run: async (Eu: EuClient, message: Message) => {
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
import yiff from "./yiff";
|
||||||
|
|
||||||
|
type animal = "bird" | "cat" | "fox" | "hyena" | "shibe" | "wolf";
|
||||||
|
|
||||||
|
export default async function request(animal: animal) {
|
||||||
|
switch (animal) {
|
||||||
|
case "shibe":
|
||||||
|
return { image: await yiff.shibe("shibes", 1), provider: "shibe.online" };
|
||||||
|
case "bird":
|
||||||
|
return { image: await yiff.shibe("birds", 1), provider: "shibe.online" };
|
||||||
|
case "cat":
|
||||||
|
return { image: await yiff.shibe("cats", 1), provider: "shibe.online" };
|
||||||
|
case "fox":
|
||||||
|
return { image: await yiff.thaldrin("foxes"), provider: "thaldr.in" };
|
||||||
|
case "hyena":
|
||||||
|
return { image: await yiff.thaldrin("yeens"), provider: "thaldr.in" };
|
||||||
|
case "wolf":
|
||||||
|
return { image: await yiff.thaldrin("wolves"), provider: "thaldr.in" };
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
import path from 'path';
|
||||||
|
const modulealias = require('module-alias');
|
||||||
|
let root = path.resolve(__dirname, '../../');
|
||||||
|
|
||||||
|
modulealias.addAliases({
|
||||||
|
'@root': root,
|
||||||
|
'@src': `${root}/src`,
|
||||||
|
'@utils': `${root}/src/utils`,
|
||||||
|
'@modules': `${root}/src/modules`,
|
||||||
|
})
|
||||||
|
|
||||||
|
// modulealias()
|
|
@ -0,0 +1,19 @@
|
||||||
|
import Yiff from 'yiff'
|
||||||
|
import config from './config'
|
||||||
|
import pkg from '../../package.json'
|
||||||
|
let yiff = new Yiff({
|
||||||
|
useragent: `${pkg.name}/v${pkg.version} (t8.pm/bot)`,
|
||||||
|
killswitch: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
apikey: {
|
||||||
|
// @ts-ignore
|
||||||
|
sheri: config.tokens.sheri,
|
||||||
|
// @ts-ignore
|
||||||
|
yiffrest: config.tokens.yiffy,
|
||||||
|
// @ts-ignore
|
||||||
|
thaldrin: config.tokens.thaldrin
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export default yiff
|
Loading…
Reference in New Issue