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.
This change updates the NewsChannel classes so that the overwrite permission-related properties no longer throw an Exception when they are used.
These properties were not initially supported by News/Announcement channels when the feature was first released, but now they are.
* Fix#1335 Add isMentionable parameter to CreateRoleAsync in non-breaking manner
This PR adds the isMentionable parameter to the CreateRoleAsync method
in a way that prevents it from being interface-breaking. This has been done
by adding it as an optional parameter at the end of publicly-exposed
methods.
This parameter determines if the newly created role can be mentioned as it is
created.
* Overload CreateRoleAsync methods
This change ensures that SocketUser.ActiveClients will not return null, but instead an empty set by default. This can happen if the client has not recieved a presence update for a user, or if the user is not cached.
* Implement CustomStatusGame activity
Adds the CustomStatusGame class, which is the activity corresponding to the custom status feature.
* Remove unused import from Game.cs
* Added support for Message References
* Removed unused usings, added debugger display, updated ToString override
* Changed snowflakes to be wrapped in an optional instead of a nullable.
This fixes the docs for the command service, where it specifies that arguments that use the params keyword are comma separated, when they are actually space separated.
* Update all dependencies and deal with warning/errors
* Add updated AsyncEnumerable implementation
* Fix broken target
* Cleanup
* Remove obsolete message
* typo
* Update azure pipelines
* Update samples to .NET Core 3.0
* Pull out test change
* Install the .net core 3 SDK on the ubuntu image for the time being
* Target net core 3 for the unit tests because pipelines
* Fix#1381 Guild PreferredLocale support
Adds support for getting and modifying a guild's preferred_locale. This is a language tag in IETF BCP 47 format, which works with the built-in CultureInfo.
While Discord only supports a number of cultures, I think that this restriction should be handled at the API and not by the wrapper. (Also easier on our end)
* Add PreferredCulture to IGuild
This property was defined in RestGuild and SocketGuild, so it only makes sense to make it part of IGuild as well.
* docs: adjust wording of ActivityType.Watching enum
Adjusts the xmldoc summary wording of the ActivityType.Watching enum to
fix a wording issue.
* Add D.NET Logo to Open Graph meta tags
* Update DescriptionGenerator
...And update color to suit the logo better
* Disable smooth scrolling due to user complaints
* Remove unnecessary spacing in sideaffix
* Update footer version
* Remove featherlight plugin
As it is unnecessary and can break image tags
* Adjust wordings regarding safe-handling of secrets
* Fix formatting for first bot token sample
* Add badges to homepage
* Minor wording fixes on terminal
* Update to higher quality PNG
* Add Discord.Net.Example in sln for build validation
* Clarify all instances of IAsnycEnumerable
* Clarify overridden props in SocketNewsChannel
* Add returns and params docs for SyncPermissionsAsync
* Remove/fix invalid XMLdoc strings
* Remove AppVeyor and add GitHub badge
* feature: support X-RateLimit-Reset-After
Users may now optionally disable using the system clock to calculate
the ratelimit duration. This may be overrided globally, via
DiscordConfig, or per RequestOptions.
This change has been built and tested via the integrated test suite,
but has not been tested in the real world. Please verify this does not
break any of the edge-case ratelimits.
* patch: wire new config properties to ApiClient
* patch: update Reset-After parsing precision
This patch applies the changes made to parsing precision in 606dac3.
* Support filtering audit log entries on user, type, and before id
Adds support for filtering audit log entires with GetAuditLogsAsync. Adds the ability to specify a userId and ActionType to filter. Exposes the beforeId filter which was already implemented, yet unused (even when requesting > 100 entries)?
Was thinking that this could expose overloads of GetAuditLogAsync that accepts a IUser and IAuditLogEntry, but dealing with all the combinations of these types may be excessive.
* use only stringbuilder for args instead of string interpolation
* Fix bugs
* Add missing properties
* Add missing properties to ChannelInfo
Remove UserLimit property
* Add missing properties to GuildInfo
Change ContentFilterLevel of type int? to ExplicitContentFilter of type ExplicitContentFilterLevel?
* Remove AvatarHash from MemberInfo
* Add missing doc comments
* Make ExplicitContentFilter public
* Add ChannelId property to overwrite audits
* Update doc comments based on feedback
* Parse double for X-Reset-After instead of float, needs more precision
Float did not contain enough precision to store the millisecond unix
time value, which resulted in the second and millisecond values being
slightly off.
This can be easily tested using:
```cs
> DateTimeOffset.FromUnixTimeMilliseconds((long)(1470173022.123f *
1000)).Millisecond
160 // wrong
> DateTimeOffset.FromUnixTimeMilliseconds((long)(1470173022.123 *
1000)).Millisecond
123 // correct
```
* Parse RateLimit-Reset using an IFormatProvider
* State NumberStyle and use CultureInfo.InvariantCulture for any parsing
This updates most occurances in the code where a Parse or TryParse method was used to explicitly state the NumberStyle, and to use CultureInfo.InvariantCulture.
CultureInfo was used over NumberInfo, as it also works on DateTime parsing too.
* Use default format spec in Commands
Currently, when handling parsing errors, there is no way to know what
parameter caused the error. This change makes the CommandParser create
the parsing error with the current parameter info when ParseAsync()
fails. It is then available through the ErrorParameter of the
ParseResult.
* support X-RateLimit-Reset sending integer or float values
This changes the way that the X-RateLimit-Request header is parsed, so that it will work with both integer seconds and float values with seconds and milliseconds
* Add RateLimitPrecision enum, set X-RateLimit-Precision
Adds the RateLimitPrecision enum, with Second and Millisecond values. (Do we want to use an extension method to convert it into a string, or is ToString().ToLower() fine?)
Adds RateLimitPrecision as a parameter to DiscordRestApiClient, and to DiscordConfig so that it can set the X-RateLimit-Precision header.
* Move reaction methods of IUserMessage to IReactionMessage
Moves the reaction-related methods contained in IUserMessage to the IReactionMessage type. Updates the type of ISystemMessage so that it implements IReactionMessage.
* Move rest reaction implementation to RestReactionMessage
Copies the reaction implementation from RestUserMessage to RestReactionMessage. Updates RestUserMessage and RestSystemMessage to be derived from RestReactionMessage instead of RestMessage.
* Move WS reaction implementation to SocketReactionMessage
Copies the reaction implementation from SocketUserMessage into SocketReactionMessage. Updates SocketSystemMessage and SocketUserMessage to use SocketReactionMessage as the base class.
* docs: update summary for ReactionMessage classes
* Remove ReactionMessage types, move reaction impl to IMessage
Removes the IReactionMessage and derived types, which was unnecessary since all classes derived from IReactionMessage were IMessage.
Moves the reaction implementation to IMessage and derived types.
While it might be more proper to refer to a voice state as composing
a stream (i.e., the IVoiceState is a Stream), this property is ported
up most often to actual user entities. It makes more sense to
communicate that the user is streaming, rather than stating that the
user itself is a stream.
This is also more gramatically consistent with the other voice state
properties (e.g., IsMuted). Movement from noun-form to participle-form
remains inline with the past-participle form used on the other
properties.
* Add self_stream voice state property
Adds the self_stream property which is set true when a user is streaming a video to a voice channel
* use flags for selfstream state instead of its own prop
* implement a fix for tags being found in code blocks
still needs polish, consider this a rough draft
* refactor to reuse a local function
uses CheckWrappedInCode to check that there are no code blocks that surround the tag being parsed
* Add more test coverage of MessageHelper.ParseTags
* reset indexes for @ here mention
* add a test case to catch error fixed from prev commit
* wip commit of most test cases working
* fix the Enclosed in block util method
* code cleanup
* lint whitespace
* lint brackets for single line if blocks
* move messagehelpertests to the new unit test dir
* expose internals to the unit test project
this seems to have been breaking the build, since CI would build the merged branch, where rest wasn't exposed to the unit tests
* Implement Quote Formatting
Adds support for block quote text formatting. This feature is currently only implemented in the Canary client.
This formatting adds a "> " to each new line from the input text.
* add > char to character sanitization
* change assumptions around whitespace strings
* add blockquote (>>>) formatting + test
* Implement Client Status Support
Adds support for using the client_status as sent as part of the Presence model. This value can be used to determine if a user is active on the native desktop app, the mobile app, or the website.
* lint: whitespace in IPresence
* Remove breaking change to IPresence interface with a note for 2.1
* update comment to not reference 2.1
* re-add interface break to IPresence
* add example payload for client_status
* use inline declaration for Enum.TryParse