* Add inline replies
* Missed a few things
* Change xml docs, IUserMessage, and other changes
* Missed one when changing
* Fix referencedMessage author
* 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
* 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
* Add invite events (create and delete)
* Removed unused using
* Fixing IInviteMetadata properties
* Add two new fields to the gateway event
* Better event summary and remarks
* Change how to assign to target variable
Co-Authored-By: Joe4evr <jii.geugten@gmail.com>
* Applying suggested changes to TargetUserType
* Renaming NotDefined to Undefined
* Fixing xml docs
* Changed the summary style format
Co-authored-by: Joe4evr <jii.geugten@gmail.com>
Sometimes Discord messes up and leaves a guild with a null PreferredLocale, causing an error to be thrown. This fixes that from Discord.Net's end even though it's Discord's fault.
* Fix: Using the correct discord domain.
* Fix: Using the correct discord domain.
* Docs: Using the correct discord domain.
* Fix: Changed canary and ptb to the new domain.
* Fix Ready and AlwaysDownloadUsers
Ready could fire before downloading all guild data and downloading guild users one guild per time without gateway intents is a waste of a gateway request that can support up to 1000.
* Reduce batchSize and fix count
* Fix typo
* Split xml docs line
Co-authored-by: Christopher Felegy <cfelegy@riseup.net>
* 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
* Support Gateway Intents
Allows supplying gateway intents through DiscordSocketConfig which will be passed through the IDENTIFY payload, in order to choose what gateway events you want to receive.
* Fixing enum casing
* Feedback
* Updating comment for GuildSubscriptions
* Comment update
## Summary
If PartyId isn't present, Discord.Net will throw an InvalidOperationException and not raise `MessageReceived`.
Got this a few times with my bot, stacktrace:
```
System.InvalidOperationException: This property has no value set.
at Discord.Optional`1.get_Value() in ...\Discord.Net\src\Discord.Net.Core\Utils\Optional.cs:line 20
at Discord.WebSocket.SocketMessage.Update(ClientState state, Message model) in ...\Discord.Net\src\Discord.Net.WebSocket\Entities\Messages\SocketMessage.cs:line 157
at Discord.WebSocket.SocketUserMessage.Update(ClientState state, Message model) in ...\Discord.Net\src\Discord.Net.WebSocket\Entities\Messages\SocketUserMessage.cs:line 58
at Discord.WebSocket.SocketUserMessage.Create(DiscordSocketClient discord, ClientState state, SocketUser author, ISocketMessageChannel channel, Message model) in ...\Discord.Net\src\Discord.Net.WebSocket\Entities\Messages\SocketUserMessage.cs:line 53
at Discord.WebSocket.DiscordSocketClient.ProcessMessageAsync(GatewayOpCode opCode, Nullable`1 seq, String type, Object payload) in ...\Discord.Net\src\Discord.Net.WebSocket\DiscordSocketClient.cs:line 1210
```
After looking all properties, this is the only one that could be blamed and was already fixed for `RestMessage`s, see #1337
## Changes
- `Value` to `GetValueOrDefault()` for `PartyId`
* Fix for Issue #1471
This change will allow `GuildAvailable` to fire when the client joins a new guild, as well as properly update `IsConnected`.
* Removed unnecessary statement;
* Feature: Allowed mentions object on msg create (interface breaking)
This change implements the AllowedMentions object for the payload of message creation. By default, the mentions behavior remains unchanged, the message content is parsed for all mentionable entities and they are all notified. If this payload is not null, it will use the content of the allowed_mentions field to determine if a role is notified, or just displayed.
This change is interface breaking. This follows the conventions of keeping RequestOptions as the last argument, but could break some users who specify each of these arguments without using named arguments.
* lint: remove commented-out code
This change removes the commented-out code which was added during testing from the previous commit.
* fix interface break: reorder allowedMentions arg so that it's after options
This change modifies the order of the AllowedMentions argument of SendMessageAsync so that this addition shouldn't be interface breaking. The downside to this change is that it breaks the convention followed by other methods, where the RequestOptions argument is normally last.
* docs: fix typo in allowedMentions arg doc
* fix interface break arg from IRestMessageChannel
* docs: update xmldoc for allowedMentions args
* fix interface breaking arg order for ISocketMessageChannel
* fix mocked classes that weren't updated
* fix: RestDMChannel#SendMessageAsync bug, allowed mentions always null
This change fixes a bug that was introduced while testing changes to the interface of the SendMessageAsync method to try and retain interface compatibility
* docs: update xmldoc for AllowedMentions type
* docs: reword xmldoc of AllowedMentionTypes type
* docs: fix typo
* fix: validate that User/Role flags and UserIds/RoleIds lists are mutually exclusive
This change adds validation to SendMessageAsync which checks that the User flag is mutually exclusive with the list of UserIds, and that the Role flag is also mutually exclusive with the list of RoleIds
* docs: reword summaries for AllowedMentions type
* Add util properties for specifying all or no mentions
Adds read only properties which specify that all mentions or no mentions will notify users. These settings might be more common than others, so this would make them easier to use.
* docs: Resolve PR comments for documentation issues/typos
This change fixes a bug that was introduced in PR #1406. Games were falsely detected to be CustomStatusGames, based on the Id property being included in the model payload.
This fixes the false detection of Games as CustomStatusGame. An activity will only be considered a CustomStatusGame if the Id has a value of "custom".
This change has been tested by listening to the GuildMemberUpdated event, and opening/closing games with a custom status set.
* Fixed GetUsersAsync to use MaxUsersPerBatch const as limit instead of MaxMessagesPerBatch.
Requests are now returning up to 1000 guild user entities instead of the previous 100.
* Added StartedAt and EndsAt timespans for SpotifyGame.
They make it possible to expose track's Elapsed and Remaining properties.
* Moved Duration to be initialized within model construction.
* Updated StartedAt and EndsAt comments.