1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 13:14:06 +01:00
server/dist/models/Channel.js

50 lines
2.1 KiB
JavaScript
Raw Normal View History

2021-02-05 22:01:01 +01:00
"use strict";
2021-02-16 21:16:56 +01:00
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
2021-02-05 22:01:01 +01:00
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChannelType = exports.ChannelPermissionOverwriteType = exports.ChannelModel = exports.ChannelSchema = void 0;
2021-02-13 14:15:59 +01:00
const mongoose_1 = require("mongoose");
2021-02-16 21:16:56 +01:00
const Database_1 = __importDefault(require("../util/Database"));
2021-02-13 14:15:59 +01:00
exports.ChannelSchema = new mongoose_1.Schema({
2021-04-06 18:01:49 +02:00
id: String,
2021-02-13 14:15:59 +01:00
created_at: { type: mongoose_1.Schema.Types.Date, required: true },
name: { type: String, required: true },
type: { type: Number, required: true },
2021-04-06 18:01:49 +02:00
guild_id: String,
owner_id: String,
parent_id: String,
recipients: [String],
2021-02-13 14:15:59 +01:00
position: Number,
2021-04-06 18:01:49 +02:00
last_message_id: String,
2021-02-13 14:15:59 +01:00
last_pin_timestamp: Date,
nsfw: Boolean,
rate_limit_per_user: Number,
topic: String,
permission_overwrites: [
{
allow: mongoose_1.Types.Long,
deny: mongoose_1.Types.Long,
2021-04-06 18:01:49 +02:00
id: String,
2021-02-13 14:15:59 +01:00
type: Number,
},
],
});
2021-02-16 21:16:56 +01:00
// @ts-ignore
exports.ChannelModel = Database_1.default.model("Channel", exports.ChannelSchema, "channels");
var ChannelPermissionOverwriteType;
(function (ChannelPermissionOverwriteType) {
ChannelPermissionOverwriteType[ChannelPermissionOverwriteType["role"] = 0] = "role";
ChannelPermissionOverwriteType[ChannelPermissionOverwriteType["member"] = 1] = "member";
})(ChannelPermissionOverwriteType = exports.ChannelPermissionOverwriteType || (exports.ChannelPermissionOverwriteType = {}));
2021-02-11 20:44:26 +01:00
var ChannelType;
(function (ChannelType) {
ChannelType[ChannelType["GUILD_TEXT"] = 0] = "GUILD_TEXT";
ChannelType[ChannelType["DM"] = 1] = "DM";
ChannelType[ChannelType["GUILD_VOICE"] = 2] = "GUILD_VOICE";
ChannelType[ChannelType["GROUP_DM"] = 3] = "GROUP_DM";
ChannelType[ChannelType["GUILD_CATEGORY"] = 4] = "GUILD_CATEGORY";
ChannelType[ChannelType["GUILD_NEWS"] = 5] = "GUILD_NEWS";
ChannelType[ChannelType["GUILD_STORE"] = 6] = "GUILD_STORE";
})(ChannelType = exports.ChannelType || (exports.ChannelType = {}));
2021-02-05 22:01:01 +01:00
//# sourceMappingURL=Channel.js.map