/[sudobot]/trunk/src/models/Punishment.ts
ViewVC logotype

Annotation of /trunk/src/models/Punishment.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 428 - (hide annotations)
Mon Jul 29 17:30:11 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: application/typescript
File size: 2650 byte(s)
refactor: use new queue handler
1 rakin 393 /**
2     * This file is part of SudoBot.
3     *
4     * Copyright (C) 2021-2022 OSN Inc.
5     *
6     * SudoBot is free software; you can redistribute it and/or modify it
7     * under the terms of the GNU Affero General Public License as published by
8     * the Free Software Foundation, either version 3 of the License, or
9     * (at your option) any later version.
10     *
11     * SudoBot is distributed in the hope that it will be useful, but
12     * WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     * GNU Affero General Public License for more details.
15     *
16     * You should have received a copy of the GNU Affero General Public License
17     * along with SudoBot. If not, see <https://www.gnu.org/licenses/>.
18     */
19    
20 rakin 336 import { Schema, model } from 'mongoose';
21 rakin 85
22 rakin 336 export interface IPunishment {
23     user_id: string
24     mod_id: string
25     mod_tag: string,
26     guild_id: string;
27     reason?: string;
28     type: string
29     meta?: object;
30     createdAt: Date;
31     }
32 rakin 85
33 rakin 336 const schema = new Schema({
34 rakin 85 user_id: {
35 rakin 336 type: String,
36     required: true,
37 rakin 85 },
38     mod_id: {
39 rakin 336 type: String,
40     required: true,
41 rakin 85 },
42 rakin 86 mod_tag: {
43 rakin 336 type: String,
44     required: true,
45 rakin 86 },
46 rakin 85 guild_id: {
47 rakin 336 type: String,
48     required: true,
49 rakin 85 },
50     reason: {
51 rakin 336 type: String,
52     required: false
53 rakin 85 },
54     type: {
55 rakin 336 type: String,
56     required: true
57 rakin 85 },
58     meta: {
59 rakin 336 type: Object,
60     required: true,
61     default: {}
62 rakin 85 },
63 rakin 336 createdAt: {
64     type: Date,
65 rakin 428 required: true,
66     default: () => new Date()
67 rakin 336 }
68 rakin 85 });
69    
70 rakin 336 // class Punishment extends Model {}
71    
72     // Punishment.init({
73     // id: {
74     // type: DataTypes.INTEGER,
75     // primaryKey: true,
76     // autoIncrement: true,
77     // allowNull: false,
78     // },
79     // user_id: {
80     // type: DataTypes.STRING,
81     // allowNull: false,
82     // },
83     // mod_id: {
84     // type: DataTypes.STRING,
85     // allowNull: false,
86     // },
87     // mod_tag: {
88     // type: DataTypes.STRING,
89     // allowNull: false,
90     // },
91     // guild_id: {
92     // type: DataTypes.STRING,
93     // allowNull: false,
94     // },
95     // reason: {
96     // type: DataTypes.TEXT,
97     // allowNull: true
98     // },
99     // type: {
100     // type: DataTypes.STRING,
101     // allowNull: false
102     // },
103     // meta: {
104     // type: DataTypes.JSON,
105     // allowNull: false,
106     // defaultValue: {}
107     // },
108     // }, {
109     // sequelize: DiscordClient.client.db.sequelize,
110     // modelName: 'Punishment',
111     // updatedAt: false,
112     // tableName: 'punishments'
113     // });
114    
115     export default model('Punishment', schema);

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26