mirror of
https://github.com/SrIzan10/vinci.git
synced 2026-06-06 01:07:00 +00:00
feat: move to ESM
This commit is contained in:
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"dotenv.enableAutocloaking": false
|
||||
"dotenv.enableAutocloaking": true
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
import { ApplicationCommandOptionType } from "discord.js";
|
||||
/*
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
*/
|
||||
|
||||
export default commandModule({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { Context } from "@sern/handler";
|
||||
import { ApplicationCommandOptionType, AttachmentBuilder, AutocompleteInteraction, EmbedBuilder } from "discord.js";
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
const choices = ['XaviXE', 'Paula', 'William', 'Espejito2500', 'Wheelook', 'MarioCabrera', 'Paticama', 'Vinci', 'SrIzan', 'ItsAdrian', 'ByHGT', 'Irene'];
|
||||
|
||||
export default commandModule({
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { Context } from "@sern/handler";
|
||||
import axios from "axios";
|
||||
import { ActionRowBuilder, APIMessageActionRowComponent, ButtonBuilder, ButtonStyle, ComponentType, EmbedBuilder } from "discord.js";
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
/*
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
*/
|
||||
|
||||
export default commandModule({
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import axios from "axios";
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
|
||||
export default commandModule({
|
||||
name: 'chiste',
|
||||
type: CommandType.Slash,
|
||||
plugins: [publish({ guildIds: ['1000400148289036298', '928018226330337280'] })],
|
||||
description: 'Enseña un chiste en inglés.',
|
||||
alias : ['joke'],
|
||||
execute: async (ctx, args) => {
|
||||
const jokeJSON = await axios(
|
||||
'https://v2.jokeapi.dev/joke/Programming,Miscellaneous,Spooky,Christmas?blacklistFlags=nsfw,religious,racist,sexist,explicit'
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { Context, SlashOptions } from "@sern/handler";
|
||||
import axios from "axios";
|
||||
import { ActionRowBuilder, APIMessageActionRowComponent, ApplicationCommandOptionType, ButtonBuilder, ButtonStyle, ComponentType, EmbedBuilder, GuildMember } from "discord.js";
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import rockpaperscissors from "rockpaperscissors-checker";
|
||||
import { setNonEnumerableProperties } from "got/dist/source";
|
||||
|
||||
@@ -20,7 +20,7 @@ export default commandModule({
|
||||
required: true
|
||||
}
|
||||
],
|
||||
execute: async (ctx: Context, options: SlashOptions) => {
|
||||
execute: async (ctx, options) => {
|
||||
// also the code is mine, I didn't steal from anyone
|
||||
let player1, player2, winner, bothResponded
|
||||
const option = options[1].getMember('usuario') as GuildMember
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const TicTacToe = require("discord-tictactoe")
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import TicTacToe from 'discord-tictactoe';
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
import { ApplicationCommandOptionType } from "discord.js";
|
||||
const game = new TicTacToe({language: 'en'})
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// import everything
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
const { ActionRowBuilder, ButtonBuilder, ButtonStyle, ModalBuilder, EmbedBuilder, TextInputBuilder, TextInputStyle, InteractionType } = require('discord.js');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
import { TextChannel, ThreadAutoArchiveDuration, ThreadManager } from "discord.js";
|
||||
|
||||
export default commandModule({
|
||||
@@ -29,7 +29,7 @@ export default commandModule({
|
||||
.setAuthor({name: `${modal.user.username}`, iconURL: `${modal.user.displayAvatarURL()}`})
|
||||
.setDescription(value);
|
||||
// finally send the message to the text channel
|
||||
const message1 = modal.client.guilds.cache.get('928018226330337280').channels.cache.get('1007269448140476436') as TextChannel
|
||||
const message1 = modal.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1007269448140476436') as TextChannel
|
||||
const message2 = (await message1.send({embeds: [modalEmbed]}))
|
||||
message2.startThread({name: `Sugerencia de ${modal.user.username}`, autoArchiveDuration: ThreadAutoArchiveDuration.ThreeDays, reason: 'AUTOMATIZADO: Hilo para discutir sobre la sugerencia.'})
|
||||
message2.react("✅")
|
||||
@@ -1,10 +1,10 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
import { ApplicationCommandOptionType } from "discord.js";
|
||||
/*
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
*/
|
||||
|
||||
export default commandModule({
|
||||
@@ -22,7 +22,7 @@ export default commandModule({
|
||||
],
|
||||
//alias : [],
|
||||
execute: async (ctx, options) => {
|
||||
const usuario = options[1].getMember('usuario', true);
|
||||
const usuario = options[1].getMember('usuario');
|
||||
|
||||
if (!usuario) {
|
||||
await ctx.reply({content: "La IP del servidor de Minecraft es `minecraft.maraturing.com`,\nPide acceso con el comando </mcform:1000747672690499594>.", ephemeral: true})
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import axios from "axios";
|
||||
import { GuildBasedChannel, TextChannel } from 'discord.js';
|
||||
|
||||
export default commandModule({
|
||||
type: CommandType.Modal,
|
||||
@@ -7,7 +8,7 @@ export default commandModule({
|
||||
description: 'Envia el formulario para entrar al servidor.',
|
||||
//alias : [],
|
||||
async execute (modal) {
|
||||
const value = modal.fields.getTextInputValue('mcUsernameInput');
|
||||
const value = modal.fields.getTextInputValue('mcUsernameInput') as any
|
||||
var specialChars = /[`!@#$%^&*()+\-=\[\]{};':"\\|,.<>\/?~]/;
|
||||
if (value > 16 || value < 3 || specialChars.test(value)) {
|
||||
modal.reply({content: `ERROR: El nombre de usuario no es válido.`, ephemeral: true});
|
||||
@@ -15,8 +16,8 @@ export default commandModule({
|
||||
try {
|
||||
const request = await axios(`https://api.mojang.com/users/profiles/minecraft/${value}`, {validateStatus: function (status) {return status === 200 || status === 400; }})
|
||||
const data = request.data
|
||||
await modal.reply({content: 'Enviado!, Gracias por utilizar tu Mona Lisa de confianza\n~Sr Izan, 2022', ephemeral: true})
|
||||
modal.client.guilds.cache.get("928018226330337280").channels.cache.get("998195363376803850").send(`Solicitud enviada por ${modal.user}.\nUsername de Minecraft: ${value}`);
|
||||
await modal.reply({content: 'Enviado!, Gracias por utilizar tu Mona Lisa de confianza\n~Sr Izan, 2022', ephemeral: true});
|
||||
(modal.client.guilds.cache.get("928018226330337280")!.channels.cache.get("998195363376803850") as TextChannel).send(`Solicitud enviada por ${modal.user}.\nUsername de Minecraft: ${value}`);
|
||||
} catch (err) {
|
||||
await modal.reply({content: 'ERROR: No se ha podido enviar ya que eres un usuario no premium o de MC Bedrock.\nAsegúrate que has puesto bien el nombre de usuario.', ephemeral: true})
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
const { ActionRowBuilder, ButtonBuilder, ButtonStyle, ModalBuilder, EmbedBuilder, TextInputBuilder, TextInputStyle, InteractionType } = require('discord.js');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { ActionRowBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ModalActionRowComponentBuilder } from 'discord.js'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
|
||||
|
||||
export default commandModule({
|
||||
@@ -10,7 +10,7 @@ export default commandModule({
|
||||
plugins: [publish({ guildIds: ['1000400148289036298', '928018226330337280'] })],
|
||||
description: 'Envia el formulario para entrar al servidor.',
|
||||
//alias : [],
|
||||
execute: async (ctx, args, interaction) => {
|
||||
execute: async (ctx) => {
|
||||
const modal = new ModalBuilder()
|
||||
.setCustomId('mcform')
|
||||
.setTitle('Formulario para entrar al servidor');
|
||||
@@ -23,7 +23,7 @@ export default commandModule({
|
||||
.setStyle(TextInputStyle.Short);
|
||||
// An action row only holds one text input,
|
||||
// so you need one action row per text input.
|
||||
const usernameActionRow = new ActionRowBuilder().addComponents(input);
|
||||
const usernameActionRow = new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(input);
|
||||
|
||||
// Add inputs to the modal
|
||||
modal.addComponents(usernameActionRow);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { Context, SlashOptions } from "@sern/handler";
|
||||
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder } from "discord.js";
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
|
||||
export default commandModule({
|
||||
name: 'creditos',
|
||||
@@ -10,7 +10,7 @@ export default commandModule({
|
||||
description: 'Créditos del bot (en inglés)',
|
||||
//alias : [],
|
||||
options: [],
|
||||
execute: async (ctx: Context, options: SlashOptions) => {
|
||||
execute: async (ctx, options) => {
|
||||
const baseEmbed = new EmbedBuilder()
|
||||
.setColor('Blurple')
|
||||
.setTitle(`Without these people, the bot wouldn't exist!`)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { createAudioPlayer, createAudioResource, joinVoiceChannel } from "@discordjs/voice";
|
||||
import got from "got";
|
||||
import { ApplicationCommandOptionType, EmbedBuilder } from "discord.js";
|
||||
/*
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
*/
|
||||
|
||||
export default commandModule({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
import { ActionRowBuilder, ApplicationCommandOptionType, ChannelType, Collection, EmbedBuilder, Role, SelectMenuBuilder, TextChannel } from "discord.js";
|
||||
import { Resolver } from "../../resolver";
|
||||
import { Resolver } from "../../resolver.js";
|
||||
|
||||
export default commandModule({
|
||||
name: 'rolemenu',
|
||||
|
||||
@@ -1,24 +1,37 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { commandModule, CommandType } from "@sern/handler";
|
||||
import axios, { AxiosError, AxiosResponse } from "axios";
|
||||
import { ApplicationCommandOptionType } from "discord.js";
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
|
||||
export default commandModule({
|
||||
name: 'acortar',
|
||||
type: CommandType.Slash,
|
||||
plugins: [publish({ guildIds: ['1000400148289036298', '928018226330337280'] })],
|
||||
description: 'Acorta una URL a vinci.tk',
|
||||
name: "acortar",
|
||||
type: CommandType.Slash,
|
||||
plugins: [
|
||||
publish({ guildIds: ["1000400148289036298", "928018226330337280"] }),
|
||||
],
|
||||
description: "Acorta una URL a vinci.tk",
|
||||
options: [
|
||||
{
|
||||
name: 'url',
|
||||
description: 'la URL larga',
|
||||
name: "url",
|
||||
description: "la URL larga",
|
||||
type: ApplicationCommandOptionType.String,
|
||||
required: true
|
||||
}
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
//alias : [],
|
||||
execute: async (ctx, options) => {
|
||||
const url = options[1].getString('url', true);
|
||||
const request = await axios(`https://vinci.tk/yourls-api.php?signature=${process.env.YOURLS_KEY}&action=shorturl&format=json&url=${url}`, {validateStatus: function (status) {return status === 200 || status === 400; }}).then((res: AxiosResponse) => res.data)
|
||||
ctx.reply({content: `URL acortada: <${request.shorturl}>\nURL original: <${url}>`, ephemeral: true});
|
||||
}})
|
||||
const url = options[1].getString("url", true);
|
||||
const request = await axios(
|
||||
`https://vinci.tk/yourls-api.php?signature=${process.env.YOURLS_KEY}&action=shorturl&format=json&url=${url}`,
|
||||
{
|
||||
validateStatus: function (status) {
|
||||
return status === 200 || status === 400;
|
||||
},
|
||||
}
|
||||
).then((res: AxiosResponse) => res.data);
|
||||
ctx.reply({
|
||||
content: `URL acortada: <${request.shorturl}>\nURL original: <${url}>`,
|
||||
ephemeral: true,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
import { EmbedBuilder } from "discord.js";
|
||||
import axios from "axios";
|
||||
const prettySeconds = require('pretty-seconds-spanish')
|
||||
import prettySeconds from 'pretty-seconds-spanish'
|
||||
|
||||
export default commandModule({
|
||||
name: 'stats',
|
||||
@@ -40,6 +40,6 @@ export default commandModule({
|
||||
// {name: '\u200B', value: '\u200B', inline: true},
|
||||
// {name: 'Uptime del servidor', value: `${prettySeconds(`${nodeuptime.data}`)}`}
|
||||
)
|
||||
await ctx.interaction.editReply({embeds: [embed], ephemeral: true})
|
||||
await ctx.interaction.editReply({embeds: [embed]})
|
||||
},
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
const { ActionRowBuilder, ButtonBuilder, ButtonStyle, ModalBuilder, EmbedBuilder, TextInputBuilder, TextInputStyle, InteractionType } = require('discord.js');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { ActionRowBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ModalActionRowComponentBuilder } from 'discord.js'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
|
||||
|
||||
export default commandModule({
|
||||
@@ -10,7 +10,7 @@ export default commandModule({
|
||||
plugins: [publish({ guildIds: ['1000400148289036298', '928018226330337280'] })],
|
||||
description: 'Envia una sugerencia.',
|
||||
//alias : [],
|
||||
execute: async (ctx, args, interaction) => {
|
||||
execute: async (ctx) => {
|
||||
const modal = new ModalBuilder()
|
||||
.setCustomId('sugerencias')
|
||||
.setTitle('Sugerencias');
|
||||
@@ -24,7 +24,7 @@ export default commandModule({
|
||||
.setStyle(TextInputStyle.Paragraph);
|
||||
// An action row only holds one text input,
|
||||
// so you need one action row per text input.
|
||||
const suggestionsActionRow = new ActionRowBuilder().addComponents(input);
|
||||
const suggestionsActionRow = new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(input);
|
||||
// Add inputs to the modal
|
||||
modal.addComponents(suggestionsActionRow);
|
||||
await ctx.interaction.showModal(modal);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
const prettySeconds = require('pretty-seconds-spanish')
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import prettySeconds from 'pretty-seconds-spanish'
|
||||
|
||||
export default commandModule({
|
||||
name: 'uptime',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly";
|
||||
import { ApplicationCommandOptionType, EmbedBuilder } from 'discord.js'
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js";
|
||||
import { ApplicationCommandOptionType, EmbedBuilder, GuildMember, TextChannel } from 'discord.js'
|
||||
|
||||
export default commandModule({
|
||||
name: 'ban',
|
||||
@@ -21,12 +21,12 @@ export default commandModule({
|
||||
required: true
|
||||
}],
|
||||
//alias : [],
|
||||
execute: async (ctx, options, message) => {
|
||||
execute: async (ctx, options) => {
|
||||
try {
|
||||
const userToBan = options[1].getMember('usuario', true);
|
||||
const reason = options[1].get('razon', true).value;
|
||||
userToBan.ban(reason)
|
||||
const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257')
|
||||
const userToBan = options[1].getMember('usuario') as GuildMember
|
||||
const reason = options[1].getString('razon') as string
|
||||
userToBan.ban({reason: reason})
|
||||
const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257') as TextChannel
|
||||
await sendToMods.send({content: `Se ha baneado a ${userToBan}.\nBan efectuado por ${ctx.user} con razón "${reason}."`})
|
||||
await ctx.reply({content: 'Baneado correctamente!', ephemeral: true})
|
||||
} catch (e) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
import { ApplicationCommandOptionType, TextChannel } from "discord.js";
|
||||
/*
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
*/
|
||||
|
||||
export default commandModule({
|
||||
@@ -30,11 +30,10 @@ export default commandModule({
|
||||
execute: async (ctx, options) => {
|
||||
try {
|
||||
const idMensaje = options[1].getString('id', true);
|
||||
const channelID = options[1].getChannel('canal', true).id || ctx.channel.id
|
||||
const guildId = ctx.guild.id
|
||||
const guild = await ctx.client.guilds.fetch(guildId);
|
||||
const channel = await guild.channels.fetch(channelID);
|
||||
(await channel.messages.fetch(idMensaje)).delete();
|
||||
const channel = await guild.channels.fetch(ctx.channel!.id);
|
||||
(await (channel as TextChannel).messages.fetch(idMensaje)).delete();
|
||||
await ctx.reply({content: 'Mensaje eliminado correctamente.', ephemeral: true});
|
||||
} catch (e) {
|
||||
await ctx.reply({content: `ERROR: No se ha podido eliminar el mensaje, asegúrate que estás usando el ID y el canal correcto.`})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly";
|
||||
import { ApplicationCommandOptionType, EmbedBuilder } from 'discord.js'
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js";
|
||||
import { ApplicationCommandOptionType, EmbedBuilder, GuildMember, TextChannel } from 'discord.js'
|
||||
|
||||
export default commandModule({
|
||||
name: 'kick',
|
||||
@@ -23,16 +23,13 @@ export default commandModule({
|
||||
}
|
||||
],
|
||||
//alias : [],
|
||||
execute: async (ctx, options, message) => {
|
||||
execute: async (ctx, options) => {
|
||||
try {
|
||||
const userToBan = options[1].getMember('usuario', true);
|
||||
const reason = options[1].get('razon', true).value;
|
||||
const kickEmbed = new EmbedBuilder()
|
||||
.setTitle('Nuevo kick.')
|
||||
.setDescription(`Kick efectuado por <@${ctx.author}>.\nRazón: ${reason}.`);
|
||||
userToBan.kick(reason)
|
||||
const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257')
|
||||
await sendToMods.send({content: `Se ha expulsado a ${userToBan}.\nKick efectuado por ${ctx.user} con razón "${reason}."`})
|
||||
const userToKick = options[1].getMember('usuario');
|
||||
const reason = options[1].getString('razon') as string;
|
||||
(userToKick as GuildMember).kick(reason)
|
||||
const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257') as TextChannel
|
||||
await sendToMods!.send({content: `Se ha expulsado a ${userToKick}.\nKick efectuado por ${ctx.user} con razón "${reason}."`})
|
||||
await ctx.reply({content: 'Expulsado correctamente!'})
|
||||
} catch (e) {
|
||||
await ctx.reply({content: `ERROR: No puedo hacer este comando porque a lo mejor soy inferior que el rol de esa persona o estoy usándolo contra admins.`})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly";
|
||||
import { ApplicationCommandOptionType } from 'discord.js'
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js";
|
||||
import { ApplicationCommandOptionType, TextChannel } from 'discord.js'
|
||||
|
||||
export default commandModule({
|
||||
name: 'prune',
|
||||
@@ -19,12 +19,12 @@ export default commandModule({
|
||||
//alias : [],
|
||||
execute: async (ctx, options) => {
|
||||
try {
|
||||
const amount = options[1].getNumber('numero', true);
|
||||
ctx.channel.bulkDelete(amount, true).catch(err => {
|
||||
const amount = options[1].getNumber('numero', true) as number
|
||||
(ctx.channel as TextChannel).bulkDelete(amount).catch(err => {
|
||||
console.error(err);
|
||||
ctx.reply({content: 'Ha habido un error eliminando mensajes! (mira la consola, Sr Izan)', ephemeral: true});});
|
||||
await ctx.reply({content: `Se han eliminado ${amount} mensajes.`})
|
||||
const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257')
|
||||
const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257') as TextChannel
|
||||
await sendToMods.send({content: `Se han eliminado ${amount} mensajes en ${ctx.channel}\nEfectuado por ${ctx.user}.`})
|
||||
} catch (e){
|
||||
ctx.reply({content: 'Ha habido un error eliminando mensajes! Error reportado automáticamente.', ephemeral: true})};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { ApplicationCommandOptionType } from "discord.js";
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
import { ApplicationCommandOptionType, TextChannel } from "discord.js";
|
||||
|
||||
export default commandModule({
|
||||
name: 'slowmode',
|
||||
@@ -28,10 +28,10 @@ export default commandModule({
|
||||
const seconds = options[1].getNumber("segundos", true);
|
||||
const reason = options[1].getString("razon", true);
|
||||
|
||||
ctx.channel.setRateLimitPerUser(seconds, reason)
|
||||
(ctx.channel as TextChannel).setRateLimitPerUser(seconds, reason)
|
||||
|
||||
ctx.reply({content: `Se han añadido ${seconds} segundos de modo lento al canal de voz actual`})
|
||||
const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257')
|
||||
const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257') as TextChannel
|
||||
await sendToMods.send({content: `Se ha aplicado modo lento al canal ${ctx.channel}.\nEfectuado por ${ctx.user} con ${seconds} segundos de retardo.\nRazón: ${reason}`})
|
||||
} catch (e) {
|
||||
ctx.reply({content: `No se ha podido aplicar modo lento al canal.`})
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { ApplicationCommandOptionType } from "discord.js";
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
import { ApplicationCommandOptionType, GuildMember, TextChannel } from "discord.js";
|
||||
/*
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
*/
|
||||
|
||||
export default commandModule({
|
||||
@@ -36,12 +36,12 @@ export default commandModule({
|
||||
//alias : [],
|
||||
execute: async (ctx, options) => {
|
||||
try {
|
||||
const usuario = options[1].getMember('usuario', true);
|
||||
const minutos = options[1].getNumber('minutos', true);
|
||||
const usuario = options[1].getMember('usuario') as GuildMember
|
||||
const minutos = options[1].getNumber('minutos') as number
|
||||
const razon = options[1].getString('razon', true);
|
||||
const minutosToMilisegundos = minutos * 60 * 1000
|
||||
usuario.timeout(minutosToMilisegundos, razon).then(() => {ctx.reply({content: `Se ha silenciado a ${usuario} correctamente.`, ephemeral: true})})
|
||||
const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257')
|
||||
const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257') as TextChannel
|
||||
await sendToMods.send({content: `Se ha silenciado a ${usuario}.\nSlencio efectuado por ${ctx.user} con ${minutos} minutos de duración.\nRazón: ${razon}`})
|
||||
} catch (e) {
|
||||
await ctx.reply({content: `ERROR: No puedo hacer este comando porque a lo mejor soy inferior que el rol de esa persona o estoy usándolo contra admins.`})
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly";
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js";
|
||||
import { ActionRowBuilder, ApplicationCommandOptionType, ButtonBuilder, ButtonStyle, EmbedBuilder, GuildMember } from "discord.js";
|
||||
const db = require('../../schemas/warn')
|
||||
import db from '../../schemas/warn.js';
|
||||
|
||||
export default commandModule({
|
||||
name: 'warn',
|
||||
@@ -65,11 +65,11 @@ export default commandModule({
|
||||
],
|
||||
execute: async (ctx, options) => {
|
||||
const subcommand = options[1].getSubcommand()
|
||||
const user = options[1].getMember('usuario', true).id
|
||||
const usermember = options[1].getMember('usuario', true) as GuildMember
|
||||
const user = (options[1].getMember('usuario') as GuildMember).id
|
||||
const usermember = options[1].getMember('usuario') as GuildMember
|
||||
const reason = options[1].getString('razon', true) as string
|
||||
const times = await db.findOne({id: `${user}`})
|
||||
const buttons = new ActionRowBuilder()
|
||||
const times = await db.findOne({id: `${user}`}) as any
|
||||
const buttons = new ActionRowBuilder<ButtonBuilder>()
|
||||
.addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId('1hour')
|
||||
@@ -109,46 +109,46 @@ export default commandModule({
|
||||
const warn = new db({id: `${user}`, times: 1})
|
||||
warn.save()
|
||||
ctx.reply({content: `Se ha avisado a ${usermember} correctamente y añadido a la base de datos.`, ephemeral: true})
|
||||
ctx.client.users.fetch(user, false).then((user) => {
|
||||
ctx.client.users.fetch(user).then((user) => {
|
||||
user.send({embeds: [dmEmbed]})
|
||||
}).catch(err, async => {console.log(`couldn't send a DM to user ID ${user}.`)});
|
||||
}).catch(() => console.log(`couldn't send a DM to user ID ${user}.`));
|
||||
} else {
|
||||
if (times.times > 2) {
|
||||
const msg = await ctx.reply({content: `El usuario ha excedido 3 avisos, ¿qué hacer?`, fetchReply: true, ephemeral: true, components: [buttons]})
|
||||
const msg = await ctx.reply({content: `El usuario ha excedido 3 avisos, ¿qué hacer?`, ephemeral: true, components: [buttons]})
|
||||
const collector = await msg.createMessageComponentCollector({ time: 15000, max: 1 });
|
||||
collector.on('collect', async i => {
|
||||
await i.deferReply({ephemeral: true})
|
||||
if (i.customId === '1hour') {
|
||||
await i.editReply({content: `Se ha silenciado a ${usermember} durante 1 hora correctamente. ;-;`, ephemeral: true})
|
||||
await i.editReply({content: `Se ha silenciado a ${usermember} durante 1 hora correctamente. ;-;`})
|
||||
usermember.timeout(60 * 60 * 1000, reason)
|
||||
times.times = 0
|
||||
times.save()
|
||||
} else if (i.customId === '30mins') {
|
||||
await i.editReply({content: `Se ha silenciado a ${usermember} durante 30 minutos correctamente. ;-;`, ephemeral: true})
|
||||
await i.editReply({content: `Se ha silenciado a ${usermember} durante 30 minutos correctamente. ;-;`})
|
||||
usermember.timeout(30 * 60 * 1000, reason)
|
||||
times.times = 0
|
||||
times.save()
|
||||
} else if (i.customId === '15mins') {
|
||||
await i.editReply({content: `Se ha silenciado a ${usermember} durante 15 minutos correctamente. ;-;`, ephemeral: true})
|
||||
await i.editReply({content: `Se ha silenciado a ${usermember} durante 15 minutos correctamente. ;-;`})
|
||||
usermember.timeout(15 * 60 * 1000, reason)
|
||||
times.times = 0
|
||||
times.save()
|
||||
} else if (i.customId === 'pardon') {
|
||||
await i.editReply({content: `Se ha perdonado a ${usermember} correctamente.\nSeguro que la persona te lo agradecerá! :'D`, ephemeral: true})
|
||||
await i.editReply({content: `Se ha perdonado a ${usermember} correctamente.\nSeguro que la persona te lo agradecerá! :'D`})
|
||||
times.times = 0
|
||||
times.save()
|
||||
}
|
||||
ctx.client.users.fetch(user, false).then((user) => {
|
||||
ctx.client.users.fetch(user).then((user) => {
|
||||
user.send({embeds: [dmEmbedTimeout]})
|
||||
}).catch(console.log(`couldn't send a DM to user ID ${user}.`));
|
||||
}).catch(() => console.log(`couldn't send a DM to user ID ${user}.`));
|
||||
});
|
||||
} else {
|
||||
ctx.reply({content: `se ha añadido un aviso con el motivo ${reason}.\navisos que tiene ahora: ${times.times + 1}`, ephemeral: true})
|
||||
times.times = times.times + 1
|
||||
times.save()
|
||||
ctx.client.users.fetch(user, false).then((user) => {
|
||||
ctx.client.users.fetch(user).then((user) => {
|
||||
user.send({embeds: [dmEmbed]});
|
||||
}).catch(console.log(`couldn't send a DM to user ID ${user}.`))
|
||||
}).catch(() => console.log(`couldn't send a DM to user ID ${user}.`))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -163,65 +163,50 @@ export default commandModule({
|
||||
const warn = new db({id: `${user}`, times: 2})
|
||||
warn.save()
|
||||
ctx.reply({content: `Se ha avisado a ${usermember} correctamente y añadido a la base de datos.`, ephemeral: true})
|
||||
ctx.client.users.fetch(user, false).then((user) => {
|
||||
ctx.client.users.fetch(user).then((user) => {
|
||||
user.send({embeds: [dmEmbed]});
|
||||
}).catch(console.log(`couldn't send a DM to user ID ${user}.`))
|
||||
}).catch(() => console.log(`couldn't send a DM to user ID ${user}.`))
|
||||
} else {
|
||||
if (times.times >= 4) {
|
||||
const msg = await ctx.reply({content: `El usuario ha excedido 3 avisos, ¿qué hacer?`, fetchReply: true, ephemeral: true, components: [buttons]})
|
||||
const msg = await ctx.reply({content: `El usuario ha excedido 3 avisos, ¿qué hacer?`, ephemeral: true, components: [buttons]})
|
||||
const collector = await msg.createMessageComponentCollector({ time: 1000, max: 1 });
|
||||
collector.on('collect', async i => {
|
||||
if (i.customId === '1hour') {
|
||||
await i.channel.send({content: `Se ha silenciado a ${usermember} durante 1 hora correctamente. ;-;`, ephemeral: true})
|
||||
await i.channel!.send({content: `Se ha silenciado a ${usermember} durante 1 hora correctamente. ;-;`})
|
||||
usermember.timeout(60 * 60 * 1000, reason)
|
||||
times.times = 0
|
||||
times.save()
|
||||
} else if (i.customId === '30mins') {
|
||||
await i.channel.send({content: `Se ha silenciado a ${usermember} durante 30 minutos correctamente. ;-;`, ephemeral: true})
|
||||
await i.channel!.send({content: `Se ha silenciado a ${usermember} durante 30 minutos correctamente. ;-;`})
|
||||
usermember.timeout(30 * 60 * 1000, reason)
|
||||
times.times = 0
|
||||
times.save()
|
||||
} else if (i.customId === '15mins') {
|
||||
await i.channel.send({content: `Se ha silenciado a ${usermember} durante 15 minutos correctamente. ;-;`, ephemeral: true})
|
||||
await i.channel!.send({content: `Se ha silenciado a ${usermember} durante 15 minutos correctamente. ;-;`})
|
||||
usermember.timeout(15 * 60 * 1000, reason)
|
||||
times.times = 0
|
||||
times.save()
|
||||
} else if (i.customId === 'pardon') {
|
||||
await i.channel.send({content: `Se ha perdonado a ${usermember} correctamente.\nSeguro que la persona te lo agradecerá! :'D`, ephemeral: true})
|
||||
await i.channel!.send({content: `Se ha perdonado a ${usermember} correctamente.\nSeguro que la persona te lo agradecerá! :'D`})
|
||||
times.times = 0
|
||||
times.save()
|
||||
}
|
||||
ctx.client.users.fetch(user, false).then((user) => {
|
||||
ctx.client.users.fetch(user).then((user) => {
|
||||
user.send({embeds: [dmEmbedTimeout]})
|
||||
}).catch(console.log(`couldn't send a DM to user ID ${user}.`));
|
||||
}).catch(() => console.log(`couldn't send a DM to user ID ${user}.`));
|
||||
});
|
||||
} else {
|
||||
ctx.reply({content: `se ha añadido un aviso con el motivo ${reason}.\navisos que tiene ahora: ${times.times + 2}`, ephemeral: true})
|
||||
times.times = times.times + 2
|
||||
times.save()
|
||||
ctx.client.users.fetch(user, false).then((user) => {
|
||||
ctx.client.users.fetch(user).then((user) => {
|
||||
user.send({embeds: [dmEmbed]});
|
||||
}).catch(console.log(`couldn't send a DM to user ID ${user}.`))
|
||||
}).catch(() => console.log(`couldn't send a DM to user ID ${user}.`))
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
case "clear": {
|
||||
await db.exists({id: `${user}`}, function (err, doc) {
|
||||
if (err) {
|
||||
console.log(err)
|
||||
} else {
|
||||
if (doc === null) {
|
||||
ctx.reply({content: 'el usuario no está en la base de datos, así que no hay nada que hacer.', ephemeral: true})
|
||||
} else {
|
||||
times.times = 0
|
||||
times.save()
|
||||
ctx.reply({content: `quitados todos los avisos a ${usermember} correctamente!`, ephemeral: true})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,9 +1,9 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../src/plugins/publish";
|
||||
import { ownerOnly } from "../src/plugins/ownerOnly"
|
||||
import { commandModule, CommandType } from '@sern/handler'
|
||||
import { publish } from "../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../src/plugins/ownerOnly.js"
|
||||
/*
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly"
|
||||
import { publish } from "../../src/plugins/publish.js";
|
||||
import { ownerOnly } from "../../src/plugins/ownerOnly.js"
|
||||
*/
|
||||
|
||||
export default commandModule({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { EventType, eventModule } = require('@sern/handler');
|
||||
import { EventType, eventModule } from "@sern/handler";
|
||||
|
||||
export default eventModule({
|
||||
type: EventType.Sern,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { EmbedBuilder, GuildMember, TextChannel } from "discord.js";
|
||||
|
||||
const { EventType, eventModule } = require('@sern/handler');
|
||||
import { EventType, eventModule } from "@sern/handler";
|
||||
|
||||
export default eventModule({
|
||||
type: EventType.Discord,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { EmbedBuilder, GuildMember, TextChannel } from "discord.js";
|
||||
|
||||
const { EventType, eventModule } = require('@sern/handler');
|
||||
import { EventType, eventModule } from "@sern/handler";
|
||||
|
||||
export default eventModule({
|
||||
type: EventType.Discord,
|
||||
|
||||
21
index.ts
21
index.ts
@@ -2,21 +2,19 @@ import { SernEmitter } from "@sern/handler";
|
||||
import axios from "axios";
|
||||
import { ActivityType, TextChannel, EmbedBuilder, Message, VoiceBasedChannel } from "discord.js";
|
||||
import { DOMParser } from "@xmldom/xmldom";
|
||||
const { Client, GatewayIntentBits } = require("discord.js");
|
||||
const { Sern } = require("@sern/handler");
|
||||
require("dotenv").config();
|
||||
const sernPrefix = process.env.PREFIX
|
||||
const mongoose = require('mongoose');
|
||||
const youtube = require('discord-bot-youtube-notifications');
|
||||
import { Client, GatewayIntentBits } from "discord.js";
|
||||
import { Sern } from "@sern/handler"
|
||||
import 'dotenv/config'
|
||||
import mongoose from 'mongoose'
|
||||
import youtube from 'discord-bot-youtube-notifications'
|
||||
import express from 'express'
|
||||
const app = express();
|
||||
|
||||
const client = new Client({
|
||||
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMembers, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.GuildVoiceStates],
|
||||
restTimeOffset: 0
|
||||
});
|
||||
|
||||
export const db = mongoose.connect(process.env.MONGODB, {useNewUrlParser: true,useUnifiedTopology: true}).then(async => {console.log('Connected to MongoDB');})
|
||||
export const db = mongoose.connect(process.env.MONGODB as string).then(() => {console.log('Connected to MongoDB');})
|
||||
|
||||
Sern.init({
|
||||
client,
|
||||
@@ -37,8 +35,9 @@ client.on('ready', async () => {
|
||||
{ name: "tu voz", type: ActivityType.Listening },
|
||||
{ name: "ahora v1.0!", type: ActivityType.Playing }
|
||||
]
|
||||
const randomStatus = statuses[Math.floor(Math.random() * statuses.length)];
|
||||
client.user.setActivity(randomStatus);
|
||||
const randomStatus = statuses[Math.floor(Math.random() * statuses.length)]
|
||||
// @ts-ignore
|
||||
client.user!.setActivity(randomStatus);
|
||||
}, 10000);
|
||||
});
|
||||
|
||||
@@ -53,7 +52,7 @@ app.get("/", function (req, res) {
|
||||
})
|
||||
|
||||
app.listen(process.env.PORT || 7272,
|
||||
() => console.log("The webserver is listening"));
|
||||
() => console.log("The webserver is listening"));
|
||||
|
||||
/*async function nowPlayingRadio() {
|
||||
const getAPI = await axios.get("https://opml.radiotime.com/Describe.ashx?id=s67006", {validateStatus: function (status) {return status === 200|| status === 403}}).then((res) => res.data).catch((err) => {console.log("now playing radio errored out? diesofcringe")})
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
"keywords": [
|
||||
"discord-bot"
|
||||
],
|
||||
"type": "module",
|
||||
"author": "Sr Izan",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const mongoose = require('mongoose');
|
||||
import mongoose from "mongoose";
|
||||
const schema = new mongoose.Schema({
|
||||
id: {type: String, required: true},
|
||||
times: {type: Number, required: true}
|
||||
});
|
||||
const db = mongoose.model("warn", schema);
|
||||
module.exports = db;
|
||||
export default db
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
/* Language and Environment */
|
||||
"target": "ES2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
||||
"lib": ["ES2022"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||
// "lib": ["ES2022"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
||||
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
||||
@@ -25,9 +25,9 @@
|
||||
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
||||
|
||||
/* Modules */
|
||||
"module": "CommonJS", /* Specify what module code is generated. */
|
||||
"module": "ESNext", /* Specify what module code is generated. */
|
||||
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||
|
||||
Reference in New Issue
Block a user