Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Hawxy/Discord.Addons.Hosting
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.0.0
Choose a base ref
...
head repository: Hawxy/Discord.Addons.Hosting
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 9 commits
  • 41 files changed
  • 3 contributors

Commits on Jan 30, 2022

  1. v5.1.0 (#24)

    * v5.1.0
    
    * Update README.md
    
    * Add README to nuget
    Hawxy authored Jan 30, 2022
    Copy the full SHA
    f4e0c71 View commit details

Commits on Feb 27, 2022

  1. Update README.md

    Hawxy authored Feb 27, 2022
    Copy the full SHA
    a275544 View commit details

Commits on Nov 6, 2022

  1. v5.2.0 (#26)

    * Dependency Updates
    
    * Update README.md
    Hawxy authored Nov 6, 2022
    Copy the full SHA
    9d0367b View commit details

Commits on Jan 14, 2024

  1. v6.0.0 (#31)

    * Functional changes
    
    * Add build infrastructure
    
    * Build patch
    Hawxy authored Jan 14, 2024
    Copy the full SHA
    a8fe62d View commit details
  2. Delete duplicate module

    Hawxy authored Jan 14, 2024
    Copy the full SHA
    add1a13 View commit details
  3. Update README.md

    Hawxy authored Jan 14, 2024
    Copy the full SHA
    0ea4b3d View commit details

Commits on Jun 10, 2024

  1. v6.1.0 (#33)

    Hawxy authored Jun 10, 2024
    Copy the full SHA
    42607f1 View commit details

Commits on Jul 5, 2024

  1. Copy the full SHA
    23acffb View commit details

Commits on Sep 28, 2024

  1. Create FUNDING.yml

    Hawxy authored Sep 28, 2024
    Copy the full SHA
    c96009c View commit details
Showing with 1,009 additions and 665 deletions.
  1. +1 −0 .github/FUNDING.yml
  2. +37 −0 .github/workflows/Manual_Nuget_Push.yml
  3. +33 −15 .github/workflows/build.yml
  4. +111 −0 .nuke/build.schema.json
  5. +4 −0 .nuke/parameters.json
  6. +4 −0 Discord.Addons.Hosting.sln
  7. +17 −7 Discord.Addons.Hosting/Discord.Addons.Hosting.csproj
  8. +1 −1 Discord.Addons.Hosting/DiscordClientService.cs
  9. +25 −66 Discord.Addons.Hosting/DiscordHostBuilderExtensions.cs
  10. +1 −1 Discord.Addons.Hosting/DiscordHostConfiguration.cs
  11. +1 −1 Discord.Addons.Hosting/Injectables/InjectableCommandService.cs
  12. +1 −1 Discord.Addons.Hosting/Injectables/InjectableDiscordClient.cs
  13. +1 −1 Discord.Addons.Hosting/Injectables/InjectableInteractionService.cs
  14. +162 −0 Discord.Addons.Hosting/ServiceCollectionExtensions.cs
  15. +1 −1 Discord.Addons.Hosting/Services/CommandServiceRegistrationHost.cs
  16. +1 −1 Discord.Addons.Hosting/Services/DiscordHostedService.cs
  17. +1 −1 Discord.Addons.Hosting/Services/InteractionServiceRegistrationHost.cs
  18. +1 −1 Discord.Addons.Hosting/Util/LogAdapter.cs
  19. +1 −1 Discord.Addons.Hosting/Util/ShardedClientExtensions.cs
  20. +2 −2 Discord.Addons.Hosting/Util/SocketClientExtensions.cs
  21. +56 −52 README.md
  22. +43 −114 Samples/Sample.ShardedClient/InteractionHandler.cs
  23. +33 −31 Samples/Sample.ShardedClient/Program.cs
  24. +3 −7 Samples/Sample.ShardedClient/Sample.ShardedClient.csproj
  25. +43 −114 Samples/SampleBotSerilog/InteractionHandler.cs
  26. +30 −35 Samples/SampleBotSerilog/Program.cs
  27. +4 −5 Samples/SampleBotSerilog/Sample.Serilog.csproj
  28. +1 −1 Samples/SampleBotSimple/BotStatusService.cs
  29. +47 −119 Samples/SampleBotSimple/InteractionHandler.cs
  30. +34 −30 Samples/SampleBotSimple/Program.cs
  31. +0 −51 Samples/SampleBotSimple/PublicModule.cs
  32. +1 −6 Samples/SampleBotSimple/Sample.Simple.csproj
  33. +7 −0 build.cmd
  34. +74 −0 build.ps1
  35. +67 −0 build.sh
  36. +11 −0 build/.editorconfig
  37. +84 −0 build/Build.cs
  38. +8 −0 build/Directory.Build.props
  39. +8 −0 build/Directory.Build.targets
  40. +18 −0 build/_build.csproj
  41. +31 −0 build/_build.csproj.DotSettings
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: Hawxy
37 changes: 37 additions & 0 deletions .github/workflows/Manual_Nuget_Push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ------------------------------------------------------------------------------
# <auto-generated>
#
# This code was generated.
#
# - To turn off auto-generation set:
#
# [GitHubActions (AutoGenerate = false)]
#
# - To trigger manual generation invoke:
#
# nuke --generate-configuration GitHubActions_Manual_Nuget_Push --host GitHubActions
#
# </auto-generated>
# ------------------------------------------------------------------------------

name: Manual_Nuget_Push

on: [workflow_dispatch]

jobs:
ubuntu-latest:
name: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
uses: actions/cache@v3
with:
path: |
.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
- name: 'Run: NugetPush'
run: ./build.cmd NugetPush
env:
NugetApiKey: ${{ secrets.NUGET_API_KEY }}
48 changes: 33 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,41 @@
name: .NET Core Build
# ------------------------------------------------------------------------------
# <auto-generated>
#
# This code was generated.
#
# - To turn off auto-generation set:
#
# [GitHubActions (AutoGenerate = false)]
#
# - To trigger manual generation invoke:
#
# nuke --generate-configuration GitHubActions_Build --host GitHubActions
#
# </auto-generated>
# ------------------------------------------------------------------------------

name: Build

on:
push:
branches: [ master ]
branches:
- master
pull_request:
branches: [ master ]
branches:
- master

jobs:
build:

ubuntu-latest:
name: ubuntu-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- uses: actions/checkout@v3
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
uses: actions/cache@v3
with:
path: |
.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
- name: 'Run: Compile'
run: ./build.cmd Compile
111 changes: 111 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/build",
"title": "Build Schema",
"definitions": {
"build": {
"type": "object",
"properties": {
"Continue": {
"type": "boolean",
"description": "Indicates to continue a previously failed build attempt"
},
"Help": {
"type": "boolean",
"description": "Shows the help text for this build assembly"
},
"Host": {
"type": "string",
"description": "Host for execution. Default is 'automatic'",
"enum": [
"AppVeyor",
"AzurePipelines",
"Bamboo",
"Bitbucket",
"Bitrise",
"GitHubActions",
"GitLab",
"Jenkins",
"Rider",
"SpaceAutomation",
"TeamCity",
"Terminal",
"TravisCI",
"VisualStudio",
"VSCode"
]
},
"NoLogo": {
"type": "boolean",
"description": "Disables displaying the NUKE logo"
},
"NugetApiKey": {
"type": "string",
"description": "Nuget Api Key",
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
},
"Partition": {
"type": "string",
"description": "Partition to use on CI"
},
"Plan": {
"type": "boolean",
"description": "Shows the execution plan (HTML)"
},
"Profile": {
"type": "array",
"description": "Defines the profiles to load",
"items": {
"type": "string"
}
},
"Root": {
"type": "string",
"description": "Root directory during build execution"
},
"Skip": {
"type": "array",
"description": "List of targets to be skipped. Empty list skips all dependencies",
"items": {
"type": "string",
"enum": [
"Clean",
"Compile",
"NugetPack",
"NugetPush",
"Restore"
]
}
},
"Solution": {
"type": "string",
"description": "Path to a solution file that is automatically loaded"
},
"Target": {
"type": "array",
"description": "List of targets to be invoked. Default is '{default_target}'",
"items": {
"type": "string",
"enum": [
"Clean",
"Compile",
"NugetPack",
"NugetPush",
"Restore"
]
}
},
"Verbosity": {
"type": "string",
"description": "Logging verbosity during build execution. Default is 'Normal'",
"enum": [
"Minimal",
"Normal",
"Quiet",
"Verbose"
]
}
}
}
}
}
4 changes: 4 additions & 0 deletions .nuke/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "./build.schema.json",
"Solution": "Discord.Addons.Hosting.sln"
}
4 changes: 4 additions & 0 deletions Discord.Addons.Hosting.sln
Original file line number Diff line number Diff line change
@@ -11,12 +11,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Simple", "Samples\Sa
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.ShardedClient", "Samples\Sample.ShardedClient\Sample.ShardedClient.csproj", "{540A37B5-E304-49A4-B68E-08941C0D33F1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{5F0002A4-BACE-4097-A1B6-4350CEB9283F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5F0002A4-BACE-4097-A1B6-4350CEB9283F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5F0002A4-BACE-4097-A1B6-4350CEB9283F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03ED5619-5F9E-4CC6-8B8F-7D610C3169EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03ED5619-5F9E-4CC6-8B8F-7D610C3169EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03ED5619-5F9E-4CC6-8B8F-7D610C3169EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
24 changes: 17 additions & 7 deletions Discord.Addons.Hosting/Discord.Addons.Hosting.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<PackageId>Discord.Addons.Hosting</PackageId>
<Version>5.0.0</Version>
<Version>6.1.0</Version>
<Authors>Hawxy</Authors>
<Description>Simplifying Discord.Net hosting with .NET Generic Host (Microsoft.Extensions.Hosting)</Description>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
@@ -12,22 +12,32 @@
<RepositoryUrl>https://github.com/Hawxy/Discord.Addons.Hosting</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageIcon>icon.png</PackageIcon>
<Copyright>Hawxy 2018-2022</Copyright>
<Copyright>Hawxy 2018-2024</Copyright>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<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="Microsoft.Extensions.Hosting" Version="6.0.0" />
<PackageReference Include="Discord.Net.Commands" Version="3.15.0" />
<PackageReference Include="Discord.Net.Interactions" Version="3.15.0" />
<PackageReference Include="Discord.Net.WebSocket" Version="3.15.0" />
</ItemGroup>


<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
</ItemGroup>

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

</Project>
2 changes: 1 addition & 1 deletion Discord.Addons.Hosting/DiscordClientService.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region License

/*
Copyright 2019-2022 Hawxy
Copyright 2019-2024 Hawxy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Loading