Commit Graph

400 Commits

Author SHA1 Message Date
Zack Broderson
4c9910cf71 (ifcbrk) feature: Add ability to add/remove roles by id (#1757)
* Scaffold Add/Remove roles by id. (needs impl & docs)

* Add docs

* Add implementation

* Expose Add/Remove role endpoints

* Formatting

* Fix wrong method call
2021-04-29 11:34:52 -03:00
Paulo
365a848f7a (ifcbrk) feature: Add ModifyMessageAsync to IMessageChannel (#1830) 2021-04-29 11:33:39 -03:00
Playwo
5b244f215b feature: Add methods to interact with reactions without a message object (#1828) 2021-04-28 11:42:58 -03:00
NeKz
df23d57458 feature: Add GetEmotesAsync to IGuild (#1781) 2021-04-28 11:08:56 -03:00
Desmont
f67cd8ea55 feature: Webhook message edit & delete functionality (#1753)
* feature: Webhook message edit & delete functionality

* PR fixes: Rename Edit* to Modify*; Add more detailed docstrings; Small validation fixes

* Fix spacing around docstrings

* Make ModifyWebhookMessageParams.Content Optional<string>

* Change the Webhook message edit functionality to use a object delegate method instead providing the all parameters

Co-authored-by: Desmont <desmont@users.noreply.github.com>
2021-04-28 10:15:16 -03:00
Paulo
91a906397a feature: Add stickers (#1726) 2021-04-28 10:11:28 -03:00
Paulo
d41aeee4fe fix: Audit log UserId can be null (#1794) 2021-03-10 16:50:14 -03:00
Alex Gravely
d2518db9a8 fix: Update Webhook ChannelId from model change (#1791) 2021-03-10 16:22:00 -03:00
NeKz
f794163ffa fix: NullReferenceException in pin/unpin audit logs (#1780) 2021-03-10 16:07:19 -03:00
NeKz
6ac5ea1cbb fix: Add ChannelType property to ChannelInfo audit log (#1786) 2021-03-10 14:50:48 -03:00
Paulo
2095701665 fix: Missing MessageReference when sending files 2021-01-21 18:08:46 -03:00
quinchs
8b25c9bbfb feature: Add GuildUser IsPending property (#1731)
* Implemented Pending property

* Implemented changes
2020-12-23 12:47:54 -03:00
Paulo
225550dc5a feature: Add MessageFlags and AllowedMentions to message modify (#1724)
* feature: Add MessageFlags and AllowedMentions to Modify

* Change exception message
2020-12-23 12:47:20 -03:00
Paulo
c683b2901d feature: Add user public flags (#1722) 2020-12-23 12:46:42 -03:00
Paulo
6a62c4770c feature: Add role tags (#1721) 2020-12-23 12:46:27 -03:00
Paulo
4a7f8fec93 fix: Move and fix internal AllowedMentions object (#1727) 2020-12-20 07:37:32 -03:00
Fyers
dd2e524ff9 fix: Invite and InviteMetadata properties (#1639)
* fixes #1495

* keep obsolete properties and return types for compatibility

* missing properties for SocketInvite

* Restore xml docs and change obsolete message

Co-authored-by: Paulo <pnmanjos@hotmail.com>
2020-12-19 11:39:09 -03:00
Still Hsu
e0f8737c35 Add initial StyleCops style enforcement 2020-12-14 12:00:53 +08:00
Still Hsu
9ea3291ef1 Resolve inheritdocs warning 2020-12-14 11:59:32 +08:00
Paulo
e3850e1e8f feature: Add inline replies (#1659)
* Add inline replies

* Missed a few things

* Change xml docs, IUserMessage, and other changes

* Missed one when changing

* Fix referencedMessage author
2020-11-22 00:43:38 -03:00
Paulo
ec673e1863 feature: Implement gateway ratelimit (#1537)
* Implement gateway ratelimit

* Remove unused code

* Share WebSocketRequestQueue between clients

* Add global limit and a way to change gateway limits

* Refactoring variable to fit lib standards

* Update xml docs

* Update xml docs

* Move warning to remarks

* Remove specific RequestQueue for WebSocket and other changes

The only account limit is for identify that is dealt in a different way (exclusive semaphore), so websocket queues can be shared with REST and don't need to be shared between clients anymore.

Also added the ratelimit for presence updates.

* Add summary to IdentifySemaphoreName

* Fix spacing

* Add max_concurrency and other fixes

- Add session_start_limit to GetBotGatewayResponse
- Add GetBotGatewayAsync to IDiscordClient
- Add master/slave semaphores to enable concurrency
- Not store semaphore name as static
- Clone GatewayLimits when cloning the Config

* Add missing RequestQueue parameter and wrong nullable

* Add RequeueQueue paramater to Webhook

* Better xml documentation

* Remove GatewayLimits class and other changes

- Remove GatewayLimits
- Transfer a few properties to DiscordSocketConfig
- Remove unnecessary usings

* Remove unnecessary using and wording

* Remove more unnecessary usings

* Change named Semaphores to SemaphoreSlim

* Remove unused using

* Update branch

* Fix merge conflicts and update to new ratelimit

* Fixing merge, ignore limit for heartbeat, and dispose

* Missed one place and better xml docs.

* Wait identify before opening the connection

* Only request identify ticket when needed

* Move identify control to sharded client

* Better description for IdentifyMaxConcurrency

* Add lock to InvalidSession
2020-11-18 23:40:09 -03:00
Paulo
97e71cd5e5 fix: Revert PremiumSubscriptionCount type (#1686) 2020-11-18 14:52:00 -03:00
Paulo
ec212b175d feature: Add missing properties to Guild and deprecate GuildEmbed (#1573)
* Add missing properties to Guild, related methods, and deprecate GuildEmbed endpoints

- Add missing guild properties: `discovery_splash`, `widget_enabled`, `widget_channel_id`, `rules_channel_id`, `max_presences`, `max_presences`, `max_members`, `public_updates_channel_id`, `max_video_channel_users`, `approximate_member_count`, `approximate_presence_count`
- Update guild properties: `embed_enabled`, `embed_channel_id`
- Add `GetGuildDiscoverySplashUrl` to `CDN`
- Add classes related to the guild widget
- Add `withCounts` parameter to `GetGuild(s)Async`
- Make GuildEmbed related methods obsolete with a message redirecting to widget ones

* Change xml docs and PremiumSubscriptionCount type

* Changed some xml docs
2020-11-17 05:23:45 -03:00
Paulo
04389a4f3e fix: Emoji url encode (#1681) 2020-11-17 05:11:25 -03:00
Paulo
47ed806418 misc: Change ratelimit messages (#1678) 2020-11-15 13:20:08 -03:00
Paulo
be60d813f7 fix: Team is nullable, not optional (#1672) 2020-11-09 15:39:08 -03:00
Paulo
05a1f0a709 fix: Discord sends null when there's no team 2020-11-09 12:31:17 -03:00
Paulo
9134443494 fix: Crosspost throwing InvalidOperationException (#1671)
* Add INewsChannel

* Renaming variable to match the new type
2020-11-08 19:29:15 -03:00
Paulo
10fcde0a32 feature: Add missing application properties (including Teams) (#1604)
* Add missing application properties

Add IsBotPublic, BotRequiresCodeGrant, and Team properties to IApplication

* To immutable list

* Change list to array
2020-11-08 18:13:41 -03:00
Radka Gustavsson
a80e5ff940 (ifcbrk) feature: Add includeRoleIds to PruneUsersAsync (#1581)
* Implemented include_roles for guilds/id/prune get&post

* Unnecessary using

Co-authored-by: Paulo <pnmanjos@hotmail.com>
2020-11-07 15:55:14 -03:00
Matt Smith
971d519e35 fix: GuildEmbed.ChannelId as nullable per API documentation (#1532) 2020-11-07 15:44:33 -03:00
Paulo
ae9fff6380 fix: Check error 404 and return null for GetBanAsync (#1614) 2020-10-28 18:03:08 -03:00
Paulo
bd4516b035 (ifcbrk) fix: Add AllowedMentions to webhooks (#1602) 2020-10-28 17:52:06 -03:00
Paulo
43c8fc0535 fix: Voice overwrites and CategoryId remarks (#1608)
* Add overwrites to voice and change CategoryId docs

* Let's not forget another one
2020-10-28 17:51:16 -03:00
Paulo
366ca9a562 fix: Parse mentions from message payload (#1621) 2020-10-14 18:02:33 -04:00
Paulo
b95b95bdcb fix: Invite audit log without inviter (#1599)
* Fix possible invite without inviter

* Prevent the same for InviteCreate

* Update Creator property docs
2020-08-05 20:16:59 -04:00
Paulo
2f6c0175c8 fix: Different ratelimits for the same route (implement discord buckets) (#1546)
* Don't disable when there's no resetTick

Sometimes Discord won't send any ratelimit headers, disabling the semaphore for endpoints that should have them.

* Undo changes and change comment

* Add HttpMethod to BucketIds

* Add X-RateLimit-Bucket

* BucketId changes

- BucketId is it's own class now
- Add WebhookId as a major parameter
- Add shared buckets using the hash and major parameters

* Add webhookId to BucketIds

* Update BucketId and redirect requests

* General bugfixes

* Assign semaphore and follow the same standard as Reset for ResetAfter
2020-08-05 20:16:21 -04:00
Paulo
421a0c12cc feature: support reading multiple activities (#1520) 2020-08-01 12:43:56 -04:00
Paulo
2d80037f6b feature: Add missing channel properties (#1596) 2020-08-01 01:26:24 -04:00
Paulo
42ba3720e3 fix: Trim token before passing it to the authorization header (#1578)
* Trim token

* Trim when assigning to AuthToken
2020-07-18 13:52:23 -04:00
Mustafa Salih ASLIM
468f8264d0 fix: unsupported property causes an exception (#1469)
fix for: https://github.com/discord-net/Discord.Net/issues/1436

`SlowModeInterval` property causes an exception for Announcement Channel feature if it is enabled on discord. Should be checked whether it is specified or not before set to property.
2020-07-10 00:13:46 -04:00
Paulo
ab32607bcc (ifcbrk) fix: Add AllowedMentions to SendFileAsync (#1531)
* Add AllowedMentions to SendFileAsync

* Update xml reference and mocked channels
2020-06-17 23:51:50 -04:00
Paulo
f2130f8513 feature: Add Direction.Around to GetMessagesAsync (#1526)
* Add Direction.Around to GetMessagesAsync

* Reuse the method

* Reuse GetMany

* Fix limit when getting from cache without message id

* Fix limit when getting from rest without message id

* Change cache return

It will return in a similar way to REST
2020-06-17 23:48:45 -04:00
Christopher Felegy
3df05399ea nit: remove redundant CreateGuildRoleParams
CreateGuildRoleParams is identical to ModifyGuildRoleParams, so just use
the latter when creating new roles.
2020-06-15 00:29:16 -04:00
Bram
5430cc8df9 fix: Sending 2 requests instead of 1 to create a Guild role. (#1557)
The GuildHelper.CreateRoleAsync() was sending 2 requests to create a role. One to create the role, and one to modify the role that was created. This can be done in one request. So i have moved it to a single request to lower the amount of requests send to the api. This will also solve issue #1451.
2020-06-15 00:11:05 -04:00
Paulo
a89f0761f4 feature: Add MESSAGE_REACTION_REMOVE_EMOJI and RemoveAllReactionsForEmoteAsync (#1544)
* Add event and method

* Simplify convert to IEmote
2020-06-15 00:04:34 -04:00
Paulo
57880de5b8 (ifcbrk) Add SearchUsersAsync (#1556) 2020-06-15 00:02:23 -04:00
Matt Smith
a6c1e4c23f (ifcbrk) feature: news channel publishing (#1530)
* Added PublishAsync to Messages.

* Added missing implementation.

* 1. Aligned with naming standards
2. Clarified xml docs
3. Properly threw exceptions instead of failing silently.

* Additional documentation included.

* Removed un-needed comments.

Co-authored-by: Matt Smith <v-matsm@microsoft.com>
2020-05-20 17:28:23 -04:00
FiniteReality
08d9834e2c fix: Ensure resetAt is in the future
If the current reset time is in the past, then somebody else in the
current bucket must have made a request before we were able to. To
prevent accidental ratelimits, we fall-back to the second sleep
branch, as if the reset time wasn't specified at all.

Additionally Extracts the minimum sleep time to a constant, and also
bumps it to 750ms.
2020-05-18 18:06:30 +01:00
FiniteReality
d294678ed5 fix: use UtcNow when computing reset tick 2020-05-18 16:48:56 +01:00