Commit Graph

2728 Commits

Author SHA1 Message Date
Chris Johnston
30e867a183 Implement welcome message channels (#819) 2017-09-23 17:00:08 -04:00
Joe4evr
e25054bb3b Update WS4Net dependency to 0.15.0 (#812)
Also changes target to NetStandard1.3
2017-09-10 23:14:45 -04:00
Alex Gravely
ec03883e26 Create unspecified channel object for unknown channel types (#811)
* Partial fix of #810, addresses critical connection issues.

* Implement fix for REST.

* Implement fix on RestChannel.
2017-09-09 15:56:03 +01:00
Mark Gross
479361bbea Condense redundant AddField overloads in EmbedBuilder (#790)
* Remove extra AddField overload in EmbedBuilder

* Remove AddInlineField()
2017-08-29 19:38:34 -04:00
Christopher F
4846264074 Add IsNsfw to TextChannelProperties 2017-08-29 17:42:00 -04:00
Christopher F
608bc359ee Removed IChannel#Nsfw, added to ITextChannel 2017-08-29 17:26:36 -04:00
Christopher F
5d7f2fc7ec Add GetReactionUsersAsync(IEmote) overload (#731)
* Add GetReactionUsersAsync(IEmote) overload

Resolves #730

* Remove obsolete GetReactionUsersAsync(string) overload
2017-08-29 17:09:28 -04:00
Hsu Still
0de5d5b02b Added SendFileAsync (#774) 2017-08-29 16:57:47 -04:00
Joe4evr
94f7dd2ab8 Remove EmbedBuilder -> Embed implicit conversion (#801) 2017-08-29 16:51:41 -04:00
Christopher F
e991715bac Added CommandService.CommandExecuted (#747) 2017-08-29 16:50:32 -04:00
Christopher F
0fdb2d2c3b Bump version to 2.0.0-alpha 2017-08-29 16:49:44 -04:00
Izumemori
9c81ab9fe4 changed NameAttribute to work for parameter (#765) 2017-08-29 16:45:30 -04:00
Alex Gravely
cb0ff7817d Add NullableTypeReader (#785)
* 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.
2017-08-29 16:38:11 -04:00
Christopher F
4205d68b5a Don't throw when receiving a presence for a user that doesn't exist (#746) 2017-08-29 16:26:31 -04:00
Christopher F
3c1e76615e Preemptive Ratelimits should be logged under Verbose 2017-08-28 17:21:19 -04:00
Christopher F
1ffcd4bfa7 Changed Guild#DefaultChannel to resolve the first accessible channel (#777)
* 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.
2017-08-28 16:49:16 -04:00
Christopher F
182f00f8ce Reworked IChannel.IsNsfw to support the new API flag (#771)
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)
2017-08-28 16:45:53 -04:00
RogueException
361bfc1a90 Bumped version to 1.1.0-alpha 2017-08-28 16:07:39 -04:00
Alex Gravely
865080add9 Fix CreateGuildAsync not sending icon stream. (#768)
* Fix CreateGuildAsync not doing anything with the input stream for the guild icon.

Also fixes an issue with potential stream types that throw a NotSupportedException when checking its properties. [Apparently, they exist.](https://github.com/dotnet/corefx/blob/master/src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpResponseStream.cs)

* Merged with old method

* Removed duplicate decl
2017-08-17 03:19:16 -03:00
Christopher F
506a6c96c9 Throw when attempting to add or remove a member's EveryoneRole (#781)
* Throw when attempting to add or remove a member's EveryoneRole

This resolves #780

* Removed braces
2017-08-17 02:59:58 -03:00
RogueException
f997089174 Try to pull DM channels from cache on CHANNEL_CREATE 2017-08-17 02:54:19 -03:00
Alex Gravely
6b5a6e7f1f Fix everyone mention. (#755)
* Update RestRole.cs

Fix everyone mention.

* Update SocketRole.cs

Fix everyone mention.

* I'm good at this, I swear.
2017-08-17 02:47:37 -03:00
Jay Malhotra
57a461c9ff NullOrEmpty -> NullOrWhiteSpace (#758)
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?
2017-08-17 02:47:00 -03:00
Christopher F
22b969cbc7 Test the Discord.Color structure (#786)
This provides tests to ensure the following:
- Creating a Color
- Creating a Default Color
- Accessing a Color's Raw Value
- Accessing a Color's translated RGB values
2017-08-17 02:44:37 -03:00
Christopher F
95b78df9f0 URL-Encode reasons on Kick/Ban (#787)
This resolves #784
2017-08-17 02:43:00 -03:00
RogueException
dfcb4b39fb Allow duplicate RequireBotPermissionAttribute 2017-08-17 02:41:42 -03:00
Alex Gravely
c4dcb9dc17 Update client.cs (#752)
* Update client.cs

Let's not have the client be a local variable, hm?

* Update complete.cs

* Update complete.cs

* Update client.cs and complete.cs

Let's not have the client be a local variable, hm?
2017-07-16 11:33:01 -04:00
Hsu Still
b59c48b9ec Added IServiceProvider (#753) 2017-07-16 11:32:49 -04:00
Joe4evr
0bdc2455bc Add line to show subscribing to CommandService#Log (#756) 2017-07-16 11:32:31 -04:00
RogueException
0a41694f01 Update Discord.Net.nuspec 2017-07-14 15:32:24 -03:00
RogueException
710e1824bf Update LICENSE 2017-07-14 15:31:30 -03:00
Christopher F
8068a0ba0e Merge pull request #654 from ObsidianMinor/dev
Fixed RestGuildUser not updating inherited RestUser properties
2017-07-11 12:13:02 -04:00
Christopher F
263864f579 Bumped version to 1.0.2 2017-07-11 12:12:07 -04:00
RogueException
ff10f17cba Proper versioning is hard 2017-07-05 21:35:38 -03:00
RogueException
d27657d193 Removed hardcoded suffix from nuspec 2017-07-05 21:31:59 -03:00
RogueException
b35fbac017 Removed version from README 2017-07-05 21:30:25 -03:00
Pat Murphy
d89804d7c7 Fix potential nullref in embedBuilder value setter (#734)
* 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
2017-07-05 20:56:43 -03:00
Joe4evr
8cd99beb62 Unify ShardedCommandContext with SocketCommandContext (#739)
* Make ShardedCommandContext derive from SocketCommandContext

* Explicitly re-implement ICommandContext.Client
2017-07-05 20:23:46 -03:00
Finite Reality
d2afb06942 Make the "cannot be loaded" warning fire correctly (#729)
Why am I such a bad programmer? Maybe I'm just bad with git. Maybe I'm
just bad in general. Maybe I should resign from programming.
2017-07-05 20:19:09 -03:00
Joe4evr
b6dcc9e8d8 Add back the case for ParameterPreconditions (#735) 2017-07-05 20:13:49 -03:00
Finite Reality
7597cf5baa Fix CalculateScore throwing on missing parameters (#727)
* Fix CalculateScore throwing on missing parameters

* Bump to version 1.0.1
2017-07-05 20:09:38 -03:00
Christopher F
c316b29286 Bump version to 1.0.1 2017-07-02 12:33:03 -04:00
RogueException
26bc0b300d Updated version to 1.0 2017-06-29 20:00:26 -03:00
RogueException
ba18179eb8 Fixed compile error 2017-06-29 19:50:07 -03:00
RogueException
3b78817c54 Added int overload to EmbedBuilderExtensions 2017-06-29 19:45:02 -03:00
RogueException
14dfc48df3 Style cleanup 2017-06-29 19:44:32 -03:00
Finite Reality
fdd38c8d7f Add embed builder extensions (#460)
* 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.
2017-06-29 19:44:08 -03:00
Finite Reality
74f6a4b392 Allow commands to return a Task<RuntimeResult> (#466)
* 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.
2017-06-29 19:21:05 -03:00
Finite Reality
b96748f9c3 Allow arbitrary attributes to be added to commands (#458)
* Allow arbitrary attributes to be added to commands

I still don't approve adding type info back into commands, so
I decided to use this solution for allowing arbitrary attributes to be
added to commands.

Add attributes property to ParameterBuilder

Add Attributes properties to info types

* Why on earth git

* Add using for system so that Attribute can be used
2017-06-29 18:30:26 -03:00
RogueException
394e0aa4d1 Reorganized properties in Emoji.cs 2017-06-29 18:06:12 -03:00