* 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
* Add webhook url overload for DiscordWebhookClient
Adds an overloaded constructor for `DiscordWebhookClient` which accepts the webhook URL. This URL is parsed using a regex for the id and token. If the token is invalid an `ArgumentException` is thrown.
* add null or whitespace check
* add some tests for the new DiscordWebhookClient constructor
* make the Regex static, specify flags
* update regex to look for "discordapp"
* specify reason why exception is thrown despite regex match
* move parsing logic into new function for testing
* Fix#1270 Add the AuthorId to MessageDeleteAuditLogData
Fix#1270
Adds the AuthorId property to MessageDeleteAuditLogData, which is set
by the TargetId in the audit log entry data.
This property is the user id that created those messages in the first place.
I am not aware of an instance of when this value would not be supplied.
* Adjust xmldoc wording
* add News channel type
* remove (very outdated) todo
* add [Socket/Rest]NewsChannel types
* update TextChannel properties to include a Type optional parameter with validation
as of writing, this feature is still only available to verified guilds, which makes it impossible for testing.
* actually create the news channels when given the type
* throw NotSupportedException in News channel
throw a NotSupportedException whenever trying to use SlowModeInterval or anything related to overwrite permissions
* make RestNewsChannel throw NotSupportedException also
* remove the (untested) ability to change channel types