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

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26