23 lines
560 B
TypeScript
23 lines
560 B
TypeScript
import {Schema, Types, model} from 'mongoose';
|
|
|
|
import {Guild} from './Guild';
|
|
|
|
export interface GiveawayMsg{
|
|
_id: Types.ObjectId;
|
|
guild: Guild;
|
|
messageId: string;
|
|
authorId: string;
|
|
userIds: string[];
|
|
}
|
|
|
|
const giveawayMsgSchema = new Schema<GiveawayMsg>({
|
|
guild: {type: Schema.Types.ObjectId, required: true},
|
|
messageId: {type: String, required: true},
|
|
authorId: {type: String, required: true},
|
|
userIds: {type: [{type: String}], default: []}
|
|
});
|
|
|
|
export const giveawayMsgModel = model<GiveawayMsg>(
|
|
'giveawayMsgModel', giveawayMsgSchema
|
|
);
|