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
* Clarify command samples by adding additional notes about each methods
* Add additional notes for the Program class
* Change wording on token read
* Change prefix sample to match referenced example
Co-Authored-By: Still34 <341464@gmail.com>
After talking at the Discord.Net channel, @Quahu stated the `member` prop doesn't contain the `user` in this payload (and it's described as being a partial at https://discordapp.com/developers/docs/resources/channel#message-object).
I completed it using the `author` prop, that I believe it's the cleanest way of dealing with it (without changing the GuildMember class or the AddOrUpdateUser method).
Solves #1267
* Use a relative path for docs index page logo
Changes the paths for the logo on the index page of the documentation
to use relative links instead of absolute ones.
The current absolute path is just fine as long as the site
is not hosted under another directory. When opening files locally
(without serving them in docfx) these images will fail to load.
In addition, if these files are served under a directory that is
not the root endpoint (like: `docs.com/stable/`) the images will
also break.
I tested these changes locally using these steps:
- Build & serve docs: `docfx docs/docfx.json --serve`
- Verify that logo shows up on index page using all 3 themes
- Open `docs/_site/index.html`
- Verify logo works on all 3 themes
* Minor grammar fix in DiscordSocketClient
* add a util method for padding base64 strings if they are not of an expected length
* return the original string if it already contains padding, do not throw
* add tests for padding method, and for token that needs padding
Before this change, non-remainder string arguments like @"test \n"
would escape the character 'n', even though there is no reason to.
For the purposes of the command parser, the only character(s) that
can be escaped is the closing quotation mark (typically '"').
This change only removes the backslash character from the resulting
argument if it matches the closing quotation mark. This change
does not affect remainder parameters.
For example:
@"`\\test`" now results in @"`\\test`", not @"`\test`"
@"test \n" results in @"test \n", not "test n"
Fixes the size of the logo on the index page of the documentation.
On mobile or small windows, this logo would be too large.
This adds a rule to the CSS for that logo that fixes it's size.
This resolves#1224.
Previously, raising CommandExecuted for errors was dependent on the
failed result making it back to ExecuteAsync. This is not possible with
async commands, which always pass back a succesful promise result,
rather than their fulfilled result.
This change moves the event invocation for exception'd ExecuteResults to
their source, and excludes ExecuteResult from the late event invocation
in CommandService#ExecuteAsync.