mirror of
https://github.com/SrIzan10/femboybot.git
synced 2026-06-06 00:56:50 +00:00
feat: some db prep
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
/node_modules
|
||||
/dist
|
||||
.env
|
||||
.env
|
||||
commands/lol/
|
||||
@@ -3,7 +3,7 @@ import { Client } from "discord.js";
|
||||
|
||||
export default eventModule({
|
||||
type: EventType.Discord,
|
||||
execute: async (client: Client) => {
|
||||
execute: async () => {
|
||||
console.log('el bot c ha ensendio');
|
||||
},
|
||||
});
|
||||
38
schemas/disable.ts
Normal file
38
schemas/disable.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* Disables a command entirely, for whatever reasons you may need.
|
||||
*
|
||||
* @author @jacoobes [<@182326315813306368>]
|
||||
* @version 1.0.0
|
||||
* @example
|
||||
* ```ts
|
||||
* import { disable } from "../plugins/disable";
|
||||
* import { commandModule } from "@sern/handler";
|
||||
* export default commandModule({
|
||||
* plugins: [ disable() ],
|
||||
* execute: (ctx) => {
|
||||
* //your code here
|
||||
* }
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
import { CommandType, EventPlugin, PluginType } from "@sern/handler";
|
||||
import { InteractionReplyOptions, ReplyMessageOptions } from "discord.js";
|
||||
|
||||
export function disable(
|
||||
onFail?:
|
||||
| string
|
||||
| Omit<InteractionReplyOptions, "fetchReply">
|
||||
| ReplyMessageOptions
|
||||
): EventPlugin<CommandType.Both> {
|
||||
return {
|
||||
type: PluginType.Event,
|
||||
description: "Disables command from responding",
|
||||
async execute([ctx], controller) {
|
||||
if (onFail !== undefined) {
|
||||
await ctx.reply(onFail);
|
||||
}
|
||||
return controller.stop();
|
||||
},
|
||||
};
|
||||
}
|
||||
11
schemas/pepega.ts
Normal file
11
schemas/pepega.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { model, Schema } from "mongoose";
|
||||
|
||||
const schema = new Schema({
|
||||
userid: {type: String, required: true},
|
||||
times: {type: Number, required: true}
|
||||
})
|
||||
|
||||
// @ts-ignore
|
||||
const db = new model('pepega', schema)
|
||||
|
||||
export default db;
|
||||
Reference in New Issue
Block a user