@deffa5556/bail 1.0.6 → 1.0.9

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.
Files changed (316) hide show
  1. package/cjs/WAProto/index.cjs +106053 -0
  2. package/cjs/deffa/config.cjs +14 -0
  3. package/cjs/deffa/plugins/ai/deepseekr1.cjs +35 -0
  4. package/cjs/deffa/plugins/ai/gita.cjs +26 -0
  5. package/cjs/deffa/plugins/ai/glm47flash.cjs +35 -0
  6. package/cjs/deffa/plugins/ai/gptoss120b.cjs +35 -0
  7. package/cjs/deffa/plugins/ai/qwq32b.cjs +35 -0
  8. package/cjs/deffa/plugins/berita/antara.cjs +25 -0
  9. package/cjs/deffa/plugins/berita/cnbcindonesia.cjs +25 -0
  10. package/cjs/deffa/plugins/berita/cnn.cjs +25 -0
  11. package/cjs/deffa/plugins/berita/kompas.cjs +25 -0
  12. package/cjs/deffa/plugins/berita/liputan6.cjs +25 -0
  13. package/cjs/deffa/plugins/berita/merdeka.cjs +25 -0
  14. package/cjs/deffa/plugins/berita/sindonews.cjs +25 -0
  15. package/cjs/deffa/plugins/berita/tribunnews.cjs +25 -0
  16. package/cjs/deffa/plugins/downloader/douyin.cjs +30 -0
  17. package/cjs/deffa/plugins/downloader/facebook.cjs +30 -0
  18. package/cjs/deffa/plugins/downloader/github.cjs +35 -0
  19. package/cjs/deffa/plugins/downloader/lahelu.cjs +30 -0
  20. package/cjs/deffa/plugins/downloader/snackvideo.cjs +30 -0
  21. package/cjs/deffa/plugins/downloader/soundcloud.cjs +30 -0
  22. package/cjs/deffa/plugins/downloader/tiktok.cjs +30 -0
  23. package/cjs/deffa/plugins/downloader/tiktokhd.cjs +30 -0
  24. package/cjs/deffa/plugins/downloader/twitter.cjs +30 -0
  25. package/cjs/deffa/plugins/downloader/ummy.cjs +36 -0
  26. package/cjs/deffa/plugins/index.cjs +213 -0
  27. package/cjs/deffa/plugins/info/bmkg.cjs +34 -0
  28. package/cjs/deffa/plugins/info/cuaca.cjs +31 -0
  29. package/cjs/deffa/plugins/info/jadwaltv.cjs +29 -0
  30. package/cjs/deffa/plugins/maker/brat.cjs +45 -0
  31. package/cjs/deffa/plugins/maker/bratvid.cjs +52 -0
  32. package/cjs/deffa/plugins/search/8font.cjs +28 -0
  33. package/cjs/deffa/plugins/search/applemusic.cjs +28 -0
  34. package/cjs/deffa/plugins/search/bimg.cjs +30 -0
  35. package/cjs/deffa/plugins/search/brave.cjs +34 -0
  36. package/cjs/deffa/plugins/search/duckduckgo.cjs +28 -0
  37. package/cjs/deffa/plugins/search/lahelu.cjs +28 -0
  38. package/cjs/deffa/plugins/search/mangatoon.cjs +28 -0
  39. package/cjs/deffa/plugins/search/mcpedl.cjs +28 -0
  40. package/cjs/deffa/plugins/search/myinstants.cjs +28 -0
  41. package/cjs/deffa/plugins/search/otakotaku.cjs +28 -0
  42. package/cjs/deffa/plugins/search/pinterest.cjs +30 -0
  43. package/cjs/deffa/plugins/search/resep.cjs +28 -0
  44. package/cjs/deffa/plugins/search/seegore.cjs +30 -0
  45. package/cjs/deffa/plugins/search/soundcloud.cjs +28 -0
  46. package/cjs/deffa/plugins/search/youtube.cjs +28 -0
  47. package/cjs/deffa/plugins/stalk/github.cjs +38 -0
  48. package/cjs/deffa/plugins/stalk/pinterest.cjs +37 -0
  49. package/cjs/deffa/plugins/stalk/threads.cjs +34 -0
  50. package/cjs/deffa/plugins/stalk/tiktok.cjs +37 -0
  51. package/cjs/deffa/plugins/stalk/twitter.cjs +37 -0
  52. package/cjs/deffa/plugins/stalk/youtube.cjs +37 -0
  53. package/cjs/lib/Defaults/index.cjs +158 -0
  54. package/cjs/lib/Discord/Client.cjs +263 -0
  55. package/cjs/lib/Discord/Constants.cjs +1842 -0
  56. package/cjs/lib/Discord/connect-dc.cjs +11 -0
  57. package/cjs/lib/Discord/esm-bridge.cjs +136 -0
  58. package/cjs/lib/Discord/gateway/Dispatcher.cjs +93 -0
  59. package/cjs/lib/Discord/gateway/Shard.cjs +695 -0
  60. package/cjs/lib/Discord/gateway/ShardManager.cjs +344 -0
  61. package/cjs/lib/Discord/gateway/compression/base.cjs +13 -0
  62. package/cjs/lib/Discord/gateway/compression/config.cjs +47 -0
  63. package/cjs/lib/Discord/gateway/compression/pako.cjs +44 -0
  64. package/cjs/lib/Discord/gateway/compression/zlib-native.cjs +47 -0
  65. package/cjs/lib/Discord/gateway/compression/zlib-sync.cjs +31 -0
  66. package/cjs/lib/Discord/gateway/compression/zstd-napi.cjs +80 -0
  67. package/cjs/lib/Discord/gateway/compression/zstd-native.cjs +46 -0
  68. package/cjs/lib/Discord/gateway/events.cjs +956 -0
  69. package/cjs/lib/Discord/index.cjs +238 -0
  70. package/cjs/lib/Discord/rest/Bucket.cjs +69 -0
  71. package/cjs/lib/Discord/rest/DiscordHTTPError.cjs +63 -0
  72. package/cjs/lib/Discord/rest/DiscordRESTError.cjs +84 -0
  73. package/cjs/lib/Discord/rest/OAuthHelper.cjs +226 -0
  74. package/cjs/lib/Discord/rest/RESTManager.cjs +116 -0
  75. package/cjs/lib/Discord/rest/RequestHandler.cjs +320 -0
  76. package/cjs/lib/Discord/rest/SequentialBucket.cjs +69 -0
  77. package/cjs/lib/Discord/routes/Applications.cjs +625 -0
  78. package/cjs/lib/Discord/routes/Channels.cjs +1199 -0
  79. package/cjs/lib/Discord/routes/Guilds.cjs +1792 -0
  80. package/cjs/lib/Discord/routes/Interactions.cjs +212 -0
  81. package/cjs/lib/Discord/routes/Lobbies.cjs +197 -0
  82. package/cjs/lib/Discord/routes/Miscellaneous.cjs +120 -0
  83. package/cjs/lib/Discord/routes/OAuth.cjs +350 -0
  84. package/cjs/lib/Discord/routes/Users.cjs +107 -0
  85. package/cjs/lib/Discord/routes/Webhooks.cjs +308 -0
  86. package/cjs/lib/Discord/structures/AnnouncementChannel.cjs +46 -0
  87. package/cjs/lib/Discord/structures/AnnouncementThreadChannel.cjs +28 -0
  88. package/cjs/lib/Discord/structures/Application.cjs +345 -0
  89. package/cjs/lib/Discord/structures/ApplicationCommand.cjs +109 -0
  90. package/cjs/lib/Discord/structures/Attachment.cjs +46 -0
  91. package/cjs/lib/Discord/structures/AuditLogEntry.cjs +41 -0
  92. package/cjs/lib/Discord/structures/AutoModerationRule.cjs +117 -0
  93. package/cjs/lib/Discord/structures/AutocompleteInteraction.cjs +90 -0
  94. package/cjs/lib/Discord/structures/Base.cjs +56 -0
  95. package/cjs/lib/Discord/structures/BaseEntitlement.cjs +40 -0
  96. package/cjs/lib/Discord/structures/CategoryChannel.cjs +102 -0
  97. package/cjs/lib/Discord/structures/Channel.cjs +89 -0
  98. package/cjs/lib/Discord/structures/ClientApplication.cjs +269 -0
  99. package/cjs/lib/Discord/structures/CommandInteraction.cjs +294 -0
  100. package/cjs/lib/Discord/structures/ComponentInteraction.cjs +306 -0
  101. package/cjs/lib/Discord/structures/Entitlement.cjs +24 -0
  102. package/cjs/lib/Discord/structures/ExtendedUser.cjs +48 -0
  103. package/cjs/lib/Discord/structures/ForumChannel.cjs +20 -0
  104. package/cjs/lib/Discord/structures/GroupChannel.cjs +160 -0
  105. package/cjs/lib/Discord/structures/Guild.cjs +1289 -0
  106. package/cjs/lib/Discord/structures/GuildChannel.cjs +82 -0
  107. package/cjs/lib/Discord/structures/GuildPreview.cjs +141 -0
  108. package/cjs/lib/Discord/structures/GuildScheduledEvent.cjs +166 -0
  109. package/cjs/lib/Discord/structures/GuildTemplate.cjs +96 -0
  110. package/cjs/lib/Discord/structures/Integration.cjs +123 -0
  111. package/cjs/lib/Discord/structures/Interaction.cjs +78 -0
  112. package/cjs/lib/Discord/structures/InteractionResolvedChannel.cjs +36 -0
  113. package/cjs/lib/Discord/structures/Invite.cjs +196 -0
  114. package/cjs/lib/Discord/structures/InviteGuild.cjs +117 -0
  115. package/cjs/lib/Discord/structures/InviteRole.cjs +88 -0
  116. package/cjs/lib/Discord/structures/Lobby.cjs +84 -0
  117. package/cjs/lib/Discord/structures/LobbyMember.cjs +30 -0
  118. package/cjs/lib/Discord/structures/MediaChannel.cjs +20 -0
  119. package/cjs/lib/Discord/structures/Member.cjs +300 -0
  120. package/cjs/lib/Discord/structures/Message.cjs +553 -0
  121. package/cjs/lib/Discord/structures/ModalSubmitInteraction.cjs +263 -0
  122. package/cjs/lib/Discord/structures/OAuthApplication.cjs +203 -0
  123. package/cjs/lib/Discord/structures/OAuthGuild.cjs +98 -0
  124. package/cjs/lib/Discord/structures/PartialApplication.cjs +97 -0
  125. package/cjs/lib/Discord/structures/Permission.cjs +61 -0
  126. package/cjs/lib/Discord/structures/PermissionOverwrite.cjs +46 -0
  127. package/cjs/lib/Discord/structures/PingInteraction.cjs +27 -0
  128. package/cjs/lib/Discord/structures/Poll.cjs +69 -0
  129. package/cjs/lib/Discord/structures/PrimaryGuild.cjs +93 -0
  130. package/cjs/lib/Discord/structures/PrivateChannel.cjs +131 -0
  131. package/cjs/lib/Discord/structures/PrivateThreadChannel.cjs +28 -0
  132. package/cjs/lib/Discord/structures/PublicThreadChannel.cjs +36 -0
  133. package/cjs/lib/Discord/structures/Role.cjs +126 -0
  134. package/cjs/lib/Discord/structures/SKU.cjs +58 -0
  135. package/cjs/lib/Discord/structures/Soundboard.cjs +58 -0
  136. package/cjs/lib/Discord/structures/StageChannel.cjs +45 -0
  137. package/cjs/lib/Discord/structures/StageInstance.cjs +80 -0
  138. package/cjs/lib/Discord/structures/Subscription.cjs +21 -0
  139. package/cjs/lib/Discord/structures/Team.cjs +70 -0
  140. package/cjs/lib/Discord/structures/TestEntitlement.cjs +22 -0
  141. package/cjs/lib/Discord/structures/TextChannel.cjs +48 -0
  142. package/cjs/lib/Discord/structures/TextableChannel.cjs +265 -0
  143. package/cjs/lib/Discord/structures/TextableVoiceChannel.cjs +70 -0
  144. package/cjs/lib/Discord/structures/ThreadChannel.cjs +276 -0
  145. package/cjs/lib/Discord/structures/ThreadOnlyChannel.cjs +205 -0
  146. package/cjs/lib/Discord/structures/ThreadableChannel.cjs +57 -0
  147. package/cjs/lib/Discord/structures/UnavailableGuild.cjs +21 -0
  148. package/cjs/lib/Discord/structures/User.cjs +223 -0
  149. package/cjs/lib/Discord/structures/VoiceChannel.cjs +34 -0
  150. package/cjs/lib/Discord/structures/VoiceState.cjs +113 -0
  151. package/cjs/lib/Discord/structures/Webhook.cjs +224 -0
  152. package/cjs/lib/Discord/util/Collection.cjs +77 -0
  153. package/cjs/lib/Discord/util/Errors.cjs +81 -0
  154. package/cjs/lib/Discord/util/QueryBuilder.cjs +20 -0
  155. package/cjs/lib/Discord/util/Routes.cjs +293 -0
  156. package/cjs/lib/Discord/util/SimpleCollection.cjs +78 -0
  157. package/cjs/lib/Discord/util/Time.cjs +92 -0
  158. package/cjs/lib/Discord/util/TypedCollection.cjs +78 -0
  159. package/cjs/lib/Discord/util/TypedEmitter.cjs +20 -0
  160. package/cjs/lib/Discord/util/Util.cjs +906 -0
  161. package/cjs/lib/Discord/util/interactions/InteractionOptionsWrapper.cjs +207 -0
  162. package/cjs/lib/Discord/util/interactions/MessageInteractionResponse.cjs +26 -0
  163. package/cjs/lib/Discord/util/interactions/ModalSubmitInteractionComponentsWrapper.cjs +98 -0
  164. package/cjs/lib/Discord/util/interactions/SelectMenuValuesWrapper.cjs +77 -0
  165. package/cjs/lib/Discord/util/interactions/shared.cjs +20 -0
  166. package/cjs/lib/Discord/util/warning.cjs +34 -0
  167. package/cjs/lib/Signal/Group/ciphertext-message.cjs +16 -0
  168. package/cjs/lib/Signal/Group/group-session-builder.cjs +67 -0
  169. package/cjs/lib/Signal/Group/group_cipher.cjs +86 -0
  170. package/cjs/lib/Signal/Group/index.cjs +58 -0
  171. package/cjs/lib/Signal/Group/keyhelper.cjs +56 -0
  172. package/cjs/lib/Signal/Group/sender-chain-key.cjs +30 -0
  173. package/cjs/lib/Signal/Group/sender-key-distribution-message.cjs +67 -0
  174. package/cjs/lib/Signal/Group/sender-key-message.cjs +70 -0
  175. package/cjs/lib/Signal/Group/sender-key-name.cjs +52 -0
  176. package/cjs/lib/Signal/Group/sender-key-record.cjs +45 -0
  177. package/cjs/lib/Signal/Group/sender-key-state.cjs +88 -0
  178. package/cjs/lib/Signal/Group/sender-message-key.cjs +30 -0
  179. package/cjs/lib/Signal/libsignal.cjs +467 -0
  180. package/cjs/lib/Signal/lid-mapping.cjs +281 -0
  181. package/cjs/lib/Socket/Client/index.cjs +19 -0
  182. package/cjs/lib/Socket/Client/types.cjs +15 -0
  183. package/cjs/lib/Socket/Client/websocket.cjs +61 -0
  184. package/cjs/lib/Socket/business.cjs +384 -0
  185. package/cjs/lib/Socket/chats.cjs +1221 -0
  186. package/cjs/lib/Socket/communities.cjs +440 -0
  187. package/cjs/lib/Socket/groups.cjs +353 -0
  188. package/cjs/lib/Socket/index.cjs +14 -0
  189. package/cjs/lib/Socket/messages-recv.cjs +1772 -0
  190. package/cjs/lib/Socket/messages-send.cjs +1376 -0
  191. package/cjs/lib/Socket/mex.cjs +46 -0
  192. package/cjs/lib/Socket/newsletter.cjs +230 -0
  193. package/cjs/lib/Socket/socket.cjs +976 -0
  194. package/cjs/lib/Store/index.cjs +20 -0
  195. package/cjs/lib/Store/make-in-memory-store.cjs +470 -0
  196. package/cjs/lib/Store/make-ordered-dictionary.cjs +82 -0
  197. package/cjs/lib/Store/object-repository.cjs +28 -0
  198. package/cjs/lib/Telegram/button.cjs +147 -0
  199. package/cjs/lib/Telegram/composer.cjs +582 -0
  200. package/cjs/lib/Telegram/context.cjs +853 -0
  201. package/cjs/lib/Telegram/core/helpers/args.cjs +57 -0
  202. package/cjs/lib/Telegram/core/helpers/check.cjs +55 -0
  203. package/cjs/lib/Telegram/core/helpers/compact.cjs +16 -0
  204. package/cjs/lib/Telegram/core/helpers/deunionize.cjs +12 -0
  205. package/cjs/lib/Telegram/core/helpers/formatting.cjs +91 -0
  206. package/cjs/lib/Telegram/core/helpers/util.cjs +50 -0
  207. package/cjs/lib/Telegram/core/network/client.cjs +338 -0
  208. package/cjs/lib/Telegram/core/network/error.cjs +21 -0
  209. package/cjs/lib/Telegram/core/network/multipart-stream.cjs +79 -0
  210. package/cjs/lib/Telegram/core/network/polling.cjs +87 -0
  211. package/cjs/lib/Telegram/core/network/webhook.cjs +54 -0
  212. package/cjs/lib/Telegram/core/types/typegram.cjs +31 -0
  213. package/cjs/lib/Telegram/deffa-telegraf.cjs +264 -0
  214. package/cjs/lib/Telegram/esm-bridge.cjs +20 -0
  215. package/cjs/lib/Telegram/filters.cjs +69 -0
  216. package/cjs/lib/Telegram/format.cjs +58 -0
  217. package/cjs/lib/Telegram/future.cjs +140 -0
  218. package/cjs/lib/Telegram/index.cjs +67 -0
  219. package/cjs/lib/Telegram/input.cjs +61 -0
  220. package/cjs/lib/Telegram/markup.cjs +129 -0
  221. package/cjs/lib/Telegram/middleware.cjs +2 -0
  222. package/cjs/lib/Telegram/reactions.cjs +84 -0
  223. package/cjs/lib/Telegram/router.cjs +46 -0
  224. package/cjs/lib/Telegram/scenes/base.cjs +39 -0
  225. package/cjs/lib/Telegram/scenes/context.cjs +104 -0
  226. package/cjs/lib/Telegram/scenes/index.cjs +21 -0
  227. package/cjs/lib/Telegram/scenes/stage.cjs +49 -0
  228. package/cjs/lib/Telegram/scenes/wizard/context.cjs +31 -0
  229. package/cjs/lib/Telegram/scenes/wizard/index.cjs +45 -0
  230. package/cjs/lib/Telegram/scenes.cjs +21 -0
  231. package/cjs/lib/Telegram/session.cjs +166 -0
  232. package/cjs/lib/Telegram/telegram-types.cjs +6 -0
  233. package/cjs/lib/Telegram/telegram.cjs +945 -0
  234. package/cjs/lib/Telegram/types.cjs +2 -0
  235. package/cjs/lib/Telegram/utils.cjs +5 -0
  236. package/cjs/lib/Types/Auth.cjs +3 -0
  237. package/cjs/lib/Types/Bussines.cjs +3 -0
  238. package/cjs/lib/Types/Call.cjs +3 -0
  239. package/cjs/lib/Types/Chat.cjs +11 -0
  240. package/cjs/lib/Types/Contact.cjs +3 -0
  241. package/cjs/lib/Types/Events.cjs +4 -0
  242. package/cjs/lib/Types/GroupMetadata.cjs +3 -0
  243. package/cjs/lib/Types/Label.cjs +26 -0
  244. package/cjs/lib/Types/LabelAssociation.cjs +8 -0
  245. package/cjs/lib/Types/Message.cjs +19 -0
  246. package/cjs/lib/Types/Mex.cjs +40 -0
  247. package/cjs/lib/Types/Product.cjs +3 -0
  248. package/cjs/lib/Types/RichType.cjs +24 -0
  249. package/cjs/lib/Types/Signal.cjs +4 -0
  250. package/cjs/lib/Types/Socket.cjs +4 -0
  251. package/cjs/lib/Types/State.cjs +54 -0
  252. package/cjs/lib/Types/USync.cjs +4 -0
  253. package/cjs/lib/Types/index.cjs +42 -0
  254. package/cjs/lib/Utils/auth-utils.cjs +312 -0
  255. package/cjs/lib/Utils/browser-utils.cjs +39 -0
  256. package/cjs/lib/Utils/business.cjs +241 -0
  257. package/cjs/lib/Utils/chat-utils.cjs +890 -0
  258. package/cjs/lib/Utils/companion-reg-client-utils.cjs +51 -0
  259. package/cjs/lib/Utils/crypto.cjs +170 -0
  260. package/cjs/lib/Utils/decode-wa-message.cjs +330 -0
  261. package/cjs/lib/Utils/event-buffer.cjs +629 -0
  262. package/cjs/lib/Utils/generics.cjs +427 -0
  263. package/cjs/lib/Utils/history.cjs +141 -0
  264. package/cjs/lib/Utils/identity-change-handler.cjs +56 -0
  265. package/cjs/lib/Utils/index.cjs +43 -0
  266. package/cjs/lib/Utils/link-preview.cjs +122 -0
  267. package/cjs/lib/Utils/logger.cjs +8 -0
  268. package/cjs/lib/Utils/lt-hash.cjs +11 -0
  269. package/cjs/lib/Utils/make-mutex.cjs +38 -0
  270. package/cjs/lib/Utils/message-retry-manager.cjs +267 -0
  271. package/cjs/lib/Utils/messages-media.cjs +906 -0
  272. package/cjs/lib/Utils/messages.cjs +1909 -0
  273. package/cjs/lib/Utils/noise-handler.cjs +205 -0
  274. package/cjs/lib/Utils/offline-node-processor.cjs +43 -0
  275. package/cjs/lib/Utils/pre-key-manager.cjs +113 -0
  276. package/cjs/lib/Utils/process-message.cjs +755 -0
  277. package/cjs/lib/Utils/reporting-utils.cjs +263 -0
  278. package/cjs/lib/Utils/rich-message-utils.cjs +434 -0
  279. package/cjs/lib/Utils/session-guard.cjs +163 -0
  280. package/cjs/lib/Utils/signal.cjs +214 -0
  281. package/cjs/lib/Utils/stanza-ack.cjs +41 -0
  282. package/cjs/lib/Utils/sync-action-utils.cjs +54 -0
  283. package/cjs/lib/Utils/tc-token-utils.cjs +174 -0
  284. package/cjs/lib/Utils/text-sticker.cjs +174 -0
  285. package/cjs/lib/Utils/use-multi-file-auth-state.cjs +125 -0
  286. package/cjs/lib/Utils/use-single-file-auth-state.cjs +113 -0
  287. package/cjs/lib/Utils/use-sqlite-auth-state.cjs +145 -0
  288. package/cjs/lib/Utils/validate-connection.cjs +210 -0
  289. package/cjs/lib/WABinary/constants.cjs +1470 -0
  290. package/cjs/lib/WABinary/decode.cjs +301 -0
  291. package/cjs/lib/WABinary/encode.cjs +257 -0
  292. package/cjs/lib/WABinary/generic-utils.cjs +240 -0
  293. package/cjs/lib/WABinary/index.cjs +22 -0
  294. package/cjs/lib/WABinary/jid-utils.cjs +114 -0
  295. package/cjs/lib/WABinary/types.cjs +37 -0
  296. package/cjs/lib/WAM/BinaryInfo.cjs +14 -0
  297. package/cjs/lib/WAM/constants.cjs +22856 -0
  298. package/cjs/lib/WAM/encode.cjs +154 -0
  299. package/cjs/lib/WAM/index.cjs +20 -0
  300. package/cjs/lib/WAUSync/Protocols/USyncContactProtocol.cjs +56 -0
  301. package/cjs/lib/WAUSync/Protocols/USyncDeviceProtocol.cjs +58 -0
  302. package/cjs/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.cjs +31 -0
  303. package/cjs/lib/WAUSync/Protocols/USyncStatusProtocol.cjs +42 -0
  304. package/cjs/lib/WAUSync/Protocols/USyncUsernameProtocol.cjs +29 -0
  305. package/cjs/lib/WAUSync/Protocols/UsyncBotProfileProtocol.cjs +55 -0
  306. package/cjs/lib/WAUSync/Protocols/UsyncLIDProtocol.cjs +33 -0
  307. package/cjs/lib/WAUSync/Protocols/index.cjs +22 -0
  308. package/cjs/lib/WAUSync/USyncQuery.cjs +102 -0
  309. package/cjs/lib/WAUSync/USyncUser.cjs +35 -0
  310. package/cjs/lib/WAUSync/index.cjs +20 -0
  311. package/cjs/lib/index.cjs +372 -0
  312. package/cjs/lib/plugins/loader.cjs +117 -0
  313. package/lib/Defaults/index.js +1 -1
  314. package/lib/Socket/socket.js +3 -3
  315. package/lib/Telegram/esm-bridge.mjs +1 -1
  316. package/package.json +11 -6
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ /** @module Soundboard */
7
+ const Base_1 = __importDefault(require("./Base.cjs"));
8
+ const User_1 = __importDefault(require("./User.cjs"));
9
+ /** Represents a soundboard. */
10
+ class Soundboard extends Base_1.default {
11
+ constructor(data, client) {
12
+ super(data.sound_id, client);
13
+ this.available = data.available;
14
+ this.emojiID = data.emoji_id;
15
+ this.emojiName = data.emoji_name;
16
+ this.guildID = data.guild_id;
17
+ this.name = data.name;
18
+ this.soundID = data.sound_id;
19
+ this.user = data.user ? new User_1.default(data.user, client) : undefined;
20
+ this.volume = data.volume;
21
+ }
22
+ /**
23
+ * Delete this soundboard sound.
24
+ * @param reason The reason for deleting the soundboard sound.
25
+ */
26
+ async delete(reason) {
27
+ return this.client.rest.guilds.deleteSoundboardSound(this.guildID, this.id, reason);
28
+ }
29
+ /**
30
+ * Edit this soundboard sound.
31
+ * @param options The options for editing the soundboard sound.
32
+ */
33
+ async edit(options) {
34
+ return this.client.rest.guilds.editSoundboardSound(this.guildID, this.id, options);
35
+ }
36
+ /**
37
+ * Send this soundboard sound to a voice channel.
38
+ * @param channelID The ID of the voice channel to send the soundboard sound to.
39
+ * @param sourceGuildID The ID of the guild the soundboard sound is from.
40
+ */
41
+ async sendSoundboardSound(channelID, sourceGuildID) {
42
+ return this.client.rest.channels.sendSoundboardSound(channelID, { soundID: this.soundID, sourceGuildID });
43
+ }
44
+ toJSON() {
45
+ return {
46
+ ...super.toJSON(),
47
+ available: this.available,
48
+ emojiID: this.emojiID,
49
+ emojiName: this.emojiName,
50
+ guildID: this.guildID,
51
+ name: this.name,
52
+ soundID: this.soundID,
53
+ user: this.user?.toJSON(),
54
+ volume: this.volume
55
+ };
56
+ }
57
+ }
58
+ exports.default = Soundboard;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const TextableVoiceChannel_1 = __importDefault(require("./TextableVoiceChannel.cjs"));
7
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
8
+ // @ts-ignore
9
+ /** Represents a guild stage channel. */
10
+ class StageChannel extends TextableVoiceChannel_1.default {
11
+ constructor(data, client) {
12
+ super(data, client);
13
+ }
14
+ /**
15
+ * Create a stage instance on this channel.
16
+ * @param options The options for creating the stage instance.
17
+ */
18
+ async createStageInstance(options) {
19
+ return this.client.rest.channels.createStageInstance(this.id, options);
20
+ }
21
+ /**
22
+ * Delete the stage instance on this channel.
23
+ * @param reason The reason for deleting the stage instance.
24
+ */
25
+ async deleteStageInstance(reason) {
26
+ return this.client.rest.channels.deleteStageInstance(this.id, reason);
27
+ }
28
+ /**
29
+ * Edit the stage instance on this channel.
30
+ * @param options The options for editing the stage instance.
31
+ */
32
+ async editStageInstance(options) {
33
+ return this.client.rest.channels.editStageInstance(this.id, options);
34
+ }
35
+ /**
36
+ * Get the stage instance associated with this channel.
37
+ */
38
+ async getStageInstance() {
39
+ return this.client.rest.channels.getStageInstance(this.id);
40
+ }
41
+ toJSON() {
42
+ return super.toJSON();
43
+ }
44
+ }
45
+ exports.default = StageChannel;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ /** @module StageInstance */
7
+ const Base_1 = __importDefault(require("./Base.cjs"));
8
+ const Errors_1 = require("../util/Errors.cjs");
9
+ /** Represents a stage instance. */
10
+ class StageInstance extends Base_1.default {
11
+ constructor(data, client) {
12
+ super(data.id, client);
13
+ this.channelID = data.channel_id;
14
+ this.discoverableDisabled = !!data.discoverable_disabled;
15
+ this.guildID = data.guild_id;
16
+ this.privacyLevel = data.privacy_level;
17
+ this.scheduledEventID = data.guild_scheduled_event_id;
18
+ this.topic = data.topic;
19
+ this.update(data);
20
+ }
21
+ update(data) {
22
+ if (data.channel_id !== undefined) {
23
+ this.channelID = data.channel_id;
24
+ }
25
+ if (data.discoverable_disabled !== undefined) {
26
+ this.discoverableDisabled = data.discoverable_disabled;
27
+ }
28
+ if (data.guild_scheduled_event_id !== undefined) {
29
+ this.scheduledEventID = data.guild_scheduled_event_id;
30
+ }
31
+ if (data.privacy_level !== undefined) {
32
+ this.privacyLevel = data.privacy_level;
33
+ }
34
+ if (data.topic !== undefined) {
35
+ this.topic = data.topic;
36
+ }
37
+ }
38
+ /** The associated stage channel. */
39
+ get channel() {
40
+ return this._cachedChannel ?? (this._cachedChannel = this.client.getChannel(this.channelID));
41
+ }
42
+ /** The guild of the associated stage channel. This will throw an error if the guild is not cached. */
43
+ get guild() {
44
+ this._cachedGuild ?? (this._cachedGuild = this.client.guilds.get(this.guildID));
45
+ if (!this._cachedGuild) {
46
+ if (this.client.options.restMode) {
47
+ throw new Errors_1.UncachedError(`${this.constructor.name}#guild is not present when rest mode is enabled.`);
48
+ }
49
+ if (!this.client.shards.connected) {
50
+ throw new Errors_1.UncachedError(`${this.constructor.name}#guild is not present without a gateway connection.`);
51
+ }
52
+ throw new Errors_1.UncachedError(`${this.constructor.name}#guild is not present.`);
53
+ }
54
+ return this._cachedGuild;
55
+ }
56
+ /** The scheduled event for this stage instance, if applicable. */
57
+ get scheduledEvent() {
58
+ if (this.scheduledEventID !== null && this._cachedScheduledEvent !== null) {
59
+ try {
60
+ return this._cachedScheduledEvent ?? (this._cachedScheduledEvent = this.guild.scheduledEvents.get(this.scheduledEventID));
61
+ }
62
+ catch {
63
+ return (this._cachedScheduledEvent = undefined);
64
+ }
65
+ }
66
+ return this._cachedScheduledEvent === null ? this._cachedScheduledEvent : (this._cachedScheduledEvent = null);
67
+ }
68
+ toJSON() {
69
+ return {
70
+ ...super.toJSON(),
71
+ channelID: this.channelID,
72
+ discoverableDisabled: this.discoverableDisabled,
73
+ guildID: this.guildID,
74
+ privacyLevel: this.privacyLevel,
75
+ scheduledEventID: this.scheduledEventID,
76
+ topic: this.topic
77
+ };
78
+ }
79
+ }
80
+ exports.default = StageInstance;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Base_1 = __importDefault(require("./Base.cjs"));
7
+ class Subscription extends Base_1.default {
8
+ constructor(data, client) {
9
+ super(data.id, client);
10
+ this.canceledAt = data.canceled_at ? new Date(data.canceled_at) : null;
11
+ this.country = data.country;
12
+ this.currentPeriodEnd = new Date(data.current_period_end);
13
+ this.currentPeriodStart = new Date(data.current_period_start);
14
+ this.entitlementIDs = data.entitlement_ids;
15
+ this.renewalSKUIDs = data.renewal_sku_ids;
16
+ this.skuIDs = data.sku_ids;
17
+ this.status = data.status;
18
+ this.userID = data.user_id;
19
+ }
20
+ }
21
+ exports.default = Subscription;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ /** @module Team */
7
+ const Base_1 = __importDefault(require("./Base.cjs"));
8
+ /** Represents an OAuth team. */
9
+ class Team extends Base_1.default {
10
+ constructor(data, client) {
11
+ super(data.id, client);
12
+ this.icon = null;
13
+ this.members = [];
14
+ this.name = data.name;
15
+ this.owner = this.client.users.get(data.owner_user_id);
16
+ this.ownerID = data.owner_user_id;
17
+ this.payoutAccountStatus = data.payout_account_status;
18
+ this.payoutAccountStatuses = data.payout_account_statuses;
19
+ this.stripeConnectAccountID = data.stripe_connect_account_id;
20
+ this.update(data);
21
+ }
22
+ update(data) {
23
+ if (data.icon !== undefined) {
24
+ this.icon = data.icon;
25
+ }
26
+ if (data.name !== undefined) {
27
+ this.name = data.name;
28
+ }
29
+ if (data.owner_user_id !== undefined) {
30
+ this.owner = this.client.users.get(data.owner_user_id);
31
+ this.ownerID = data.owner_user_id;
32
+ }
33
+ if (data.members !== undefined) {
34
+ for (const member of this.members) {
35
+ if (!data.members.some(m => m.user.id === member.user.id)) {
36
+ this.members.splice(this.members.indexOf(member), 1);
37
+ }
38
+ }
39
+ for (const member of data.members) {
40
+ if (!this.members.some(m => m.user.id === member.user.id)) {
41
+ this.members.push({
42
+ membershipState: member.membership_state,
43
+ role: member.role,
44
+ teamID: member.team_id,
45
+ user: this.client.users.update(member.user)
46
+ });
47
+ }
48
+ }
49
+ }
50
+ if (data.payout_account_status !== undefined) {
51
+ this.payoutAccountStatus = data.payout_account_status;
52
+ }
53
+ if (data.payout_account_statuses !== undefined) {
54
+ this.payoutAccountStatuses = data.payout_account_statuses;
55
+ }
56
+ if (data.stripe_connect_account_id !== undefined) {
57
+ this.stripeConnectAccountID = data.stripe_connect_account_id;
58
+ }
59
+ }
60
+ toJSON() {
61
+ return {
62
+ ...super.toJSON(),
63
+ icon: this.icon,
64
+ members: this.members,
65
+ name: this.name,
66
+ ownerID: this.ownerID
67
+ };
68
+ }
69
+ }
70
+ exports.default = Team;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const BaseEntitlement_1 = __importDefault(require("./BaseEntitlement.cjs"));
7
+ /** Represents a test entitlement. */
8
+ class TestEntitlement extends BaseEntitlement_1.default {
9
+ constructor(data, client) {
10
+ super(data, client);
11
+ }
12
+ /** Delete this entitlement. */
13
+ async delete() {
14
+ return this.client.rest.applications.deleteTestEntitlement(this.applicationID, this.id);
15
+ }
16
+ toJSON() {
17
+ return {
18
+ ...super.toJSON()
19
+ };
20
+ }
21
+ }
22
+ exports.default = TestEntitlement;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const ThreadableChannel_1 = __importDefault(require("./ThreadableChannel.cjs"));
7
+ const Constants_1 = require("../Constants.cjs");
8
+ /** Represents a guild text channel. */
9
+ class TextChannel extends ThreadableChannel_1.default {
10
+ constructor(data, client) {
11
+ super(data, client);
12
+ }
13
+ /**
14
+ * Convert this text channel to a announcement channel.
15
+ */
16
+ async convert() {
17
+ return this.client.rest.channels.edit(this.id, { type: Constants_1.ChannelTypes.GUILD_ANNOUNCEMENT });
18
+ }
19
+ /**
20
+ * Follow an announcement channel to this channel.
21
+ * @param webhookChannelID The ID of the channel to follow the announcement channel to.
22
+ * @param reason The reason for following the announcement channel.
23
+ */
24
+ async followAnnouncement(webhookChannelID, reason) {
25
+ return this.client.rest.channels.followAnnouncement(this.id, webhookChannelID, reason);
26
+ }
27
+ /**
28
+ * Get the private archived threads the current user has joined in this channel.
29
+ * @param options The options for getting the joined private archived threads.
30
+ */
31
+ async getJoinedPrivateArchivedThreads(options) {
32
+ return this.client.rest.channels.getJoinedPrivateArchivedThreads(this.id, options);
33
+ }
34
+ /**
35
+ * Get the private archived threads in this channel.
36
+ * @param options The options for getting the private archived threads.
37
+ */
38
+ async getPrivateArchivedThreads(options) {
39
+ return this.client.rest.channels.getPrivateArchivedThreads(this.id, options);
40
+ }
41
+ toJSON() {
42
+ return {
43
+ ...super.toJSON(),
44
+ type: this.type
45
+ };
46
+ }
47
+ }
48
+ exports.default = TextChannel;
@@ -0,0 +1,265 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ /** @module TextableChannel */
7
+ const GuildChannel_1 = __importDefault(require("./GuildChannel.cjs"));
8
+ const PermissionOverwrite_1 = __importDefault(require("./PermissionOverwrite.cjs"));
9
+ const Message_1 = __importDefault(require("./Message.cjs"));
10
+ const Permission_1 = __importDefault(require("./Permission.cjs"));
11
+ const Constants_1 = require("../Constants.cjs");
12
+ const TypedCollection_1 = __importDefault(require("../util/TypedCollection.cjs"));
13
+ const Errors_1 = require("../util/Errors.cjs");
14
+ /** Represents a guild textable channel. Not used for threads. */
15
+ class TextableChannel extends GuildChannel_1.default {
16
+ constructor(data, client) {
17
+ super(data, client);
18
+ this.lastMessageID = data.last_message_id;
19
+ this.messages = new TypedCollection_1.default((Message_1.default), client, this.client.util._getLimit("messages", this.id));
20
+ this.nsfw = data.nsfw;
21
+ this.permissionOverwrites = new TypedCollection_1.default(PermissionOverwrite_1.default, client);
22
+ this.position = data.position;
23
+ this.rateLimitPerUser = data.rate_limit_per_user;
24
+ this.topic = data.topic;
25
+ this.update(data);
26
+ }
27
+ update(data) {
28
+ super.update(data);
29
+ if (data.last_message_id !== undefined) {
30
+ this.lastMessage = data.last_message_id === null ? null : this.messages.get(data.last_message_id);
31
+ this.lastMessageID = data.last_message_id;
32
+ }
33
+ if (data.nsfw !== undefined) {
34
+ this.nsfw = data.nsfw;
35
+ }
36
+ if (data.position !== undefined) {
37
+ this.position = data.position;
38
+ }
39
+ if (data.rate_limit_per_user !== undefined) {
40
+ this.rateLimitPerUser = data.rate_limit_per_user;
41
+ }
42
+ if (data.topic !== undefined) {
43
+ this.topic = data.topic;
44
+ }
45
+ if (data.permission_overwrites !== undefined) {
46
+ for (const id of this.permissionOverwrites.keys()) {
47
+ if (!data.permission_overwrites.some(overwrite => overwrite.id === id)) {
48
+ this.permissionOverwrites.delete(id);
49
+ }
50
+ }
51
+ data.permission_overwrites.map(overwrite => this.permissionOverwrites.update(overwrite));
52
+ }
53
+ }
54
+ /**
55
+ * Create an invite for this channel. If the guild is not a `COMMUNITY` server, invites can only be made to last 30 days.
56
+ * @param options The options for the invite.
57
+ */
58
+ async createInvite(options) {
59
+ return this.client.rest.channels.createInvite(this.id, options);
60
+ }
61
+ async createMessage(content, options) {
62
+ if (typeof content === "string") {
63
+ options = {
64
+ ...options,
65
+ content
66
+ };
67
+ }
68
+ else
69
+ options = content;
70
+ return this.client.rest.channels.createMessage(this.id, options);
71
+ }
72
+ /**
73
+ * Add a reaction to a message in this channel.
74
+ * @param messageID The ID of the message to add a reaction to.
75
+ * @param emoji The reaction to add to the message. `name:id` for custom emojis, and the unicode codepoint for default emojis.
76
+ */
77
+ async createReaction(messageID, emoji) {
78
+ return this.client.rest.channels.createReaction(this.id, messageID, emoji);
79
+ }
80
+ /**
81
+ * Create a webhook in this channel.
82
+ * @param options The options to create the webhook with.
83
+ */
84
+ async createWebhook(options) {
85
+ return this.client.rest.webhooks.create(this.id, options);
86
+ }
87
+ /**
88
+ * Delete a message in this channel.
89
+ * @param messageID The ID of the message to delete.
90
+ * @param reason The reason for deleting the message.
91
+ */
92
+ async deleteMessage(messageID, reason) {
93
+ return this.client.rest.channels.deleteMessage(this.id, messageID, reason);
94
+ }
95
+ /**
96
+ * Bulk delete messages in this channel.
97
+ * @param messageIDs The IDs of the messages to delete. Any duplicates or messages older than two weeks will cause an error.
98
+ * @param reason The reason for deleting the messages.
99
+ */
100
+ async deleteMessages(messageIDs, reason) {
101
+ return this.client.rest.channels.deleteMessages(this.id, messageIDs, reason);
102
+ }
103
+ /**
104
+ * Delete a permission overwrite on this channel.
105
+ * @param overwriteID The ID of the permission overwrite to delete.
106
+ * @param reason The reason for deleting the permission overwrite.
107
+ */
108
+ async deletePermission(overwriteID, reason) {
109
+ return this.client.rest.channels.deletePermission(this.id, overwriteID, reason);
110
+ }
111
+ /**
112
+ * Remove a reaction from a message in this channel.
113
+ * @param messageID The ID of the message to remove a reaction from.
114
+ * @param emoji The reaction to remove from the message. `name:id` for custom emojis, and the unicode codepoint for default emojis.
115
+ * @param user The user to remove the reaction from, `@me` for the current user (default).
116
+ */
117
+ async deleteReaction(messageID, emoji, user = "@me") {
118
+ return this.client.rest.channels.deleteReaction(this.id, messageID, emoji, user);
119
+ }
120
+ /**
121
+ * Remove all, or a specific emoji's reactions from a message in this channel.
122
+ * @param messageID The ID of the message to remove reactions from.
123
+ * @param emoji The reaction to remove from the message. `name:id` for custom emojis, and the unicode codepoint for default emojis. Omit to remove all reactions.
124
+ */
125
+ async deleteReactions(messageID, emoji) {
126
+ return this.client.rest.channels.deleteReactions(this.id, messageID, emoji);
127
+ }
128
+ async editMessage(messageID, content, options) {
129
+ if (typeof content === "string") {
130
+ options = {
131
+ ...options,
132
+ content
133
+ };
134
+ }
135
+ else
136
+ options = content;
137
+ return this.client.rest.channels.editMessage(this.id, messageID, options);
138
+ }
139
+ /**
140
+ * Edit a permission overwrite on this channel.
141
+ * @param overwriteID The ID of the permission overwrite to edit.
142
+ * @param options The options for editing the permission overwrite.
143
+ */
144
+ async editPermission(overwriteID, options) {
145
+ return this.client.rest.channels.editPermission(this.id, overwriteID, options);
146
+ }
147
+ /**
148
+ * Get the invites of this channel.
149
+ */
150
+ async getInvites() {
151
+ return this.client.rest.channels.getInvites(this.id);
152
+ }
153
+ /**
154
+ * Get a message in this channel.
155
+ * @param messageID The ID of the message to get.
156
+ */
157
+ async getMessage(messageID) {
158
+ return this.client.rest.channels.getMessage(this.id, messageID);
159
+ }
160
+ /**
161
+ * Get messages in this channel.
162
+ * @param options The options for getting the messages. `before`, `after`, and `around `All are mutually exclusive.
163
+ */
164
+ async getMessages(options) {
165
+ return this.client.rest.channels.getMessages(this.id, options);
166
+ }
167
+ /**
168
+ * Get the pinned messages in this channel.
169
+ */
170
+ async getPinnedMessages() {
171
+ return this.client.rest.channels.getPinnedMessages(this.id);
172
+ }
173
+ /**
174
+ * Get the users who reacted with a specific emoji on a message in this channel.
175
+ * @param messageID The ID of the message to get reactions from.
176
+ * @param emoji The reaction to remove from the message. `name:id` for custom emojis, and the unicode codepoint for default emojis.
177
+ * @param options The options for getting the reactions.
178
+ */
179
+ async getReactions(messageID, emoji, options) {
180
+ return this.client.rest.channels.getReactions(this.id, messageID, emoji, options);
181
+ }
182
+ /**
183
+ * Get the webhooks in this channel.
184
+ */
185
+ async getWebhooks() {
186
+ return this.client.rest.webhooks.getForChannel(this.id);
187
+ }
188
+ /**
189
+ * Get the permissions of a member. If providing an id, the member must be cached.
190
+ * @param member The member to get the permissions of.
191
+ */
192
+ permissionsOf(member) {
193
+ if (typeof member === "string") {
194
+ member = this.guild.members.get(member);
195
+ }
196
+ if (!member) {
197
+ throw new Errors_1.UncachedError(`Cannot use ${this.constructor.name}#permissionsOf with an ID when the member is not cached.`);
198
+ }
199
+ let permission = this.guild.permissionsOf(member).allow;
200
+ if (permission & Constants_1.Permissions.ADMINISTRATOR) {
201
+ return new Permission_1.default(Constants_1.AllPermissions);
202
+ }
203
+ let overwrite = this.permissionOverwrites.get(this.guildID);
204
+ if (overwrite) {
205
+ permission = (permission & ~overwrite.deny) | overwrite.allow;
206
+ }
207
+ let deny = 0n;
208
+ let allow = 0n;
209
+ for (const id of member.roles) {
210
+ if ((overwrite = this.permissionOverwrites.get(id))) {
211
+ deny |= overwrite.deny;
212
+ allow |= overwrite.allow;
213
+ }
214
+ }
215
+ permission = (permission & ~deny) | allow;
216
+ overwrite = this.permissionOverwrites.get(member.id);
217
+ if (overwrite) {
218
+ permission = (permission & ~overwrite.deny) | overwrite.allow;
219
+ }
220
+ return new Permission_1.default(permission);
221
+ }
222
+ /**
223
+ * Pin a message in this channel.
224
+ * @param messageID The ID of the message to pin.
225
+ * @param reason The reason for pinning the message.
226
+ */
227
+ async pinMessage(messageID, reason) {
228
+ return this.client.rest.channels.pinMessage(this.id, messageID, reason);
229
+ }
230
+ /**
231
+ * Purge an amount of messages from this channel.
232
+ * @param options The options to purge. `before`, `after`, and `around `All are mutually exclusive.
233
+ */
234
+ async purge(options) {
235
+ return this.client.rest.channels.purgeMessages(this.id, options);
236
+ }
237
+ /**
238
+ * Show a typing indicator in this channel. How long users see this varies from client to client.
239
+ */
240
+ async sendTyping() {
241
+ return this.client.rest.channels.sendTyping(this.id);
242
+ }
243
+ toJSON() {
244
+ return {
245
+ ...super.toJSON(),
246
+ lastMessageID: this.lastMessageID,
247
+ messages: this.messages.map(message => message.id),
248
+ nsfw: this.nsfw,
249
+ permissionOverwrites: this.permissionOverwrites.map(overwrite => overwrite.toJSON()),
250
+ position: this.position,
251
+ rateLimitPerUser: this.rateLimitPerUser,
252
+ topic: this.topic,
253
+ type: this.type
254
+ };
255
+ }
256
+ /**
257
+ * Unpin a message in this channel.
258
+ * @param messageID The ID of the message to unpin.
259
+ * @param reason The reason for unpinning the message.
260
+ */
261
+ async unpinMessage(messageID, reason) {
262
+ return this.client.rest.channels.unpinMessage(this.id, messageID, reason);
263
+ }
264
+ }
265
+ exports.default = TextableChannel;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ /** @module TextableVoiceChannel */
7
+ const Member_1 = __importDefault(require("./Member.cjs"));
8
+ const TextableChannel_1 = __importDefault(require("./TextableChannel.cjs"));
9
+ const TypedCollection_1 = __importDefault(require("../util/TypedCollection.cjs"));
10
+ /** Represents a textable voice channel. */
11
+ class TextableVoiceChannel extends TextableChannel_1.default {
12
+ constructor(data, client) {
13
+ super(data, client);
14
+ this.bitrate = data.bitrate;
15
+ this.rtcRegion = data.rtc_region;
16
+ this.userLimit = data.user_limit;
17
+ this.videoQualityMode = data.video_quality_mode;
18
+ this.voiceMembers = new TypedCollection_1.default(Member_1.default, client, this.client.util._getLimit("voiceMembers", this.id));
19
+ this.update(data);
20
+ }
21
+ update(data) {
22
+ super.update(data);
23
+ if (data.bitrate !== undefined) {
24
+ this.bitrate = data.bitrate;
25
+ }
26
+ if (data.rtc_region !== undefined) {
27
+ this.rtcRegion = data.rtc_region;
28
+ }
29
+ if (data.user_limit !== undefined) {
30
+ this.userLimit = data.user_limit;
31
+ }
32
+ if (data.video_quality_mode !== undefined) {
33
+ this.videoQualityMode = data.video_quality_mode;
34
+ }
35
+ }
36
+ /** The voice states related to this channel. */
37
+ get voiceStates() {
38
+ return this["_cachedGuild"]?.voiceStates.filter(state => state.channelID === this.id) ?? [];
39
+ }
40
+ /**
41
+ * Join this stage channel.
42
+ * @param options The options to join the channel with.
43
+ */
44
+ join(options) {
45
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument
46
+ return this.client.joinVoiceChannel({
47
+ ...options,
48
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
49
+ voiceAdapterCreator: this.guild.voiceAdapterCreator,
50
+ guildID: this.guildID,
51
+ channelID: this.id
52
+ });
53
+ }
54
+ /** Leave this stage channel. */
55
+ leave() {
56
+ return this.client.leaveVoiceChannel(this.guildID);
57
+ }
58
+ toJSON() {
59
+ return {
60
+ ...super.toJSON(),
61
+ bitrate: this.bitrate,
62
+ rtcRegion: this.rtcRegion,
63
+ type: this.type,
64
+ userLimit: this.userLimit,
65
+ videoQualityMode: this.videoQualityMode,
66
+ voiceMembers: this.voiceMembers.map(member => member.id)
67
+ };
68
+ }
69
+ }
70
+ exports.default = TextableVoiceChannel;