UNPKG

hennus-api

Version:

Esta es una libreria para el bot Hennus

40 lines (39 loc) 2.03 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.channelConvertidor = void 0; const v10_1 = require("discord-api-types/v10"); const types_1 = require("../../types"); __exportStar(require("./color"), exports); __exportStar(require("./emojis"), exports); function channelConvertidor(ch, client) { let channel = undefined; if (ch.type == v10_1.ChannelType.GuildText || ch.type == v10_1.ChannelType.GuildAnnouncement) channel = new types_1.BasedTextChannel(ch, client); else if (ch.type == v10_1.ChannelType.DM || ch.type == v10_1.ChannelType.GroupDM) channel = new types_1.BasedDmChannel(ch, client); else if (ch.type == v10_1.ChannelType.GuildVoice || ch.type == v10_1.ChannelType.GuildStageVoice) channel = new types_1.BasedVoiceChannel(ch, client); else if (ch.type == v10_1.ChannelType.GuildCategory) channel = new types_1.BasedCategoryChannel(ch, client); else if (ch.type == v10_1.ChannelType.GuildForum) channel = new types_1.BasedForumChannel(ch, client); else if (ch.type == v10_1.ChannelType.PublicThread || ch.type == v10_1.ChannelType.PrivateThread || ch.type == v10_1.ChannelType.AnnouncementThread) channel = new types_1.BasedThreadChannel(ch, client); return channel; } exports.channelConvertidor = channelConvertidor; ;