More cleanup

- Moved all bot files to src/NadekoBot
- Fixed tests path in ci
- Fixed some warnings in MusicService
- Cleaned up csproj slightly
This commit is contained in:
Kwoth
2021-06-18 04:00:05 +02:00
parent 6b92cb3c89
commit 38c7f32a76
14 changed files with 41 additions and 135 deletions

View File

@@ -6,7 +6,7 @@ stages:
variables: variables:
project: "NadekoBot" project: "NadekoBot"
tests: "Nadeko.Tests" tests: "NadekoBot.Tests"
before_script: before_script:
- "dotnet restore" - "dotnet restore"

View File

@@ -6,12 +6,12 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{04929013-5BAB-42B0-B9B2-8F2BB8F16AF2}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{04929013-5BAB-42B0-B9B2-8F2BB8F16AF2}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0B2F1537-4BF0-422B-A0DD-8F9CCEFB340F}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0B2F1537-4BF0-422B-A0DD-8F9CCEFB340F}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
license.md = license.md CHANGELOG.md = CHANGELOG.md
mkdocs.yml = mkdocs.yml LICENSE.md = LICENSE.md
NadekoBot.iss = NadekoBot.iss README.md = README.md
release.ps1 = release.ps1 .gitlab-ci.yml = .gitlab-ci.yml
EndProjectSection EndProjectSection
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NadekoBot", "src\NadekoBot\NadekoBot.csproj", "{45EC1473-C678-4857-A544-07DFE0D0B478}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NadekoBot", "src\NadekoBot\NadekoBot.csproj", "{45EC1473-C678-4857-A544-07DFE0D0B478}"
EndProject EndProject

View File

@@ -3,63 +3,6 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<LangVersion>9.0</LangVersion> <LangVersion>9.0</LangVersion>
<OutputType>exe</OutputType>
<ApplicationIcon>nadeko_icon.ico</ApplicationIcon>
<RollForward>Major</RollForward> <RollForward>Major</RollForward>
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory> </PropertyGroup>
</PropertyGroup>
<PropertyGroup Condition=" '$(Version)' == '' ">
<VersionPrefix Condition=" '$(VersionPrefix)' == '' ">2.0.0</VersionPrefix>
<Version Condition=" '$(VersionSuffix)' != '' ">$(VersionPrefix).$(VersionSuffix)</Version>
<Version Condition=" '$(Version)' == '' ">$(VersionPrefix)</Version>
</PropertyGroup>
<ItemGroup>
<Compile Remove="credentials.json" />
<None Update="data\**\*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="_strings\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="data\images_backup.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="data\xp_template.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="data\xp_template_backup.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="external\**\*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="nadeko_icon.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="credentials_example.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="libopus.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="libsodium.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="libsodium.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="opus.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'GlobalNadeko' ">
<DefineConstants>$(DefineConstants);GLOBAL_NADEKO</DefineConstants>
<NoWarn>$(NoWarn);CS1573;CS1591;CS8032</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\NadekoBot\NadekoBot.csproj" />
</ItemGroup>
</Project> </Project>

View File

@@ -1,32 +0,0 @@
{
"Token": "MTE5Nzc3MDIxMzE5NTc3NjEw.VlhNCw.xZ3lOoy35iROltPJVOXB2IaEMME",
"OwnerIds": [
105635576866156544
],
"LoLApiKey": "",
"GoogleApiKey": "",
"MashapeKey": "",
"OsuApiKey": "",
"SoundCloudClientId": "",
"CleverbotApiKey": "",
"CarbonKey": "",
"Db": {
"Type": "sqlite",
"ConnectionString": "Data Source=data/NadekoBot.db"
},
"TotalShards": 1,
"PatreonAccessToken": "",
"PatreonCampaignId": "334038",
"RestartCommand": null,
"ShardRunCommand": "",
"ShardRunArguments": "",
"ShardRunPort": null,
"BotListToken": null,
"TwitchClientId": null,
"VotesToken": null,
"VotesUrl": null,
"RedisOptions": null,
"LocationIqApiKey": null,
"TimezoneDbApiKey": null,
"CoinmarketcapApiKey": null
}

View File

@@ -1,31 +0,0 @@
{
"Token": "",
"OwnerIds": [
105635576866156544
],
"GoogleApiKey": "",
"MashapeKey": "",
"OsuApiKey": "",
"SoundCloudClientId": "",
"CleverbotApiKey": "",
"CarbonKey": "",
"Db": {
"Type": "sqlite",
"ConnectionString": "Data Source=data/NadekoBot.db"
},
"TotalShards": 1,
"PatreonAccessToken": "",
"PatreonCampaignId": "334038",
"RestartCommand": null,
"ShardRunCommand": "",
"ShardRunArguments": "",
"ShardRunPort": null,
"BotListToken": null,
"TwitchClientId": null,
"VotesToken": null,
"VotesUrl": null,
"RedisOptions": null,
"LocationIqApiKey": null,
"TimezoneDbApiKey": null,
"CoinmarketcapApiKey": null
}

