Skip to content

Commit

Permalink
v5.1.0 (#24)
Browse files Browse the repository at this point in the history
* v5.1.0

* Update README.md

* Add README to nuget
  • Loading branch information
Hawxy authored Jan 30, 2022
1 parent 249493c commit f4e0c71
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 36 deletions.
10 changes: 6 additions & 4 deletions Discord.Addons.Hosting/Discord.Addons.Hosting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<PackageId>Discord.Addons.Hosting</PackageId>
<Version>5.0.0</Version>
<Version>5.1.0</Version>
<Authors>Hawxy</Authors>
<Description>Simplifying Discord.Net hosting with .NET Generic Host (Microsoft.Extensions.Hosting)</Description>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
Expand All @@ -17,17 +17,19 @@
<PackageTags>discord,discord.net,addon,hosting,microsoft.extensions.hosting</PackageTags>
<Nullable>Enable</Nullable>
<ImplicitUsings>Enable</ImplicitUsings>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Discord.Net.Commands" Version="3.0.0" />
<PackageReference Include="Discord.Net.Interactions" Version="3.0.0" />
<PackageReference Include="Discord.Net.WebSocket" Version="3.0.0" />
<PackageReference Include="Discord.Net.Commands" Version="3.2.0" />
<PackageReference Include="Discord.Net.Interactions" Version="3.2.0" />
<PackageReference Include="Discord.Net.WebSocket" Version="3.2.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<None Include="Images\icon.png" Pack="true" PackagePath="\" />
<None Include="..\README.md" Pack="true" PackagePath="\"/>
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
![.NET Core Build](https://github.com/Hawxy/Discord.Addons.Hosting/workflows/.NET%20Core%20Build/badge.svg)
[![NuGet](https://img.shields.io/nuget/v/Discord.Addons.Hosting.svg?style=flat-square)](https://www.nuget.org/packages/Discord.Addons.Hosting)
![Nuget](https://img.shields.io/nuget/dt/Discord.Addons.Hosting?style=flat-square)

| Discord.NET Fork | [Original](https://github.com/discord-net/Discord.Net) | [Labs](https://github.com/Discord-Net-Labs/Discord.Net-Labs)
|---------------------|----------|-------------|
| Nuget Version | `5.0.0` | `5.0.0-labs` |
| Nuget Version | `5.1.0` | `5.1.0-labs` |

[Discord.NET](https://github.com/RogueException/Discord.Net) hosting with [Microsoft.Extensions.Hosting](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/generic-host).
This package provides extensions to a .NET Generic Host (`IHostBuilder`) that will run a Discord.NET socket/sharded client as a controllable `IHostedService`. This simplifies initial bot creation and moves the usual boilerplate to a convenient builder pattern.
Expand Down
21 changes: 10 additions & 11 deletions Samples/Sample.ShardedClient/InteractionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
await _interactionService.RegisterCommandsGloballyAsync();
}

private Task ComponentCommandExecuted(ComponentCommandInfo arg1, Discord.IInteractionContext arg2, IResult arg3)
private Task ComponentCommandExecuted(ComponentCommandInfo commandInfo, IInteractionContext context, IResult result)
{
if (!arg3.IsSuccess)
if (!result.IsSuccess)
{
switch (arg3.Error)
switch (result.Error)
{
case InteractionCommandError.UnmetPrecondition:
// implement
Expand All @@ -72,11 +72,11 @@ private Task ComponentCommandExecuted(ComponentCommandInfo arg1, Discord.IIntera
return Task.CompletedTask;
}

private Task ContextCommandExecuted(ContextCommandInfo arg1, Discord.IInteractionContext arg2, IResult arg3)
private Task ContextCommandExecuted(ContextCommandInfo context, IInteractionContext arg2, IResult result)
{
if (!arg3.IsSuccess)
if (!result.IsSuccess)
{
switch (arg3.Error)
switch (result.Error)
{
case InteractionCommandError.UnmetPrecondition:
// implement
Expand All @@ -101,11 +101,11 @@ private Task ContextCommandExecuted(ContextCommandInfo arg1, Discord.IInteractio
return Task.CompletedTask;
}

private Task SlashCommandExecuted(SlashCommandInfo arg1, Discord.IInteractionContext arg2, IResult arg3)
private Task SlashCommandExecuted(SlashCommandInfo commandInfo, IInteractionContext context, IResult result)
{
if (!arg3.IsSuccess)
if (!result.IsSuccess)
{
switch (arg3.Error)
switch (result.Error)
{
case InteractionCommandError.UnmetPrecondition:
// implement
Expand All @@ -129,8 +129,7 @@ private Task SlashCommandExecuted(SlashCommandInfo arg1, Discord.IInteractionCon

return Task.CompletedTask;
}



private async Task HandleInteraction(SocketInteraction arg)
{
try
Expand Down
18 changes: 9 additions & 9 deletions Samples/SampleBotSerilog/InteractionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
await _interactionService.RegisterCommandsGloballyAsync();
}

private Task ComponentCommandExecuted(ComponentCommandInfo arg1, Discord.IInteractionContext arg2, IResult arg3)
private Task ComponentCommandExecuted(ComponentCommandInfo commandInfo, IInteractionContext context, IResult result)
{
if (!arg3.IsSuccess)
if (!result.IsSuccess)
{
switch (arg3.Error)
switch (result.Error)
{
case InteractionCommandError.UnmetPrecondition:
// implement
Expand All @@ -72,11 +72,11 @@ private Task ComponentCommandExecuted(ComponentCommandInfo arg1, Discord.IIntera
return Task.CompletedTask;
}

private Task ContextCommandExecuted(ContextCommandInfo arg1, Discord.IInteractionContext arg2, IResult arg3)
private Task ContextCommandExecuted(ContextCommandInfo context, IInteractionContext arg2, IResult result)
{
if (!arg3.IsSuccess)
if (!result.IsSuccess)
{
switch (arg3.Error)
switch (result.Error)
{
case InteractionCommandError.UnmetPrecondition:
// implement
Expand All @@ -101,11 +101,11 @@ private Task ContextCommandExecuted(ContextCommandInfo arg1, Discord.IInteractio
return Task.CompletedTask;
}

private Task SlashCommandExecuted(SlashCommandInfo arg1, Discord.IInteractionContext arg2, IResult arg3)
private Task SlashCommandExecuted(SlashCommandInfo commandInfo, IInteractionContext context, IResult result)
{
if (!arg3.IsSuccess)
if (!result.IsSuccess)
{
switch (arg3.Error)
switch (result.Error)
{
case InteractionCommandError.UnmetPrecondition:
// implement
Expand Down
20 changes: 9 additions & 11 deletions Samples/SampleBotSimple/InteractionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)

}

private Task ComponentCommandExecuted(ComponentCommandInfo arg1, Discord.IInteractionContext arg2, IResult arg3)
private Task ComponentCommandExecuted(ComponentCommandInfo commandInfo, IInteractionContext context, IResult result)
{
if (!arg3.IsSuccess)
if (!result.IsSuccess)
{
switch (arg3.Error)
switch (result.Error)
{
case InteractionCommandError.UnmetPrecondition:
// implement
Expand All @@ -73,11 +73,11 @@ private Task ComponentCommandExecuted(ComponentCommandInfo arg1, Discord.IIntera
return Task.CompletedTask;
}

private Task ContextCommandExecuted(ContextCommandInfo arg1, Discord.IInteractionContext arg2, IResult arg3)
private Task ContextCommandExecuted(ContextCommandInfo context, IInteractionContext arg2, IResult result)
{
if (!arg3.IsSuccess)
if (!result.IsSuccess)
{
switch (arg3.Error)
switch (result.Error)
{
case InteractionCommandError.UnmetPrecondition:
// implement
Expand All @@ -102,11 +102,11 @@ private Task ContextCommandExecuted(ContextCommandInfo arg1, Discord.IInteractio
return Task.CompletedTask;
}

private Task SlashCommandExecuted(SlashCommandInfo arg1, Discord.IInteractionContext arg2, IResult arg3)
private Task SlashCommandExecuted(SlashCommandInfo commandInfo, IInteractionContext context, IResult result)
{
if (!arg3.IsSuccess)
if (!result.IsSuccess)
{
switch (arg3.Error)
switch (result.Error)
{
case InteractionCommandError.UnmetPrecondition:
// implement
Expand All @@ -130,8 +130,6 @@ private Task SlashCommandExecuted(SlashCommandInfo arg1, Discord.IInteractionCon

return Task.CompletedTask;
}


private async Task HandleInteraction(SocketInteraction arg)
{
try
Expand Down

0 comments on commit f4e0c71

Please sign in to comment.