Files
amane-tanikaze-dcbot/models/GiveawayMsg.ts
2024-10-13 14:50:19 +00:00

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
);