View File

@@ -1,5 +1,6 @@
#nullable enable #nullable enable
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord; using Discord;
using NadekoBot.Core.Common; using NadekoBot.Core.Common;
@@ -24,7 +25,7 @@ namespace NadekoBot.Modules.Music.Services
public Task JoinVoiceChannelAsync(ulong guildId, ulong voiceChannelId); public Task JoinVoiceChannelAsync(ulong guildId, ulong voiceChannelId);
Task<IMusicPlayer?> GetOrCreateMusicPlayerAsync(ITextChannel contextChannel); Task<IMusicPlayer?> GetOrCreateMusicPlayerAsync(ITextChannel contextChannel);
bool TryGetMusicPlayer(ulong guildId, out IMusicPlayer musicPlayer); bool TryGetMusicPlayer(ulong guildId, [MaybeNullWhen(false)] out IMusicPlayer musicPlayer);
Task<int> EnqueueYoutubePlaylistAsync(IMusicPlayer mp, string playlistId, string queuer); Task<int> EnqueueYoutubePlaylistAsync(IMusicPlayer mp, string playlistId, string queuer);
Task EnqueueDirectoryAsync(IMusicPlayer mp, string dirPath, string queuer); Task EnqueueDirectoryAsync(IMusicPlayer mp, string dirPath, string queuer);
Task<int> EnqueueSoundcloudPlaylistAsync(IMusicPlayer mp, string playlist, string queuer); Task<int> EnqueueSoundcloudPlaylistAsync(IMusicPlayer mp, string playlist, string queuer);

View File

@@ -2,6 +2,7 @@
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord; using Discord;
@@ -93,7 +94,7 @@ namespace NadekoBot.Modules.Music.Services
return _players.GetOrAdd(contextChannel.GuildId, newPLayer); return _players.GetOrAdd(contextChannel.GuildId, newPLayer);
} }
public bool TryGetMusicPlayer(ulong guildId, out IMusicPlayer musicPlayer) public bool TryGetMusicPlayer(ulong guildId, [MaybeNullWhen(false)] out IMusicPlayer musicPlayer)
=> _players.TryGetValue(guildId, out musicPlayer); => _players.TryGetValue(guildId, out musicPlayer);
public async Task<int> EnqueueYoutubePlaylistAsync(IMusicPlayer mp, string query, string queuer) public async Task<int> EnqueueYoutubePlaylistAsync(IMusicPlayer mp, string query, string queuer)

View File

@@ -3,12 +3,11 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<LangVersion>9.0</LangVersion> <LangVersion>9.0</LangVersion>
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
<OutputType>exe</OutputType>
<ApplicationIcon>nadeko_icon.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Compile Remove="Modules\Administration\ModuleCommands.cs" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AngleSharp" Version="0.14.0" /> <PackageReference Include="AngleSharp" Version="0.14.0" />
<PackageReference Include="AWSSDK.S3" Version="3.7.0.14" /> <PackageReference Include="AWSSDK.S3" Version="3.7.0.14" />
@@ -50,6 +49,31 @@
<ProjectReference Include="..\ayu\Ayu.Discord.Voice\Ayu.Discord.Voice.csproj" /> <ProjectReference Include="..\ayu\Ayu.Discord.Voice\Ayu.Discord.Voice.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Compile Remove="credentials.json" />
<None Update="data\**\*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="nadeko_icon.ico;libopus.so;libsodium.so;libsodium.dll;opus.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="data\images_backup.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="data\xp_template_backup.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="credentials_example.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<PropertyGroup Condition=" '$(Version)' == '' ">
<VersionPrefix Condition=" '$(VersionPrefix)' == '' ">2.0.0</VersionPrefix>
<Version Condition=" '$(VersionSuffix)' != '' ">$(VersionPrefix).$(VersionSuffix)</Version>
<Version Condition=" '$(Version)' == '' ">$(VersionPrefix)</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'GlobalNadeko' "> <PropertyGroup Condition=" '$(Configuration)' == 'GlobalNadeko' ">
<DefineConstants>$(DefineConstants);GLOBAL_NADEKO</DefineConstants> <DefineConstants>$(DefineConstants);GLOBAL_NADEKO</DefineConstants>
<NoWarn>$(NoWarn);CS1573;CS1591</NoWarn> <NoWarn>$(NoWarn);CS1573;CS1591</NoWarn>

View File

Before

Width:  |  Height:  |  Size: 381 KiB

After

Width:  |  Height:  |  Size: 381 KiB