* Initial commit of changes. Changed permissions from bitwise index to use bitwise flags instead. Modified relevant methods involved
* Revised enum value naming
* Added FlagsAttribute to ChannelPermission, GuildPermission
* Added comments per Joe4evr suggestion
* Added underlines to hex value digits for readability per Joe4evr suggestion
* updated names to better reflect actual permission names as per SubZero0 suggestion
* fix for 236775c2d8
* Replaced Math.Pow with left shift operator
* Cleaned up the formatting of ChannelPermission and GuildPermission enums to make it easier to read
* Improve Boolean Property Summaries
Having the `CaseSensitiveCommands` property summary asking a question whenever Intellisense is invoked seems a bit nonessential instead of *properly* explaining what exactly it does. It would be better if instead, it stated it's use to be more comprehensible to the reader.
### Changes
- Edits the summaries of `CaseSensitiveCommands` and `ThrowOnError` to follow a more methodical convention for boolean property summaries (`Determines whether X ...` rather than `Should X be ... ?`).
This is just a small change to improve upon the current documentation, so it shouldn't conflict with anything.
* "DefaultRunMode should also be "Gets or sets blah blah blah" to be consistent."
* Add NullableTypeReader.
Primitives now also load a NullableTypeReader<T> and any value types that get a typereader added will also have a NullableTypeReader<T> added for it.
* Remove unnecessary null check.
* Added docstrings.
* Changed Guild#DefaultChannel to resolve the first accessible channel
Resolves#776
This change is inline with hammerandchisel/discord-api-docs#329
RestGuild#DefaultChannelId is now obsolete and will throw a
NotSupportedException.
* RestGuild#DefaultChannelId will fall back to the guild ID
Adding an exception here would be a breaking change, so this was agreed
to fall back to the previous behavior, which would just return the guild
ID.
IChannel.IsNsfw will now return false when being used on any channel
that is not an ITextChannel. When being used on an ITextChannel, this
will now account for the API flag, and fall back to the channel name.
(this is gross design, thanks discord)
Seeing as D.NET will warn you about an impending BadRequest if you try and send an empty field, why not make it warn about the impending BadRequest if you try and send a whitespace field?
* Fix potential nullref in embedBuilder value setter
* Null check on footer iconUrl
* Adding checks for the other URL properties
* Adding IsNullOrUri extension
* Setting StringExtensions as internal
* Add embed builder extensions
People in #dotnet_discord-net suggested that this should be part of
the lib after I demonstrated it
* Move some extensions into EmbedBuilder [2]
Apparently git didn't like that previous commit
* Fix error with EmbedBuilderExtensions
A summary of issues which happened:
- Git decided to add an amend commit (I told it to quit?)
- VS Code thinks everything is an error so it wasn't helpful
- dotnet decided to think there was no error until I deleted all
build outputs and rebuild
Sometimes I question my ability to use version control properly.
* Allow commands to return a Task<RuntimeResult>
This allows bot developers to centralize command result logic by
using result data whether the command as successful or not.
Example usage:
```csharp
var _result = await Commands.ExecuteAsync(context, argPos);
if (_result is RuntimeResult result)
{
await message.Channel.SendMessageAsync(result.Reason);
}
else if (!_result.IsSuccess)
{
// Previous error handling
}
```
The RuntimeResult class can be subclassed too, for example:
```csharp
var _result = await Commands.ExecuteAsync(context, argPos);
if (_result is MySubclassedResult result)
{
var builder = new EmbedBuilder();
for (var pair in result.Data)
{
builder.AddField(pair.Key, pair.Value, true);
}
await message.Channel.SendMessageAsync("", embed: builder);
}
else if (_result is RuntimeResult result)
{
await message.Channel.SendMessageAsync(result.Reason);
}
else if (!_result.IsSuccess)
{
// Previous error handling
}
```
* Make RuntimeResult's ctor protected
* Make RuntimeResult abstract
It never really made sense to have it instantiable in the first place,
frankly.