* 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.
* Set the @everyone IRole for @everyone and @here tags
Adds support for setting the IRole corresponding to @everyone or @here in a the tags of a message. Previously this would only set the TagType, but leave the value as null.
This does not distinguish between @everyone and @here, as that's done using TagType. The values of both will be the same.
This issue was suggested by @TheCasino
* use the EveryoneRole property
oops
* use null conditional operator instead of a null check
The DiscordSocketClient and DiscordSocketRestClient share the same
backing API client, so the Log events on both clients will be raised
from the same API calls. Proxying log events from the
DiscordSocketRestClient then means that the Log event the user hooks
into will be raised twice for a single log message.
Thanks to @TheCasino for noticing this.
Resolves#1238.
I'm not sure where this bug came from, a git blame revealed no change to
the timed event handler code since it was initiall written two years
ago.
I've found that when the event handler times out, the handler task will
be manually completed (as opposed to within Task.WhenAny), which then
bubbles the exception and allows the error to be logged.
Ensuring that the handler is completed individually, regardless of
whether or not the timeout task completed, seems to fix this problem.
Resolves#1216.
* Add support for spoiler formatting
* Implement support for sending message attachments that are spoilers
* use consistent naming
* update docstring for new isSpoiler param
* move extension method to be under core project, make spoiler prefix a const
* typo fix
* update missing xmldocs
* move SpoilerPrefix const outside of interface
* Add isSpoiler support to webhook client
adds the isSpoiler field to uploading files with a webhook, which will only
insert "SPOILER_" to the start of the filename. This does not include other
fields in the payload, as this is not in the documentation, and was not observed
like in the regular client
The embed should not display nickname#discriminator as that's incorrect.
So the extension was scrapped altogether to use the IUser (and by inheritance, IGuildUser) one.
* Remove template in favor of official samples
* Fixed a variable name copy pasta mistake
line 35 was _database.GetData() instead of DBService.GetData()
* Experimental theme change
* Change paragraph, code, heading fonts
* Widen viewport
* Update DocFX.Plugins.LastModified v1.2.3
* Exclude Discord.API in docs
* Add remarks for SocketReaction properties
* Add examples for BaseSocketClient.Events
* Add additional clarification for some methods
* Move IUser and IGuildChannel examples
* Clarify several guides samples with notes
- Reword TypeReader comment to avoid giving the idea that the sample itself is "obsolete"
- Remove CommandException logging comment regarding C#7.0 as the version is now the standard across VS2017 and up
- Remove suggestion about handling result in command handler since it is now advised to use CommandExecuted instead
+ Add additional comment to clarify ctor for DI setup
* Add/migrate code examples
* Incorporate material design theme
License @ https://github.com/ovasquez
* Update installation and nightly guide
* Fix improper indentations made obvious by the widen viewport
* Fix minor grammar issues
+ Add installation for nightly build using dotnet CLI
* Fix nav level indentation
* Revise "Your First Bot" article
* Merge some paragraphs to avoid clutter while keeping readability
* Reword the use of command framework
+ Add additional warning/note about environment variable
* Add additional indent level
* Fix indentation text warping
* Remove connections sample
* Update logging sample
Remove redundant part of the sample
* Remove mention of RPC
* Remove misleading section about commands
- Remove command sample from complete snippet
* Revise "Your First Bot" command paragraphs
* Change wording to hint devs that additional command parser packages may be available, as more and more begin to crop up
* Update themes
* Add XML docs contribution guidelines
Update guidelines
* Update CommandExecuted remarks
* Fix precondition remarks typo
no one saw that ok
* Fix permission sample in docfx
* Fix IMessageChannel samples
* Update docs/_template/light-dark-theme/styles/docfx.vendor.minify.css
Co-Authored-By: Still34 <341464@gmail.com>
* Update docs/_template/light-dark-theme/styles/material.css
Co-Authored-By: Still34 <341464@gmail.com>
* Update docs/_template/light-dark-theme/styles/material.css
Co-Authored-By: Still34 <341464@gmail.com>
* Trim whitespace from tokens before logging in
This change trims whitespace characters from the supplied token before it is used to log in. Users can encounter this accidentally if they read their token from a file that ends with a blank line.
Leading whitespace will make the token invalid. Trailing whitespace or \n (not \r\n) will also fail to log in. \r\n (CRLF) doesn't fail because of the line break style for http request headers.
* revert trimming api token
* add check for whitespace or newline characters to existing token validation
Checks to see if a token contains any illegal characters, like whitespace or a newline. If it is, throws an ArgumentException warning the user that their token may be invalid.
I considered only checking the first and last character, but given that a token containing whitespace or a newline wouldn't work either I figured this made sense.
* removed unused usings
These were leftover from a previous approach using an ImmutableHashSet