* 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.
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.
* 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
* add new MessageTypes
* Add new properties to the updated models
* add the SystemChannelMessageDeny
unsure if there would be a better name for this enum, given it's inverted nature, open for suggestions
* add PremiumTier flag, add Guild description property
* add method for getting vanity image from CDN
* make the size of GetGuildVanityUrl optional
* lint: remove commented out code from prev commit
* add a None flag to SystemChannelMessage enum
* implement the new modify guild params
* implement additional model properties in IGuild types
* implement GuildMember PremiumSince
* docs: reword size param explanation
* add extension methods that make it easier to check the SystemChannelMessage flags for end users
because the flag is inverted, this ideally should make it easier for the user. it may also be useful to do something similar for modifying this property
* docs: correct typo from copy-paste
* add the premium_subscription_count property
* fix vanity url code and banner switchup
a mistake was made somewhere, that's all I know for sure
* clarify remark on inverted logic for system channel flags
* fix PremiumSubscriptionCount optional value
* add another example to the systemchannelflags xmldoc remark
* docs: fix typos, clarify wording
* use DateTimeOffset for PremiumSince, follow conventions from other prop
* Squashed commit of test rewrite changes
fix missing priority speaker flag
rewrite the TestChannelPermissionModify test
add test for GuildPermission modify
separate unit and integration tests, start writing channel and guild permission tests
copy over the color tests
copy over the emote tests
copy the token utils tests
make the mocked entities sealed classes
copy the TypeReaderTests class
properly dispose the CommandService in the TypeReaderTests
start writing tests for EmbedBuilder and related classes
test that properties throw ArgumentException when invalid
add tests for the embed length property
add withFooter tests
finish adding tests to EmbedBuilder
fix bug in value validation of EmbedFieldBuilder
hey, these tests actually found a bug!
add tests for the MentionUtils class
add tests for the Format util class
remove all of the old tests
add analyzer tests (copied from old tests)
add tests for the SnowflakeUtils class
add integration tests
these get around the issue of state persisting between tests by creating and deleting a guild for each set of tests. these shouldn't be run excessively because of the rate limits, but should be fine every now and then
remove unnecessary launchSettings.json
update outdated string
don't create a new guild each time, as that can result in errors
this can happen if a bot creates too many guilds without properly deleting them
add some tests that show that guild can be modified
await async assert
add more measures that created channels are deleted when done
remove "Test" prefix from test method names
I think that this prefix when already displayed under a class with a suffix of "Tests" is redundant
Remove mention of old test project
fix an issue from forgetting to await Assert.ThrowsAsync
explicitly disable parallelization on integration tests
add test for GuildPermission modify
separate unit and integration tests, start writing channel and guild permission tests
copy over the color tests
copy over the emote tests
make the mocked entities sealed classes
properly dispose the CommandService in the TypeReaderTests
fix bug in value validation of EmbedFieldBuilder
hey, these tests actually found a bug!
add tests for the MentionUtils class
add tests for the Format util class
remove all of the old tests
add analyzer tests (copied from old tests)
add tests for the SnowflakeUtils class
add integration tests
these get around the issue of state persisting between tests by creating and deleting a guild for each set of tests. these shouldn't be run excessively because of the rate limits, but should be fine every now and then
remove unnecessary launchSettings.json
update outdated string
don't create a new guild each time, as that can result in errors
this can happen if a bot creates too many guilds without properly deleting them
add more measures that created channels are deleted when done
remove "Test" prefix from test method names
I think that this prefix when already displayed under a class with a suffix of "Tests" is redundant
Remove mention of old test project
fix an issue from forgetting to await Assert.ThrowsAsync
explicitly disable parallelization on integration tests
update the azure CI build script
separate execution of test projects so that if one fails the other will not pass
one of the unit tests failed, but the analzyer tests passed
fix test that would break in different timezones
enable the integration tests (only on dev branch)
* Squashed commit of test rewrite changes
fix missing priority speaker flag
rewrite the TestChannelPermissionModify test
add test for GuildPermission modify
separate unit and integration tests, start writing channel and guild permission tests
copy over the color tests
copy over the emote tests
copy the token utils tests
make the mocked entities sealed classes
copy the TypeReaderTests class
properly dispose the CommandService in the TypeReaderTests
start writing tests for EmbedBuilder and related classes
test that properties throw ArgumentException when invalid
add tests for the embed length property
add withFooter tests
finish adding tests to EmbedBuilder
fix bug in value validation of EmbedFieldBuilder
hey, these tests actually found a bug!
add tests for the MentionUtils class
add tests for the Format util class
remove all of the old tests
add analyzer tests (copied from old tests)
add tests for the SnowflakeUtils class
add integration tests
these get around the issue of state persisting between tests by creating and deleting a guild for each set of tests. these shouldn't be run excessively because of the rate limits, but should be fine every now and then
remove unnecessary launchSettings.json
update outdated string
don't create a new guild each time, as that can result in errors
this can happen if a bot creates too many guilds without properly deleting them
add some tests that show that guild can be modified
await async assert
add more measures that created channels are deleted when done
remove "Test" prefix from test method names
I think that this prefix when already displayed under a class with a suffix of "Tests" is redundant
Remove mention of old test project
fix an issue from forgetting to await Assert.ThrowsAsync
explicitly disable parallelization on integration tests
add test for GuildPermission modify
separate unit and integration tests, start writing channel and guild permission tests
copy over the color tests
copy over the emote tests
make the mocked entities sealed classes
properly dispose the CommandService in the TypeReaderTests
fix bug in value validation of EmbedFieldBuilder
hey, these tests actually found a bug!
add tests for the MentionUtils class
add tests for the Format util class
remove all of the old tests
add analyzer tests (copied from old tests)
add tests for the SnowflakeUtils class
add integration tests
these get around the issue of state persisting between tests by creating and deleting a guild for each set of tests. these shouldn't be run excessively because of the rate limits, but should be fine every now and then
remove unnecessary launchSettings.json
update outdated string
don't create a new guild each time, as that can result in errors
this can happen if a bot creates too many guilds without properly deleting them
add more measures that created channels are deleted when done
remove "Test" prefix from test method names
I think that this prefix when already displayed under a class with a suffix of "Tests" is redundant
Remove mention of old test project
fix an issue from forgetting to await Assert.ThrowsAsync
explicitly disable parallelization on integration tests
update the azure CI build script
separate execution of test projects so that if one fails the other will not pass
one of the unit tests failed, but the analzyer tests passed
fix test that would break in different timezones
enable the integration tests (only on dev branch)
* Update mocked channels for changed SendFileAsync signature
* comment out the integration tests from the build script
no bot token is provided to this script, and use of integration tests in CI is questionable here
* force rebuild because Azure linux build broke
* WIP commit, update IActivity and IUser with missing types
* incomplete implementation of interfaces
* Add implementation of activity flags, and extension method to check flag
* remove usings that were not required
* clean up files and add documentation where missing
* remove unused usings
* Add remark saying that premium_type info may be inaccessible to bots
it seems that this information can not be accessed by any user,
and may require the identity oauth scope
* Add locale property to the user model
adds the locale property to the user model, which appears not to be
specified for bots
* rename ActivityFlags
* Add incomplete xmldoc to ActivityFlag
Added xmldoc to the ActivityFlag type, excluded flags that i was unsure about
* rename the UserFlags file
* Add incomplete xmldoc to UserFlag enum
* Remove unnecessary extension methods and use built-in functionality
* use <c> tag for xmldoc 'null's
* Add xmldoc for JoinRequest ActivityFlag
* improve the PremiumType xmldoc
* Add zero activityflag
* Add summary tag verbs, example of IUser locale
* Rename Flag enum types to use Properties suffix
* Expose the details field in the Game model
* update Activity extension methods to support Details field
* Use inherited Details implementation in RichGame
* lint: remove commented out code from debugging
* Fix issue in previous commit
* Move oauth-only user fields to SelfUser classes
Moves the implementation of the Flags, PremiumType, and Locale user fields to ISelfUser classes. In testing, it seemed that normal bot accounts did not have this information supplied to them. When tested with a Bearer token in the Rest client, these fields are set.
* remove old HypeSquadEvents flag that appears to have been replaced with the new HypeSquad flags
* Feature: Disconnect users from voice channels
Updates GuildUserProperties to allow for setting either Channel or ChannelId to null, which will disconnect users from voice channels.
The type of ChannelId has been updated from a ulong to ulong?, which matches the latest api documentation.
* docs: update xmldoc wording
* breaking workaround, revert ChannelId to ulong
This is a workaround to prevent this PR from being a breaking
change. Reverts the type of GuildUserProperties#ChannelId to a
ulong from a ulong?. Guild Users may no longer be kicked by
setting this property to null, but setting
GuildUserProperties#Channel should still work.