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

Diff of /trunk/src/models/AFK.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 304 by rakin, Mon Jul 29 17:29:27 2024 UTC revision 328 by rakin, Mon Jul 29 17:29:34 2024 UTC
# Line 1  Line 1 
1  import { DataTypes, Model } from 'sequelize';  import { Schema, model, SchemaTypes, Document } from 'mongoose';
 import DiscordClient from '../client/Client';  
2    
3  class AFK extends Model {}  export interface IAFK extends Document {
4        user: string;
5        reason?: string;
6        mentions: Array<object>;
7        guild_id: string;
8        createdAt: Date;
9    }
10    
11  AFK.init({  const schema = new Schema({
     id: {  
         type: DataTypes.INTEGER,  
         autoIncrement: true,  
         primaryKey: true,  
     },  
12      user: {      user: {
13          type: DataTypes.STRING,          type: String,
14          allowNull: false          required: true
15      },      },
16      reason: {      reason: {
17          type: DataTypes.STRING,          type: String,
18          allowNull: true          required: false
     },  
     mentions: {  
         type: DataTypes.JSON,  
         allowNull: false,  
         defaultValue: []  
19      },      },
20        mentions: Array,
21      guild_id: {      guild_id: {
22          type: DataTypes.STRING,          type: String,
23          allowNull: false          required: true
24      },      },
25  }, {      createdAt: {
26      sequelize: DiscordClient.client.db.sequelize,          type: Date,
27      modelName: 'AFK',          required: true
28      updatedAt: false,      }
29  });  });
30    
 export default AFK;  
31    export default model('AFK', schema);

Legend:
Removed from v.304  
changed lines
  Added in v.328

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26