/[sudobot]/branches/3.x/src/models/Punishment.ts
ViewVC logotype

Annotation of /branches/3.x/src/models/Punishment.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 577 - (hide annotations)
Mon Jul 29 18:52:37 2024 UTC (8 months ago) by rakinar2
File MIME type: application/typescript
File size: 2615 byte(s)
chore: add old version archive branches (2.x to 9.x-dev)
1 rakinar2 577 /**
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     import { Schema, model } from 'mongoose';
21    
22     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    
33     const schema = new Schema({
34     user_id: {
35     type: String,
36     required: true,
37     },
38     mod_id: {
39     type: String,
40     required: true,
41     },
42     mod_tag: {
43     type: String,
44     required: true,
45     },
46     guild_id: {
47     type: String,
48     required: true,
49     },
50     reason: {
51     type: String,
52     required: false
53     },
54     type: {
55     type: String,
56     required: true
57     },
58     meta: {
59     type: Object,
60     required: true,
61     default: {}
62     },
63     createdAt: {
64     type: Date,
65     required: true
66     }
67     });
68    
69     // class Punishment extends Model {}
70    
71     // Punishment.init({
72     // id: {
73     // type: DataTypes.INTEGER,
74     // primaryKey: true,
75     // autoIncrement: true,
76     // allowNull: false,
77     // },
78     // user_id: {
79     // type: DataTypes.STRING,
80     // allowNull: false,
81     // },
82     // mod_id: {
83     // type: DataTypes.STRING,
84     // allowNull: false,
85     // },
86     // mod_tag: {
87     // type: DataTypes.STRING,
88     // allowNull: false,
89     // },
90     // guild_id: {
91     // type: DataTypes.STRING,
92     // allowNull: false,
93     // },
94     // reason: {
95     // type: DataTypes.TEXT,
96     // allowNull: true
97     // },
98     // type: {
99     // type: DataTypes.STRING,
100     // allowNull: false
101     // },
102     // meta: {
103     // type: DataTypes.JSON,
104     // allowNull: false,
105     // defaultValue: {}
106     // },
107     // }, {
108     // sequelize: DiscordClient.client.db.sequelize,
109     // modelName: 'Punishment',
110     // updatedAt: false,
111     // tableName: 'punishments'
112     // });
113    
114     export default model('Punishment', schema);

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26