disney.js 0.0.1-security → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of disney.js might be problematic. Click here for more details.
- package/LICENSE +21 -0
- package/README.md +37 -3
- package/dist/client/bot.d.ts +10 -0
- package/dist/client/connection.d.ts +12 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/interface.d.ts +19 -0
- package/dist/client/message.client.d.ts +4 -0
- package/dist/disney.js.cjs.development.js +1872 -0
- package/dist/disney.js.cjs.development.js.map +1 -0
- package/dist/disney.js.cjs.production.min.js +2 -0
- package/dist/disney.js.cjs.production.min.js.map +1 -0
- package/dist/disney.js.esm.js +1859 -0
- package/dist/disney.js.esm.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +8 -0
- package/dist/services/channel/channel.dto.d.ts +2 -0
- package/dist/services/channel/channel.service.d.ts +25 -0
- package/dist/services/index.d.ts +9 -0
- package/dist/services/interface.d.ts +9 -0
- package/dist/services/message/action.service.d.ts +34 -0
- package/dist/services/message/button.service.d.ts +22 -0
- package/dist/services/message/message.builder.d.ts +11 -0
- package/dist/services/message/message.dto.d.ts +10 -0
- package/dist/services/message/message.service.d.ts +30 -0
- package/dist/services/message/select.service.d.ts +34 -0
- package/dist/services/worker.d.ts +12 -0
- package/dist/shared/config.d.ts +3 -0
- package/dist/shared/entities/action.entity.d.ts +11 -0
- package/dist/shared/entities/bot.entity.d.ts +16 -0
- package/dist/shared/entities/button.entity.d.ts +16 -0
- package/dist/shared/entities/channel.entity.d.ts +14 -0
- package/dist/shared/entities/channelCategory.entity.d.ts +8 -0
- package/dist/shared/entities/command.entity.d.ts +8 -0
- package/dist/shared/entities/emoji.entity.d.ts +9 -0
- package/dist/shared/entities/guild.entity.d.ts +13 -0
- package/dist/shared/entities/index.d.ts +14 -0
- package/dist/shared/entities/member.entity.d.ts +20 -0
- package/dist/shared/entities/message.entity.d.ts +13 -0
- package/dist/shared/entities/option.entity.d.ts +7 -0
- package/dist/shared/entities/react.entity.d.ts +9 -0
- package/dist/shared/entities/role.entity.d.ts +14 -0
- package/dist/shared/entities/select.entity.d.ts +14 -0
- package/dist/shared/entities/user.entity.d.ts +14 -0
- package/dist/shared/entities/userBeFriend.entity.d.ts +12 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/socket/emit.d.ts +59 -0
- package/dist/shared/socket/error.dto.d.ts +3 -0
- package/dist/shared/socket/event.d.ts +59 -0
- package/dist/shared/socket/namespace.d.ts +14 -0
- package/package.json +76 -3
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"disney.js.esm.js","sources":["../src/services/interface.ts","../src/services/worker.ts","../src/shared/socket/event.ts","../src/shared/socket/namespace.ts","../src/shared/socket/emit.ts","../src/services/message/action.service.ts","../src/services/message/message.service.ts","../src/services/message/message.builder.ts","../src/shared/entities/button.entity.ts","../src/services/message/button.service.ts","../src/shared/entities/select.entity.ts","../src/services/message/select.service.ts","../src/services/channel/channel.service.ts","../src/shared/config.ts","../src/shared/entities/userBeFriend.entity.ts","../src/client/bot.ts","../src/client/connection.ts","../src/client/interface.ts","../src/client/message.client.ts"],"sourcesContent":["import { Worker } from './worker';\n\nexport abstract class Service {\n protected _route!: string;\n private _worker!: Worker;\n\n public setWorker(worker: Worker) {\n this._worker = worker;\n return this\n }\n\n protected get worker() {\n if (!this._worker) throw new Error('Worker is not initialized');\n return this._worker;\n }\n\n public get guild() {\n if (!this._worker) throw new Error('Worker is not initialized');\n return this.worker.guild;\n }\n\n public abstract clone(): Service\n}\n","import { Socket } from 'socket.io-client';\nimport { GuildEntity } from '../shared/entities/guild.entity';\nimport { MemberEntity } from '../shared/entities/member.entity';\n\nexport class Worker {\n constructor(\n private _connection: Socket,\n private _botMember: MemberEntity,\n private _guild: GuildEntity\n ) {}\n\n public get connection() {\n return this._connection;\n }\n\n public get botMember() {\n return this._botMember;\n }\n\n public get guild() {\n return this._guild;\n }\n}\n","export enum UserSocketEvent {\n ONLINE = 'online',\n UPDATE_PROFILE = 'updateProfile',\n ADD_FRIEND = 'addFriend',\n ACCEPT_FRIEND = 'acceptFriend',\n BLOCK_FRIEND = 'blockFriend',\n}\n\nexport enum GuildSocketEvent {\n CREATE = 'create',\n UPDATE = 'update',\n GET_ONE = 'getOne',\n GET_JOINED = 'getJoined',\n DELETE = 'delete',\n}\n\nexport enum MemberSocketEvent {\n GET_JOINED = 'getJoined',\n ONLINE = 'online',\n UPDATE = 'update',\n USER_JOIN = 'userJoin',\n BOT_JOIN = 'botJoin',\n LEAVE = 'leave',\n}\n\nexport enum ChannelCtgSocketEvent {\n CREATE = 'create',\n UPDATE = 'update',\n DELETE = 'delete',\n}\n\nexport enum ChannelSocketEvent {\n CREATE = 'create',\n UPDATE = 'update',\n DELETE = 'delete',\n\n ADD_MEMBER = 'addMember',\n REMOVE_MEMBER = 'removeMember',\n}\n\nexport enum RoleSocketEvent {\n CREATE = 'create',\n UPDATE = 'update',\n DELETE = 'delete',\n\n ADD_TO_MEMBER = 'addToMember',\n REMOVE_FROM_MEMBER = 'removeFromMember',\n ADD_TO_CHANNEL = 'addToChannel',\n REMOVE_FROM_CHANNEL = 'removeFromChannel',\n}\n\nexport enum MessageSocketEvent {\n FIND = 'find',\n CREATE = 'create',\n UPDATE = 'update',\n DELETE = 'delete',\n}\n\nexport enum EmojiSocketEvent {\n CREATE = 'create',\n UPDATE = 'update',\n DELETE = 'delete',\n}\n\nexport enum ReactSocketEvent {\n CREATE = 'create',\n UPDATE = 'update',\n DELETE = 'delete',\n}\n\n","export enum SocketNamespace {\n USER = 'user',\n\n GUILD = 'guild',\n CHANNEL = 'channel',\n CHANNEL_CATEGORY = 'channel-category',\n MEMBER = 'member',\n ROLE = 'role',\n\n EMOJI = 'emoji',\n REACT = 'react',\n MESSAGE = 'message',\n BUTTON = 'button',\n ACTION = 'action',\n SELECT = 'select',\n}\n","export enum UserSocketEmit {\n ONLINE = 'online',\n UPDATE_PROFILE = 'updateProfile',\n ADD_FRIEND = 'addFriend',\n ACCEPT_FRIEND = 'acceptFriend',\n BLOCK_FRIEND = 'blockFriend',\n}\n\nexport enum GuildSocketEmit {\n UPDATE = 'update',\n DELETE = 'delete',\n}\n\nexport enum MemberSocketEmit {\n JOIN = 'join',\n LEAVE = 'leave',\n UPDATE = 'ipdate',\n ONLINE = 'online',\n}\n\nexport enum ChannelCtgSocketEmit {\n CREATE = 'create',\n UPDATE = 'update',\n DELETE = 'delete',\n}\n\nexport enum ChannelSocketEmit {\n CREATE = 'create',\n UPDATE = 'update',\n DELETE = 'delete',\n\n ADD_MEMBER = 'addMember',\n REMOVE_MEMBER = 'removeMember',\n}\n\nexport enum RoleSocketEmit {\n CREATE = 'create',\n UPDATE = 'update',\n DELETE = 'delete',\n\n ADD_TO_MEMBER = 'addToMember',\n REMOVE_FROM_MEMBER = 'removeFromMember',\n ADD_TO_CHANNEL = 'addToChannel',\n REMOVE_FROM_CHANNEL = 'removeFromChannel',\n}\n\nexport enum MessageSocketEmit {\n CREATE = 'create',\n UPDATE = 'update',\n DELETE = 'delete',\n}\n\nexport enum EmojiSocketEmit {\n CREATE = 'create',\n UPDATE = 'update',\n DELETE = 'delete',\n}\n\nexport enum ReactSocketEmit {\n CREATE = 'create',\n UPDATE = 'update',\n DELETE = 'delete',\n}\n\nexport enum ButtonSocketEmit {\n CLICK = 'click',\n}\n\nexport enum SelectSocketEmit{\n SELECT = 'select'\n}\n","import { Connection } from \"../../client\";\r\nimport { EmojiEntity, ReactEntity } from \"../../shared\";\r\nimport { ButtonEntity } from \"../../shared/entities/button.entity\";\r\nimport { SelectEntity } from \"../../shared/entities/select.entity\";\r\nimport { ButtonSocketEmit, ReactSocketEmit, SelectSocketEmit } from \"../../shared/socket/emit\";\r\nimport { SocketNamespace } from \"../../shared/socket/namespace\";\r\nimport { ButtonInteraction, MessageButton } from \"./button.service\";\r\nimport { MessageSelect, SelectInteraction } from \"./select.service\";\r\n\r\n\r\nexport class MessageAction{\r\n private buttons: Partial<ButtonEntity>[] = [];\r\n private reacts: Partial<ReactEntity>[] = [];\r\n private selects: Partial<SelectEntity>[] = [];\r\n private _actionId!: string\r\n private _connection!: Connection\r\n\r\n clearButton() {\r\n this.buttons = []\r\n return this\r\n }\r\n clearReact(){\r\n this.reacts = []\r\n return this\r\n }\r\n clearSelect() {\r\n this.selects = []\r\n return this\r\n }\r\n clearAction() {\r\n this.clearButton()\r\n this.clearReact()\r\n this.clearSelect()\r\n return this\r\n }\r\n\r\n addButton(button: MessageButton) {\r\n this.buttons.push(button.getData());\r\n return this\r\n }\r\n addButtons(buttons: MessageButton[]) {\r\n this.buttons = this.buttons.concat(buttons.map(button => button.getData()))\r\n return this\r\n }\r\n \r\n\r\n addReact(emoji: EmojiEntity) {\r\n this.reacts.push({\r\n emoji,\r\n })\r\n return this\r\n }\r\n addReacts(emojis: EmojiEntity[]) {\r\n this.reacts = this.reacts.concat(emojis.map(emoji => ({\r\n emoji,\r\n })))\r\n return this\r\n }\r\n\r\n addSelect(select: MessageSelect) {\r\n this.selects.push(select.getData())\r\n return this\r\n }\r\n\r\n getData() {\r\n return {\r\n buttons: this.buttons,\r\n reacts: this.reacts,\r\n selects: this.selects,\r\n }\r\n }\r\n\r\n setId(id: string) {\r\n this._actionId = id\r\n return this\r\n }\r\n setConnection(connection: Connection) {\r\n this._connection = connection\r\n return this\r\n }\r\n\r\n onButtonClick(callback: (interaction: ButtonInteraction) => void) {\r\n this.checkId()\r\n this._connection.button.on(`${this._actionId}/${SocketNamespace.BUTTON}/${ButtonSocketEmit.CLICK}`, (interaction:ButtonInteraction) => {\r\n callback(interaction)\r\n })\r\n }\r\n\r\n onReactCreate(callback: (react: ReactEntity) => void) {\r\n this.checkId()\r\n this._connection.react.on(`${this._actionId}/${SocketNamespace.REACT}/${ReactSocketEmit.CREATE}`, (react: ReactEntity) => {\r\n callback(react)\r\n })\r\n }\r\n\r\n onReactDelete(callback: (react: ReactEntity) => void) {\r\n this.checkId()\r\n this._connection.react.on(`${this._actionId}/${SocketNamespace.REACT}/${ReactSocketEmit.DELETE}`, (react: ReactEntity) => {\r\n callback(react)\r\n })\r\n }\r\n\r\n onSelect(callback: (interaction: SelectInteraction) => void) {\r\n this.checkId()\r\n this._connection.select.on(`${this._actionId}/${SocketNamespace.SELECT}/${SelectSocketEmit.SELECT}`, (interaction: SelectInteraction) => {\r\n callback(interaction)\r\n })\r\n }\r\n\r\n private checkId() {\r\n if (!this._actionId) throw new Error('Listener must be start in advance the message sent')\r\n }\r\n}","import { Connection } from '../../client';\nimport { Client } from '../../client/interface';\nimport { ActionEntity, GuildEntity, MessageEntity } from '../../shared/entities';\nimport { MessageSocketEvent } from '../../shared/socket/event';\nimport { SocketNamespace } from '../../shared/socket/namespace';\nimport { Service } from '../interface';\nimport { Worker } from '../worker';\nimport { MessageAction } from './action.service';\nimport { BotInputMessage, InspectedCommand } from './message.dto';\n\nexport class MessageService extends Service {\n private _message!: MessageEntity;\n private _action: MessageAction;\n private _inspectedCommand!: InspectedCommand;\n\n constructor(private _client: Client, private _connection: Connection, initMessage?: MessageEntity) {\n super();\n this._route = `${_client.bot.info.botId}/${SocketNamespace.MESSAGE}`;\n if (initMessage) {\n this._message = initMessage\n }\n\n this._action = new MessageAction();\n }\n\n\n onCreate(callback: (props: { worker: Worker }) => void): void {\n this._connection.message.on(\n `${this._route}/create`,\n (\n message: MessageEntity,\n inspectedCommand: InspectedCommand,\n guild: GuildEntity\n ) => {\n const member = this._client.bot.info.joinedGuilds.find(\n g => g.guild.guildId === guild.guildId\n );\n\n if (!member) {\n throw new Error('Bot is not in this guild');\n }\n\n this._inspectedCommand = inspectedCommand;\n this._message = message;\n\n const worker = new Worker(this._connection.message, member, guild);\n\n this.setWorker(worker);\n\n callback({ worker });\n }\n );\n }\n\n onUpdate(callback: (args: Partial<MessageEntity>) => void): void {\n this._connection.message.on(`${this._route}/update`, callback);\n }\n\n onDelete(callback: (id: string) => void): void {\n this._connection.message.on(`${this._route}/delete`, callback);\n }\n\n\n async send(message: BotInputMessage) {\n const m = await new Promise<MessageEntity>(resolve => {\n this._connection.message.emit(MessageSocketEvent.CREATE, {\n message:{...message, action:this._action.getData()},\n channel: this._message.channel,\n member: this.worker.botMember,\n memberId: this.worker.botMember.memberId,\n }, (m: MessageEntity) => resolve(m));\n })\n this.updateAction(m.action)\n\n return this.clone().setMessage(m)\n }\n\n async edit(message: BotInputMessage) {\n const m = await new Promise<MessageEntity>(resolve => {\n this._connection.message.emit(MessageSocketEvent.UPDATE, {\n message: {\n ...message,\n action:message.action?.getData(),\n messageId: this._message.messageId,\n },\n memberId: this.worker.botMember.memberId,\n }, (m: MessageEntity) => resolve(m));\n })\n this.updateAction(m.action)\n\n return this.clone().setMessage(m)\n\n }\n\n public async reply(message: BotInputMessage) {\n const m = await new Promise<MessageEntity>(resolve => {\n this._connection.message.emit(MessageSocketEvent.CREATE, {\n message: {\n ...message,\n action:message.action?.getData(),\n messageId: this._message.messageId,\n },\n member: this.worker.botMember,\n replyTo: this._message.messageId,\n memberId: this.worker.botMember.memberId,\n }, (m: MessageEntity) => resolve(m));\n })\n this.updateAction(m.action)\n\n return this.clone().setMessage(m)\n }\n\n public setMessage(message: MessageEntity) {\n this._message = message\n return this\n }\n public setAction(action:MessageAction) {\n this._action = action\n }\n public updateAction(action: ActionEntity) {\n this._action.setId(action.actionId).setConnection(this._connection);\n }\n public get data() {\n if (!this._message) throw new Error('Message is not initialized');\n return this._message;\n }\n\n public get command() {\n return this._inspectedCommand;\n }\n\n public get action() {\n return this._action\n }\n\n clone() {\n const newService = new MessageService(this._client, this._connection);\n newService.setWorker(this.worker);\n newService.setMessage(this._message);\n newService._action = this._action;\n return newService\n }\n}\n","import { stripIndent } from 'common-tags';\n\nexport class MarkdownBuilder {\n static bold(text: string): string {\n return `**${text}**`;\n }\n static italic(text: string): string {\n return `*${text}*`;\n }\n static underline(text: string): string {\n return `__${text}__`;\n }\n static strikethrough(text: string): string {\n return `~~${text}~~`;\n }\n static inlineCode(text: string): string {\n return `\\`${text}\\``;\n }\n static codeBlock(text: string, language?: string): string {\n if (language) {\n return `\\`\\`\\`${language}\\n${text}\\n\\`\\`\\``;\n }\n return `\\`\\`\\`${text}\\`\\`\\``;\n }\n static get tag() {\n return stripIndent;\n }\n static link(text: string, url: string): string {\n return `[${text}](${url})`;\n }\n static image(text: string, url: string): string {\n return ``;\n }\n}\n","import { ActionEntity } from \"./action.entity\"\r\n\r\nexport enum ButtonStyle{\r\n PRIMARY = 'primary',\r\n SECONDARY = 'secondary',\r\n SUCCESS = 'success',\r\n WARNING = 'warning',\r\n ERROR = 'error',\r\n}\r\n\r\nexport interface ButtonEntity {\r\n buttonId: string\r\n\r\n customId: string\r\n\r\n name: string\r\n\r\n isDisabled: boolean\r\n\r\n style: ButtonStyle\r\n \r\n action: ActionEntity\r\n}\r\n","import { MemberEntity } from \"../../shared\";\r\nimport { ButtonEntity, ButtonStyle } from \"../../shared/entities/button.entity\";\r\n\r\n\r\nexport class MessageButton{\r\n private _name!: string;\r\n private _customId!: string;\r\n private _isDisabled!: boolean;\r\n private _style!: ButtonStyle;\r\n\r\n setName(name: string) {\r\n this._name = name;\r\n return this\r\n }\r\n\r\n setCustomId(customId: string) {\r\n this._customId = customId;\r\n return this\r\n }\r\n setDisabled(disabled: boolean) {\r\n this._isDisabled = disabled;\r\n return this\r\n }\r\n setStyle(style: ButtonStyle) {\r\n this._style = style;\r\n return this\r\n }\r\n\r\n getData():Partial<ButtonEntity> {\r\n return {\r\n name: this._name,\r\n customId: this._customId,\r\n isDisabled: this._isDisabled,\r\n style: this._style\r\n }\r\n }\r\n public get name() {\r\n return this._name;\r\n }\r\n public get customId() {\r\n return this._customId;\r\n }\r\n public get isDisabled() {\r\n return this._isDisabled;\r\n }\r\n public get style() {\r\n return this._style;\r\n }\r\n}\r\n\r\nexport interface ButtonInteraction{\r\n button: ButtonEntity\r\n clicker?: MemberEntity\r\n}\r\n\r\n\r\nexport { ButtonStyle }\r\n","import { ActionEntity } from \"./action.entity\"\r\nimport { OptionEntity } from \"./option.entity\"\r\n\r\nexport enum SelectStyle{\r\n PRIMARY = 'primary',\r\n SECONDARY = 'secondary',\r\n}\r\n\r\nexport interface SelectEntity{\r\n selectId: string\r\n\r\n customId: string\r\n\r\n isDisabled: boolean\r\n\r\n style: SelectStyle\r\n\r\n action: ActionEntity\r\n\r\n options: Partial<OptionEntity>[]\r\n}","import { MemberEntity } from \"../../shared\";\r\nimport { OptionEntity } from \"../../shared/entities/option.entity\";\r\nimport { SelectEntity, SelectStyle } from \"../../shared/entities/select.entity\";\r\n\r\nexport class MessageSelect{\r\n private _customId!: string;\r\n private _isDisabled!: boolean;\r\n private _style!: SelectStyle;\r\n private _options: Partial<OptionEntity>[] = []\r\n\r\n clearOption() {\r\n this._options = []\r\n return this\r\n }\r\n addOption(option: MessageSelectOption) {\r\n this._options.push(option.getData())\r\n return this\r\n }\r\n addOptions(options: MessageSelectOption[]) {\r\n this._options = this._options.concat(options.map(option => option.getData()))\r\n return this\r\n }\r\n\r\n\r\n setDisabled(disabled: boolean) {\r\n this._isDisabled = disabled;\r\n return this\r\n }\r\n\r\n setStyle(style: SelectStyle) {\r\n this._style = style;\r\n return this\r\n }\r\n\r\n setCustomId(customId: string) {\r\n this._customId = customId;\r\n return this\r\n }\r\n\r\n getData(): Partial<SelectEntity> {\r\n return {\r\n customId: this._customId,\r\n isDisabled: this._isDisabled,\r\n style: this._style,\r\n options: this._options\r\n }\r\n }\r\n public get customId() {\r\n return this._customId;\r\n }\r\n public get isDisabled() {\r\n return this._isDisabled;\r\n }\r\n public get style() {\r\n return this._style;\r\n }\r\n public get options() {\r\n return this._options;\r\n }\r\n\r\n}\r\n\r\nexport class MessageSelectOption{\r\n private _description!: string;\r\n private _value!: string;\r\n\r\n setDescription(description: string) {\r\n this._description = description;\r\n return this\r\n }\r\n\r\n setValue(value: string) {\r\n this._value = value;\r\n return this\r\n }\r\n\r\n getData(): Partial<OptionEntity> {\r\n return {\r\n description: this._description,\r\n value: this._value\r\n }\r\n }\r\n\r\n public get description() {\r\n return this._description;\r\n }\r\n public get value() {\r\n return this._value;\r\n }\r\n}\r\n\r\nexport interface SelectInteraction{\r\n option: OptionEntity\r\n selector?: MemberEntity\r\n}\r\n\r\n\r\nexport { SelectStyle }\r\n","import { Connection } from '../../client';\nimport { Client } from '../../client/interface';\nimport { ChannelEntity } from '../../shared/entities';\nimport {\n ChannelSocketEvent, RoleSocketEvent\n} from '../../shared/socket/event';\nimport { Service } from '../interface';\nimport { BotInputChannel } from './channel.dto';\n\nexport class ChannelService extends Service {\n private _channel!: ChannelEntity;\n\n constructor(private _client: Client, private _connection: Connection) {\n super();\n this._route = `${_client.bot.info.botId}/message`;\n }\n\n public get data() {\n if (!this._channel) throw new Error('Channel is not initialized');\n return this._channel;\n }\n\n public withIdOrName(channelNameOrId: string) {\n const existChannel = this.worker.guild.categories\n .map(c => c.channels)\n .flat()\n .find(\n c =>\n c.name.toLowerCase() === channelNameOrId.toLowerCase() ||\n c.channelId === channelNameOrId\n );\n\n if (!existChannel) {\n throw new Error('Channel not found');\n }\n const newService = this.clone()\n newService.setChannel(existChannel);\n return newService\n }\n async update (channel: BotInputChannel) {\n this._connection.channel.emit(ChannelSocketEvent.UPDATE, {\n channel: { channelId: this._channel.channelId, ...channel },\n memberId: this.worker.botMember.memberId,\n });\n }\n async addMember (memberNicknameOrId: string) {\n await this.updateMemberOfChannel(\n ChannelSocketEvent.ADD_MEMBER,\n this._channel.channelId,\n memberNicknameOrId\n );\n }\n async removeMember (memberNicknameOrId: string) {\n await this.updateMemberOfChannel(\n ChannelSocketEvent.REMOVE_MEMBER,\n this._channel.channelId,\n memberNicknameOrId\n );\n }\n async addRole (roleNameOrId: string) {\n await this.updateRoleOfChannel(\n RoleSocketEvent.ADD_TO_CHANNEL,\n this._channel.channelId,\n roleNameOrId\n );\n }\n async removeRole (roleNameOrId: string) {\n await this.updateRoleOfChannel(\n RoleSocketEvent.REMOVE_FROM_CHANNEL,\n this._channel.channelId,\n roleNameOrId\n );\n }\n\n public setChannel(channel: ChannelEntity) {\n this._channel = channel;\n }\n\n public inCategory(categoryNameOrId: string) {\n const category = this.worker.guild.categories.find(\n c =>\n c.name.toLowerCase() === categoryNameOrId.toLowerCase() ||\n c.categoryId === categoryNameOrId\n );\n\n if (!category) {\n throw new Error('Category not found');\n }\n\n return {\n create: (channel: BotInputChannel) => {\n this._connection.channel.emit('create', {\n channel,\n category,\n firstMember: this.worker.botMember,\n memberId: this.worker.botMember.memberId,\n });\n },\n };\n }\n\n clone() {\n const newService = new ChannelService(this._client, this._connection);\n newService.setChannel(this._channel);\n newService.setWorker(this.worker);\n return newService;\n }\n\n private async updateMemberOfChannel(\n event: ChannelSocketEvent,\n channelId: string,\n memberNicknameOrId: string\n ) {\n const existMember = this.worker.guild.members.find(\n m =>\n m.nickname.toLowerCase() === memberNicknameOrId.toLowerCase() ||\n m.memberId === memberNicknameOrId\n );\n\n if (!existMember) {\n throw new Error('Member not found');\n }\n\n this._connection.channel.emit(event, {\n channel: { channelId, memberId: existMember.memberId },\n memberId: this.worker.botMember.memberId,\n });\n }\n\n private async updateRoleOfChannel(\n event: RoleSocketEvent,\n channelId: string,\n roleNameOrId: string\n ) {\n const existRole = this.worker.guild.roles.find(\n r =>\n r.name.toLowerCase() === roleNameOrId.toLowerCase() ||\n r.roleId === roleNameOrId\n );\n\n if (!existRole) {\n throw new Error('Role not found');\n }\n\n this._connection.role.emit(event, {\n channel: { channelId, roleId: existRole.roleId },\n memberId: this.worker.botMember.memberId,\n });\n }\n}\n","export class Config {\n public static readonly SERVER_HOST = 'https://c522-116-102-222-20.ap.ngrok.io';\n}\n","import { UserEntity } from './user.entity';\n\nexport enum FriendStatus {\n ACCEPTED = 'accepted',\n PENDING = 'pending',\n BLOCKED = 'blocked',\n}\n\nexport interface UserBeFriendEntity {\n id: string;\n\n status: FriendStatus;\n\n leftUser: UserEntity;\n\n rightUser: UserEntity;\n}\n","import axios from \"axios\";\r\nimport { Config } from \"../shared\";\r\nimport { BotEntity, MemberEntity } from \"../shared/entities\";\r\nimport { MemberSocketEmit } from \"../shared/socket/emit\";\r\nimport { SocketNamespace } from \"../shared/socket/namespace\";\r\nimport { Connection } from \"./connection\";\r\n\r\nexport class BotInfo {\r\n private _info!: BotEntity\r\n constructor(private _connection: Connection) {\r\n\r\n }\r\n async getInfo(token: string) {\r\n try {\r\n this._info = (\r\n await axios.get<BotEntity>(`${Config.SERVER_HOST}/bot`, {\r\n headers: { Authorization: `Bearer ${token}` },\r\n })\r\n ).data;\r\n } catch {\r\n throw new Error('Token is invalid or expired');\r\n }\r\n }\r\n\r\n listenUpdate() {\r\n this._connection.member.on(`${this._info.botId}/${SocketNamespace.MEMBER}/${MemberSocketEmit.JOIN}`, (member: MemberEntity) => {\r\n this._info.joinedGuilds.push(member);\r\n })\r\n this._connection.member.on(`${this._info.botId}/${SocketNamespace.MEMBER}/${MemberSocketEmit.LEAVE}`, (member: MemberEntity) => {\r\n this._info.joinedGuilds = this._info.joinedGuilds.filter(m => m.memberId !== member.memberId);\r\n })\r\n }\r\n\r\n public get info() {\r\n return this._info;\r\n }\r\n}","import { Manager, Socket } from 'socket.io-client';\nimport { SocketNamespace } from '../shared/socket/namespace';\n\nexport class Connection {\n readonly message!: Socket;\n readonly channel!: Socket;\n readonly role!: Socket;\n readonly member!: Socket;\n readonly action!: Socket;\n readonly button!: Socket;\n readonly select!: Socket;\n readonly react!: Socket;\n constructor(gateway: Manager) {\n this.message = gateway.socket(`/${SocketNamespace.MESSAGE}`);\n this.channel = gateway.socket(`/${SocketNamespace.CHANNEL}`);\n this.role = gateway.socket(`/${SocketNamespace.ROLE}`);\n this.member = gateway.socket(`/${SocketNamespace.MEMBER}`);\n this.action = gateway.socket(`/${SocketNamespace.ACTION}`);\n this.button = gateway.socket(`/${SocketNamespace.BUTTON}`);\n this.react = gateway.socket(`/${SocketNamespace.REACT}`);\n this.select = gateway.socket(`/${SocketNamespace.SELECT}`);\n }\n}\n","import { Manager } from 'socket.io-client';\nimport { ChannelService, MessageService } from '../services';\nimport { Config } from '../shared';\nimport { BotInfo } from './bot';\nimport { Connection } from './connection';\n\nexport abstract class Client {\n private _connection!: Connection;\n private _accessToken!: string;\n private _gateway!: Manager;\n private _bot!: BotInfo;\n\n private _messageService!: MessageService;\n private _channalService!: ChannelService;\n\n constructor() {}\n\n async login(token: string) {\n try {\n this._accessToken = token;\n \n this._gateway = new Manager(Config.SERVER_HOST, {\n transportOptions: {\n polling: {\n extraHeaders: { authorization: `Bearer ${this._accessToken}` },\n },\n },\n });\n\n this._connection = new Connection(this._gateway);\n\n this._bot = new BotInfo(this._connection);\n await this._bot.getInfo(this._accessToken);\n this._bot.listenUpdate()\n\n this._messageService = new MessageService(this, this._connection);\n this._channalService = new ChannelService(this, this._connection);\n console.log('💖 Login successfully');\n\n //validate commands which user created to bot manager\n for (const command of this._bot.info.commands) {\n if (!(this as any)[command.name as any]) {\n throw new Error(\n `${this._bot.info.name}.[${command.name}] command is not implemented`\n );\n }\n }\n } catch (e) {\n console.error(e);\n }\n }\n\n /**@return message received: MessageEntity */\n public get message() {\n if (!this._messageService)\n throw new Error('Message Service is not initialized');\n return this._messageService;\n }\n\n public set message(messageService: MessageService) {\n this._messageService = messageService;\n }\n\n /**@return channel which received message: ChannelEntity */\n public get channel() {\n if (!this._channalService)\n throw new Error('Channel Service is not initialized');\n\n return this._channalService;\n }\n\n /**@return currentBot: BotEntity */\n public get bot() {\n if (!this._bot) throw new Error('Bot is not identified');\n\n return this._bot;\n }\n\n // public get onCreateMessage() {\n // return this.msgService.onCreate;\n // }\n}\n","import { MessageAction } from '../services';\nimport { Client } from './interface';\n\nexport class MessageClient extends Client {\n async login(token: string) {\n await super.login(token);\n\n this.message.onCreate(({ worker }) => {\n this.message.setWorker(worker);\n this.message.setAction(new MessageAction());\n\n this.channel.setWorker(worker);\n this.channel.setChannel(this.message.data.channel);\n\n this.bot.info.commands.forEach(command => {\n const { name, args } = this.message.command;\n if (\n name &&\n args &&\n command.name === name &&\n command.args.length === args.length\n ) {\n (this as any)[command.name as any](...args);\n }\n });\n });\n }\n}\n"],"names":["Service","setWorker","worker","_worker","Error","guild","Worker","_connection","_botMember","_guild","UserSocketEvent","GuildSocketEvent","MemberSocketEvent","ChannelCtgSocketEvent","ChannelSocketEvent","RoleSocketEvent","MessageSocketEvent","EmojiSocketEvent","ReactSocketEvent","SocketNamespace","UserSocketEmit","GuildSocketEmit","MemberSocketEmit","ChannelCtgSocketEmit","ChannelSocketEmit","RoleSocketEmit","MessageSocketEmit","EmojiSocketEmit","ReactSocketEmit","ButtonSocketEmit","SelectSocketEmit","MessageAction","clearButton","buttons","clearReact","reacts","clearSelect","selects","clearAction","addButton","button","push","getData","addButtons","concat","map","addReact","emoji","addReacts","emojis","addSelect","select","setId","id","_actionId","setConnection","connection","onButtonClick","callback","checkId","on","BUTTON","CLICK","interaction","onReactCreate","react","REACT","CREATE","onReactDelete","DELETE","onSelect","SELECT","MessageService","_client","initMessage","_route","bot","info","botId","MESSAGE","_message","_action","onCreate","message","inspectedCommand","member","joinedGuilds","find","g","guildId","_inspectedCommand","onUpdate","onDelete","send","Promise","resolve","emit","action","channel","botMember","memberId","m","updateAction","clone","setMessage","edit","UPDATE","messageId","reply","replyTo","setAction","actionId","newService","MarkdownBuilder","bold","text","italic","underline","strikethrough","inlineCode","codeBlock","language","link","url","image","stripIndent","ButtonStyle","MessageButton","setName","name","_name","setCustomId","customId","_customId","setDisabled","disabled","_isDisabled","setStyle","style","_style","isDisabled","SelectStyle","MessageSelect","clearOption","_options","addOption","option","addOptions","options","MessageSelectOption","setDescription","description","_description","setValue","value","_value","ChannelService","withIdOrName","channelNameOrId","existChannel","categories","c","channels","flat","toLowerCase","channelId","setChannel","update","_channel","addMember","memberNicknameOrId","updateMemberOfChannel","ADD_MEMBER","removeMember","REMOVE_MEMBER","addRole","roleNameOrId","updateRoleOfChannel","ADD_TO_CHANNEL","removeRole","REMOVE_FROM_CHANNEL","inCategory","categoryNameOrId","category","categoryId","create","firstMember","event","existMember","members","nickname","existRole","roles","r","roleId","role","Config","FriendStatus","BotInfo","getInfo","token","axios","get","SERVER_HOST","headers","Authorization","_info","data","listenUpdate","MEMBER","JOIN","LEAVE","filter","Connection","gateway","socket","CHANNEL","ROLE","ACTION","Client","login","_accessToken","_gateway","Manager","transportOptions","polling","extraHeaders","authorization","_bot","_messageService","_channalService","console","log","commands","command","error","messageService","MessageClient","forEach","args","length"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEsBA,OAAtB;EAAA;;EAAA;;EAAA,OAISC,SAJT,GAIS,mBAAUC,MAAV;IACL,KAAKC,OAAL,GAAeD,MAAf;IACA,OAAO,IAAP;GANJ;;EAAA;IAAA;IAAA,KASE;MACE,IAAI,CAAC,KAAKC,OAAV,EAAmB,MAAM,IAAIC,KAAJ,CAAU,2BAAV,CAAN;MACnB,OAAO,KAAKD,OAAZ;;;IAXJ;IAAA,KAcE;MACE,IAAI,CAAC,KAAKA,OAAV,EAAmB,MAAM,IAAIC,KAAJ,CAAU,2BAAV,CAAN;MACnB,OAAO,KAAKF,MAAL,CAAYG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KAAY,CAACN,OAAO,CAACzG,IAAT,CAAZ,YAAY,EAAyB8G,IAAzB,CAAZ;;iBARL;eAPF;;YAHF;YAAA;cAAA;;;;KADF;;IAAA;MAAA;;;IAAA;;;EAAA;AAAA,EAAmCpB,MAAnC;;;;"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
import { Connection } from '../../client';
|
2
|
+
import { Client } from '../../client/interface';
|
3
|
+
import { ChannelEntity } from '../../shared/entities';
|
4
|
+
import { Service } from '../interface';
|
5
|
+
import { BotInputChannel } from './channel.dto';
|
6
|
+
export declare class ChannelService extends Service {
|
7
|
+
private _client;
|
8
|
+
private _connection;
|
9
|
+
private _channel;
|
10
|
+
constructor(_client: Client, _connection: Connection);
|
11
|
+
get data(): ChannelEntity;
|
12
|
+
withIdOrName(channelNameOrId: string): ChannelService;
|
13
|
+
update(channel: BotInputChannel): Promise<void>;
|
14
|
+
addMember(memberNicknameOrId: string): Promise<void>;
|
15
|
+
removeMember(memberNicknameOrId: string): Promise<void>;
|
16
|
+
addRole(roleNameOrId: string): Promise<void>;
|
17
|
+
removeRole(roleNameOrId: string): Promise<void>;
|
18
|
+
setChannel(channel: ChannelEntity): void;
|
19
|
+
inCategory(categoryNameOrId: string): {
|
20
|
+
create: (channel: BotInputChannel) => void;
|
21
|
+
};
|
22
|
+
clone(): ChannelService;
|
23
|
+
private updateMemberOfChannel;
|
24
|
+
private updateRoleOfChannel;
|
25
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
export * from './interface';
|
2
|
+
export * from './worker';
|
3
|
+
export * from './message/message.service';
|
4
|
+
export * from './message/message.builder';
|
5
|
+
export * from './message/message.dto';
|
6
|
+
export * from './message/action.service';
|
7
|
+
export * from './message/button.service';
|
8
|
+
export * from './message/select.service';
|
9
|
+
export * from './channel/channel.service';
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Worker } from './worker';
|
2
|
+
export declare abstract class Service {
|
3
|
+
protected _route: string;
|
4
|
+
private _worker;
|
5
|
+
setWorker(worker: Worker): this;
|
6
|
+
protected get worker(): Worker;
|
7
|
+
get guild(): import("..").GuildEntity;
|
8
|
+
abstract clone(): Service;
|
9
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { Connection } from "../../client";
|
2
|
+
import { EmojiEntity, ReactEntity } from "../../shared";
|
3
|
+
import { ButtonEntity } from "../../shared/entities/button.entity";
|
4
|
+
import { SelectEntity } from "../../shared/entities/select.entity";
|
5
|
+
import { ButtonInteraction, MessageButton } from "./button.service";
|
6
|
+
import { MessageSelect, SelectInteraction } from "./select.service";
|
7
|
+
export declare class MessageAction {
|
8
|
+
private buttons;
|
9
|
+
private reacts;
|
10
|
+
private selects;
|
11
|
+
private _actionId;
|
12
|
+
private _connection;
|
13
|
+
clearButton(): this;
|
14
|
+
clearReact(): this;
|
15
|
+
clearSelect(): this;
|
16
|
+
clearAction(): this;
|
17
|
+
addButton(button: MessageButton): this;
|
18
|
+
addButtons(buttons: MessageButton[]): this;
|
19
|
+
addReact(emoji: EmojiEntity): this;
|
20
|
+
addReacts(emojis: EmojiEntity[]): this;
|
21
|
+
addSelect(select: MessageSelect): this;
|
22
|
+
getData(): {
|
23
|
+
buttons: Partial<ButtonEntity>[];
|
24
|
+
reacts: Partial<ReactEntity>[];
|
25
|
+
selects: Partial<SelectEntity>[];
|
26
|
+
};
|
27
|
+
setId(id: string): this;
|
28
|
+
setConnection(connection: Connection): this;
|
29
|
+
onButtonClick(callback: (interaction: ButtonInteraction) => void): void;
|
30
|
+
onReactCreate(callback: (react: ReactEntity) => void): void;
|
31
|
+
onReactDelete(callback: (react: ReactEntity) => void): void;
|
32
|
+
onSelect(callback: (interaction: SelectInteraction) => void): void;
|
33
|
+
private checkId;
|
34
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { MemberEntity } from "../../shared";
|
2
|
+
import { ButtonEntity, ButtonStyle } from "../../shared/entities/button.entity";
|
3
|
+
export declare class MessageButton {
|
4
|
+
private _name;
|
5
|
+
private _customId;
|
6
|
+
private _isDisabled;
|
7
|
+
private _style;
|
8
|
+
setName(name: string): this;
|
9
|
+
setCustomId(customId: string): this;
|
10
|
+
setDisabled(disabled: boolean): this;
|
11
|
+
setStyle(style: ButtonStyle): this;
|
12
|
+
getData(): Partial<ButtonEntity>;
|
13
|
+
get name(): string;
|
14
|
+
get customId(): string;
|
15
|
+
get isDisabled(): boolean;
|
16
|
+
get style(): ButtonStyle;
|
17
|
+
}
|
18
|
+
export interface ButtonInteraction {
|
19
|
+
button: ButtonEntity;
|
20
|
+
clicker?: MemberEntity;
|
21
|
+
}
|
22
|
+
export { ButtonStyle };
|
@@ -0,0 +1,11 @@
|
|
1
|
+
export declare class MarkdownBuilder {
|
2
|
+
static bold(text: string): string;
|
3
|
+
static italic(text: string): string;
|
4
|
+
static underline(text: string): string;
|
5
|
+
static strikethrough(text: string): string;
|
6
|
+
static inlineCode(text: string): string;
|
7
|
+
static codeBlock(text: string, language?: string): string;
|
8
|
+
static get tag(): import("common-tags").TemplateTag;
|
9
|
+
static link(text: string, url: string): string;
|
10
|
+
static image(text: string, url: string): string;
|
11
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { MessageEntity } from '../../shared/entities';
|
2
|
+
import { MessageAction } from './action.service';
|
3
|
+
export interface InspectedCommand {
|
4
|
+
botName: string;
|
5
|
+
name: string;
|
6
|
+
args: string[];
|
7
|
+
}
|
8
|
+
export declare type BotInputMessage = Partial<Pick<MessageEntity, 'content' | 'images'>> & {
|
9
|
+
action?: MessageAction;
|
10
|
+
};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { Connection } from '../../client';
|
2
|
+
import { Client } from '../../client/interface';
|
3
|
+
import { ActionEntity, MessageEntity } from '../../shared/entities';
|
4
|
+
import { Service } from '../interface';
|
5
|
+
import { Worker } from '../worker';
|
6
|
+
import { MessageAction } from './action.service';
|
7
|
+
import { BotInputMessage, InspectedCommand } from './message.dto';
|
8
|
+
export declare class MessageService extends Service {
|
9
|
+
private _client;
|
10
|
+
private _connection;
|
11
|
+
private _message;
|
12
|
+
private _action;
|
13
|
+
private _inspectedCommand;
|
14
|
+
constructor(_client: Client, _connection: Connection, initMessage?: MessageEntity);
|
15
|
+
onCreate(callback: (props: {
|
16
|
+
worker: Worker;
|
17
|
+
}) => void): void;
|
18
|
+
onUpdate(callback: (args: Partial<MessageEntity>) => void): void;
|
19
|
+
onDelete(callback: (id: string) => void): void;
|
20
|
+
send(message: BotInputMessage): Promise<MessageService>;
|
21
|
+
edit(message: BotInputMessage): Promise<MessageService>;
|
22
|
+
reply(message: BotInputMessage): Promise<MessageService>;
|
23
|
+
setMessage(message: MessageEntity): this;
|
24
|
+
setAction(action: MessageAction): void;
|
25
|
+
updateAction(action: ActionEntity): void;
|
26
|
+
get data(): MessageEntity;
|
27
|
+
get command(): InspectedCommand;
|
28
|
+
get action(): MessageAction;
|
29
|
+
clone(): MessageService;
|
30
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { MemberEntity } from "../../shared";
|
2
|
+
import { OptionEntity } from "../../shared/entities/option.entity";
|
3
|
+
import { SelectEntity, SelectStyle } from "../../shared/entities/select.entity";
|
4
|
+
export declare class MessageSelect {
|
5
|
+
private _customId;
|
6
|
+
private _isDisabled;
|
7
|
+
private _style;
|
8
|
+
private _options;
|
9
|
+
clearOption(): this;
|
10
|
+
addOption(option: MessageSelectOption): this;
|
11
|
+
addOptions(options: MessageSelectOption[]): this;
|
12
|
+
setDisabled(disabled: boolean): this;
|
13
|
+
setStyle(style: SelectStyle): this;
|
14
|
+
setCustomId(customId: string): this;
|
15
|
+
getData(): Partial<SelectEntity>;
|
16
|
+
get customId(): string;
|
17
|
+
get isDisabled(): boolean;
|
18
|
+
get style(): SelectStyle;
|
19
|
+
get options(): Partial<OptionEntity>[];
|
20
|
+
}
|
21
|
+
export declare class MessageSelectOption {
|
22
|
+
private _description;
|
23
|
+
private _value;
|
24
|
+
setDescription(description: string): this;
|
25
|
+
setValue(value: string): this;
|
26
|
+
getData(): Partial<OptionEntity>;
|
27
|
+
get description(): string;
|
28
|
+
get value(): string;
|
29
|
+
}
|
30
|
+
export interface SelectInteraction {
|
31
|
+
option: OptionEntity;
|
32
|
+
selector?: MemberEntity;
|
33
|
+
}
|
34
|
+
export { SelectStyle };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Socket } from 'socket.io-client';
|
2
|
+
import { GuildEntity } from '../shared/entities/guild.entity';
|
3
|
+
import { MemberEntity } from '../shared/entities/member.entity';
|
4
|
+
export declare class Worker {
|
5
|
+
private _connection;
|
6
|
+
private _botMember;
|
7
|
+
private _guild;
|
8
|
+
constructor(_connection: Socket, _botMember: MemberEntity, _guild: GuildEntity);
|
9
|
+
get connection(): Socket<import("@socket.io/component-emitter").DefaultEventsMap, import("@socket.io/component-emitter").DefaultEventsMap>;
|
10
|
+
get botMember(): MemberEntity;
|
11
|
+
get guild(): GuildEntity;
|
12
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { ButtonEntity } from "./button.entity";
|
2
|
+
import { MessageEntity } from "./message.entity";
|
3
|
+
import { ReactEntity } from "./react.entity";
|
4
|
+
import { SelectEntity } from "./select.entity";
|
5
|
+
export interface ActionEntity {
|
6
|
+
actionId: string;
|
7
|
+
reacts: Partial<ReactEntity>[];
|
8
|
+
buttons: Partial<ButtonEntity>[];
|
9
|
+
selects: Partial<SelectEntity>[];
|
10
|
+
message: MessageEntity;
|
11
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { CommandEntity } from './command.entity';
|
2
|
+
import { MemberEntity } from './member.entity';
|
3
|
+
import { Permission } from './role.entity';
|
4
|
+
import { UserEntity } from './user.entity';
|
5
|
+
export interface BotEntity {
|
6
|
+
botId: string;
|
7
|
+
name: string;
|
8
|
+
description: string;
|
9
|
+
avatarUrl: string;
|
10
|
+
isListening: boolean;
|
11
|
+
author: UserEntity;
|
12
|
+
secretKey: string;
|
13
|
+
joinedGuilds: MemberEntity[];
|
14
|
+
commands: CommandEntity[];
|
15
|
+
requiredPermissions: Permission[];
|
16
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { ActionEntity } from "./action.entity";
|
2
|
+
export declare enum ButtonStyle {
|
3
|
+
PRIMARY = "primary",
|
4
|
+
SECONDARY = "secondary",
|
5
|
+
SUCCESS = "success",
|
6
|
+
WARNING = "warning",
|
7
|
+
ERROR = "error"
|
8
|
+
}
|
9
|
+
export interface ButtonEntity {
|
10
|
+
buttonId: string;
|
11
|
+
customId: string;
|
12
|
+
name: string;
|
13
|
+
isDisabled: boolean;
|
14
|
+
style: ButtonStyle;
|
15
|
+
action: ActionEntity;
|
16
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { ChannelCategoryEntity } from './channelCategory.entity';
|
2
|
+
import { MemberEntity } from './member.entity';
|
3
|
+
import { MessageEntity } from './message.entity';
|
4
|
+
import { RoleEntity } from './role.entity';
|
5
|
+
export interface ChannelEntity {
|
6
|
+
channelId: string;
|
7
|
+
name: string;
|
8
|
+
isPrivate: boolean;
|
9
|
+
/** @relationship */
|
10
|
+
messages: MessageEntity[];
|
11
|
+
members: MemberEntity[];
|
12
|
+
category: ChannelCategoryEntity;
|
13
|
+
roles: RoleEntity[];
|
14
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { ChannelCategoryEntity } from './channelCategory.entity';
|
2
|
+
import { EmojiEntity } from './emoji.entity';
|
3
|
+
import { MemberEntity } from './member.entity';
|
4
|
+
import { RoleEntity } from './role.entity';
|
5
|
+
export interface GuildEntity {
|
6
|
+
guildId: string;
|
7
|
+
name: string;
|
8
|
+
avatarUrl: string;
|
9
|
+
members: MemberEntity[];
|
10
|
+
roles: RoleEntity[];
|
11
|
+
emojis: EmojiEntity[];
|
12
|
+
categories: ChannelCategoryEntity[];
|
13
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
export * from './bot.entity';
|
2
|
+
export * from './button.entity';
|
3
|
+
export * from './action.entity';
|
4
|
+
export * from './channel.entity';
|
5
|
+
export * from './guild.entity';
|
6
|
+
export * from './member.entity';
|
7
|
+
export * from './message.entity';
|
8
|
+
export * from './user.entity';
|
9
|
+
export * from './userBeFriend.entity';
|
10
|
+
export * from './channelCategory.entity';
|
11
|
+
export * from './react.entity';
|
12
|
+
export * from './role.entity';
|
13
|
+
export * from './emoji.entity';
|
14
|
+
export * from './command.entity';
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { BotEntity } from './bot.entity';
|
2
|
+
import { ChannelEntity } from './channel.entity';
|
3
|
+
import { GuildEntity } from './guild.entity';
|
4
|
+
import { MessageEntity } from './message.entity';
|
5
|
+
import { ReactEntity } from './react.entity';
|
6
|
+
import { RoleEntity } from './role.entity';
|
7
|
+
import { UserEntity } from './user.entity';
|
8
|
+
export interface MemberEntity {
|
9
|
+
memberId: string;
|
10
|
+
joinAt: Date;
|
11
|
+
nickname: string;
|
12
|
+
avatarUrl: string;
|
13
|
+
user?: UserEntity;
|
14
|
+
bot?: BotEntity;
|
15
|
+
guild: GuildEntity;
|
16
|
+
roles: RoleEntity[];
|
17
|
+
joinedChannels: ChannelEntity[];
|
18
|
+
sentMessages: MessageEntity[];
|
19
|
+
sentReacts: ReactEntity[];
|
20
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { ActionEntity } from './action.entity';
|
2
|
+
import { ChannelEntity } from './channel.entity';
|
3
|
+
import { MemberEntity } from './member.entity';
|
4
|
+
export interface MessageEntity {
|
5
|
+
messageId: string;
|
6
|
+
content: string;
|
7
|
+
images: string[];
|
8
|
+
createdAt: Date;
|
9
|
+
channel: ChannelEntity;
|
10
|
+
author: MemberEntity;
|
11
|
+
action: ActionEntity;
|
12
|
+
replyTo: MessageEntity;
|
13
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { EmojiEntity } from './emoji.entity';
|
2
|
+
import { MemberEntity } from './member.entity';
|
3
|
+
import { MessageEntity } from './message.entity';
|
4
|
+
export interface ReactEntity {
|
5
|
+
reactId: string;
|
6
|
+
author: MemberEntity;
|
7
|
+
message: MessageEntity;
|
8
|
+
emoji: EmojiEntity;
|
9
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { ChannelEntity } from './channel.entity';
|
2
|
+
import { GuildEntity } from './guild.entity';
|
3
|
+
import { MemberEntity } from './member.entity';
|
4
|
+
export declare type Permission = 'DELETE_GUILD' | 'UPDATE_GUILD' | 'DELETE_CHANNEL' | 'UPDATE_CHANNEL' | 'CREATE_CHANNEL' | 'CREATE_ROLE' | 'UPDATE_ROLE' | 'DELETE_ROLE' | 'CREATE_EMOJI' | 'UPDATE_EMOJI' | 'DELETE_EMOJI' | 'CREATE_MESSAGE' | 'UPDATE_MESSAGE' | 'DELETE_MESSAGE' | 'CUD_REACT';
|
5
|
+
export interface RoleEntity {
|
6
|
+
roleId: string;
|
7
|
+
name: string;
|
8
|
+
icon: string;
|
9
|
+
color: string;
|
10
|
+
guild: GuildEntity;
|
11
|
+
members: MemberEntity[];
|
12
|
+
channels: ChannelEntity[];
|
13
|
+
permissions: Permission[];
|
14
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { ActionEntity } from "./action.entity";
|
2
|
+
import { OptionEntity } from "./option.entity";
|
3
|
+
export declare enum SelectStyle {
|
4
|
+
PRIMARY = "primary",
|
5
|
+
SECONDARY = "secondary"
|
6
|
+
}
|
7
|
+
export interface SelectEntity {
|
8
|
+
selectId: string;
|
9
|
+
customId: string;
|
10
|
+
isDisabled: boolean;
|
11
|
+
style: SelectStyle;
|
12
|
+
action: ActionEntity;
|
13
|
+
options: Partial<OptionEntity>[];
|
14
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { BotEntity } from './bot.entity';
|
2
|
+
import { MemberEntity } from './member.entity';
|
3
|
+
import { UserBeFriendEntity } from './userBeFriend.entity';
|
4
|
+
export interface UserEntity {
|
5
|
+
userId: string;
|
6
|
+
account: string;
|
7
|
+
name: string;
|
8
|
+
avatarUrl: string;
|
9
|
+
lastLogin: Date;
|
10
|
+
isOnline: boolean;
|
11
|
+
friends: UserBeFriendEntity[];
|
12
|
+
joinedGuilds: MemberEntity[];
|
13
|
+
createdBots: BotEntity[];
|
14
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { UserEntity } from './user.entity';
|
2
|
+
export declare enum FriendStatus {
|
3
|
+
ACCEPTED = "accepted",
|
4
|
+
PENDING = "pending",
|
5
|
+
BLOCKED = "blocked"
|
6
|
+
}
|
7
|
+
export interface UserBeFriendEntity {
|
8
|
+
id: string;
|
9
|
+
status: FriendStatus;
|
10
|
+
leftUser: UserEntity;
|
11
|
+
rightUser: UserEntity;
|
12
|
+
}
|