72 Commits
Author SHA1 Message Date
TTtie b1e27cd71e fix: ensure editChannelPosition works as it should, remove flags (#276)
- Removes `flags` from `editChannelPosition` and `editChannelPositions`
as per [1]
- Adds `reason` to `editChannelPosition{,s}` as an option, and a
parameter respectively per [2].
- Fixes a couple wrongs with `editChannelPosition`:
- Construction of the endpoint still depended on the channel map being
present, which might not be the case when channel maps are disabled
- `options.lockPermissions` and `options.parentID` now correctly affects
only the channel being moved around

Ref:
https://github.com/discord/discord-api-docs/commit/c989436e97b194350ec4712aec77207c2f9f2332
[1]
Ref:
https://github.com/discord/discord-api-docs/commit/ee16658e2304c3b44b2c652f4cae0a4363c4c081
[2]
2026-11-28 22:21:31 +01:00
TTtie 2a81abe958 feat: add support for REST computed role/member permissions (#279)
Ref:
https://github.com/discord/discord-api-docs/commit/9d2128bb8301e7d9f239ff259f2ee41cf4d73c70
2026-11-16 14:20:31 +01:00
TTtie 1371ed80fc feat: support spoiler channels (#253)
Ref:
https://github.com/discord/discord-api-docs/commit/fa2cdf882c2c7dd5007ab6f77a746179f75d0cdd
2026-07-20 06:53:49 +02:00
SnazzahandTTtie 4110a7449b feat: allow channel/thread->guild and guild->shard maps to be disabled (#222)
This should allow for not using the `Client.channelGuildMap`,
`Client.threadGuildMap`, and `Client.guildShardMap` when
`caching.disableMaps` is on.

Some caveats:
- Obviously `getChannel` will do linear searching now, but this can be
skipped with guild hinting. `getChannel` now has a `guildIDHint`
parameter for getting that specific guild rather than searching all of
them. Which has some caveats:
- `editChannelPosition`'s option param has `guildIDHint`, it's channel's
corresponding function will use it.
- Same for `joinVoiceChannel` and `leaveVoiceChannel`, but
`leaveVoiceChannel` has it's hinting in a new parameter.
- `ThreadMember`'s construction to find the guild *will* do linear
searching, sad.
- Many of the shard events that use `getChannel` either now hint at the
guild or just gets the guild directly.

---------

Co-authored-by: TTtie <me@tttie.cz>
2026-05-11 01:04:11 +02:00
TTtie b22fdc24ad chore: remove v0.2.x deprecations (#239) 2026-04-07 12:15:41 +02:00
TTtie dc3129e2a4 refactor: switch to ESLint flat config, add JSDoc linting (#147)
This commit switches Dysnomia over to ESLint flat config for
futureproofing and better maintainability. For the most part, the
codebase will pass the test suite, apart from a few exceptions
introduced by the stylistic plugin which I believe are reasonable to
include.

Additionally, JSDoc linting was added to maintain proper 
alignment of various features.
2024-08-02 18:56:44 +00:00
TTtie 528695abf6 docs: convert inline @prop to actual class members (#113)
this should introduce proper jsdoc inheritance and make it slightly more convertible
also unifies the cases when the docs would be written directly on the class field

* stage 0.5: move all props (almost) everywhere to their own blocks

* convert a couple more structures

* remove stray Guild import

* convert SharedStream, VoiceConnection

* convert Message structure
2023-09-28 20:43:18 +00:00
TTtie f417daf94b refactor(Channel): make the client private (#58)
Makes Channel#client a private property. Brace for impact, this might introduce regressions.
2023-09-23 21:06:04 +00:00
TTtie 1dab74a363 feat: support GUILD_MEDIA channels (#96)
* feat: support GUILD_MEDIA channels

Ref: https://github.com/discord/discord-api-docs/commit/107de2df26c3030e2b3f06c547a56ac96934f4e7

* correct the word order

* add MediaChannel to package exports

* consistency - extract ForumChannel type into a type alias

* add missing intellisense hints to createChannel
2023-08-08 18:36:27 +00:00
TTtie 500cfd5fb0 refactor: bump the minimum node version to 18.x.x (#46)
Let's hope nothing breaks...
2023-04-01 12:23:03 +00:00
TTtieandWilsontheWolf 0df1369a82 chore: pre-v0.1.0 housekeeping (#26)
* add pull request CI

* forgot to checkout the repository :(

* do not fail fast on CI

* deprecate the default export function call

* correct invalid jsdoc

* add guildAuditLogEntryCreate event

* Add deprecation notices to examples using deprecated interfaces

* Add missing deprecation comment to esm.mjs

* export ForumChannel on the main module

* Update flags and interfaces related to OAuth application data

This also includes deprecation of undocumented flags

* fix linting

* fix incorrect invite object construction in GuildAuditLogEntry#target

* update audit log-related interfaces to reflect the current API status

* promote AutoModerationRule to a class; update appropriately

* fix(Client): whoops, return AutoModerationRule in editAutoModerationRule

* Add support for Member#flags

ref: https://github.com/discord/discord-api-docs/commit/5a6c4e10858ae736b09d352b67387a096b4adcdb

* Support GuildChannel#permissions

Available only on channels received on the interaction resolve object

* docs: VoiceChannel#topic does not exist

* add GUILD_DIRECTORY into ChannelTypes enum

* Update the Message interface

* Document ability to use flags when creating a message

* Support rateLimitPerUser in createThreadWithMessage

* correctly sort the Message#thread property

* deprecate/get rid of undocumented guild features

server discovery and hub types are undocumented

* correct getGuildPreview return

* update Guild#toJSON after removal of discovery fields

* support GuildPreview#stickers

* Support GuildIntegration#scopes

* support passing systemChannelFlags to createGuild()

* support editing Guild#premiumProgressBarEnabled

* support rtcRegion and videoQualityMode in createChannel()

* sort endpoints appropriately

* Support editing the guild's MFA level

* return the new MFA level directly

* correctly sort GuildScheduledEvent properties in the doc

* Deprecate undocumented scheduled event constants

* Support fetching event data in getInvite()

* Support associated event data with StageInstance

* Update docs related to stage instance privacy levels

* Support sendStartNotification in createStageInstance

* emit deprecation on getInvite(invID, withCounts, withExpiration)

* SticketPack banner_asset_id is optional

* feat(MessageFlags): add `SUPPRESS_NOTIFICATIONS` message flag (#30)

* Add the new `SUPPRESS_NOTIFICATIONS` message flag

This adds the new `SUPPRESS_NOTIFICATIONS`, as mentioned in https://github.com/discord/discord-api-docs/pull/5910/files

* Update TS definitions

---------

Co-authored-by: TTtie <me@tttie.cz>

* support creating new threads in a forum via webhooks

* remove handling of private_channels on READY

it's been an empty array for bots since 2018, not present in the docs anymore

* add old default forum layout to channel updates

* include components and remove mentionedBy from messageUpdate

* emit possibly uncached guilds in guildBan{Add,Remove} events

* use PossiblyUncached* types consistently

* feat(GuildIntegration): add scopes to toJSON()

* document GuildIntegration#guild

* Support guild integration gateway events

* Support text-in-stage

* doc(Client): specify getGuildAuditLog return type

* quote dev branch install command
# is a comment in some shells

---------

Co-authored-by: WilsontheWolf <33164598+WilsontheWolf@users.noreply.github.com>
2023-02-16 21:07:46 +00:00
TTtie b3fda218d0 feat: forum support (#1)
I believe this should be enough to ensure full forum support. Although, some things might've been missed out by accident.
2022-11-28 06:25:54 +00:00
Donovan Daniels 91d29f9157 refactor: Overall Consistency Fixes & Minor Feature Additions (PR 1379) 2022-10-06 20:15:34 +00:00
Donovan Daniels 18deb89d2d refactor: remove StoreChannels (PR 1405) 2022-10-06 19:48:19 +00:00
bsian03 80a8b894b4 Remove all user account features (PR 1338) 2022-09-16 12:32:41 +00:00
isaiah ba4cb94cd9 fix(editChannel): fix videoQualityMode & add permissionOverwrites (#1319) 2022-06-08 06:28:50 +00:00
d6df49a3ac feat: Text-in-Voice (#1298)
Co-authored-by: bsian03 <chharry321@gmail.com>
Co-authored-by: Donovan Daniels <hewwo@yiff.rocks>
2022-06-01 23:56:32 +01:00
F Robinson bb8a45ec19 Add position to CreateChannelOptions (#1340)
* Add position to CreateChannelOptions

* Add "guild channels only" comment to editChannel position
2022-03-08 20:42:42 -05:00
3fe4d216ca Support Discord API v9 (#1279)
Co-authored-by: Donovan Daniels <hewwo@yiff.rocks>
Co-authored-by: iiFDCT <35053522+iiFDCT@users.noreply.github.com>
Co-authored-by: Lava <service.github@lava.moe>
Co-authored-by: abalabahaha <hi@abal.moe>
2021-11-13 23:06:57 -08:00
e194a71c0f REST v8, Gateway v8 (#1038)
Co-authored-by: macdja38 <jakeincanada@icloud.com>
Co-authored-by: bsian03 <chharry321@gmail.com>
Co-authored-by: abalabahaha <hi@abal.moe>
2021-07-13 04:04:21 -07:00
bsian03 7e55222694 Allow passing a plain object to permissionsOf (#1224)
Co-authored by: curtisf <caf203@gmail.com>
2021-07-12 18:25:00 +01:00
abalabahaha 39dd05f137 Allow number type for permissions over REST 2021-04-04 02:48:32 +00:00
abalabahaha d7c69f29b1 Use BigInt for permissions over REST 2021-04-03 19:23:20 +00:00
abalabahaha 3649cd797f Migrate permissions to BigInt 2021-04-03 15:04:24 +00:00
bsian03andabalabahaha 9da9d05596 Expose video quality mode (#1157)
Co-authored-by: abalabahaha <hi@abal.moe>
2021-04-02 00:58:07 -07:00
bsian03 f9941179c4 Expose voice channel RTC region (#1161) 2021-04-02 00:41:36 -07:00
Khaaz fc038fab50 Support new options for editChannelPosition() (#1034) 2021-03-24 17:12:17 -07:00
Donovan Daniels 7d029d099f Remove legacy name-based GuildChannel#nsfw check (#1110) 2021-03-24 09:49:30 -07:00
814f92b813 Documentation tidyup/updates (#993)
Co-authored-by: jtsshieh <27078349+jtsshieh@users.noreply.github.com>
Co-authored-by: Donovan Daniels <dwddaniels262@gmail.com>
Co-authored-by: Geo <georgej1088@gmail.com>
2020-10-23 09:23:08 -07:00
Alex Taxiera 95c4e0fdcf Accept Member in permissionsOf() (#998) 2020-08-19 08:06:13 -07:00
LJ ba0f2bff03 Expose Channel#client (#622) 2020-01-20 03:38:37 -08:00
Apacheli 6bc8993265 Fix createGuild() reference error (#588) 2019-12-31 18:11:11 -08:00
Apacheli 07ba8f2426 Add curly linter rule (#581) 2019-11-30 17:46:45 -08:00
Apacheli d67880d8b7 Unify toJSON() logic (#570) 2019-11-25 15:17:23 -08:00
KhaaZ 3bdeb5b03b Conditionally update struct properties (#568) 2019-11-23 13:02:23 -08:00
Apacheli#6009 236dbf4ba9 Add Channel.from() helper (#565) 2019-11-23 12:33:48 -08:00
Skillz4Killz 21805a8d34 Fix typings typos (#560)
- Some embed field properties are not optional

- Fix `GuildChannel#edit` `options` typings

- Fix `Overwrite#type` typings
2019-11-20 10:17:39 -08:00
Alex Taxiera 6148a45e3d Add stricter eslint rules (#549) 2019-10-31 12:17:24 -07:00
Apacheli 31a98c0f7a Code/style fixes (#507) 2019-07-26 14:26:16 -07:00
Tyler Ricketts 247092d721 NewsChannel (type 5) Support (#472) 2019-04-19 03:27:52 -07:00
abalabahaha 19257d507b Handle updated guild channel types 2019-03-07 22:33:36 -08:00
abalabahaha 0e06348f15 Add rateLimitPerUser property to guild text channels 2018-09-19 16:00:09 -07:00
abalabahaha ed3997020d Fix toJSON on structures
Actually exclude undefined props while keeping falsy props

94019f1/#400 made some bad assumptions about order of operations
2018-08-02 18:04:10 -07:00
LJ 2ddfd2d6d8 Upgrade to Node 8 (#408)
Finally.

Closes #402
2018-08-02 01:01:59 -07:00
George 94019f1f5f Fix falsy properties on inspect/toJSON methods (#400)
* Don't omit falsy values from structure inspection

Also fixes an issue with toJSON for messages having a typo'd prop name

* Fix Message#editedTimestamp being NaN
2018-07-15 17:31:28 -07:00
Neto Becker f675772403 Fix Channel contruction on REST mode (#339) 2017-12-16 17:15:38 -08:00
abalabahaha cbd4674d67 Make everything important toJSON()able (fix #288)
Without circles!

There's probably a million better ways to do this. If you have one, please suggest it in the Discord
2017-10-08 17:12:54 -07:00
LJNeon 7eace2a047 Split GuildChannel into TextChannel and VoiceChannel (#301)
* replaced GuildChannel with TextChannel and VoiceChannel

* removed redundant mention property from TextChannel

* added GuildChannel class

* added GuildChannel to index.js

* fixed undefined guild property

* added unused properties to CategoryChannel

* fixed docs for CategoryChannel

* fixed GuildChannel.edit docs

* fixed docs for Category/VoiceChannel

* removing conflicts
2017-09-22 12:18:59 -07:00
abalabahaha a83deef9d4 Category channel (type 4) support 2017-09-08 19:27:21 -07:00
Thewsomeguy 0f1d776045 Use new NSFW logic (#282)
* Use NSFW value returned by discord api

* Updated nsfw check
2017-08-19 21:05:18 -07:00