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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 393 - (hide annotations)
Mon Jul 29 17:29:59 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: application/typescript
File size: 2615 byte(s)
style: add license comments (#77)

* style: add license commits

* fix: shebang errors
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     required: true
66     }
67 rakin 85 });
68    
69 rakin 336 // 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