mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
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:
@@ -1,5 +1,6 @@
|
||||
#nullable enable
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Threading.Tasks;
|
||||
using Discord;
|
||||
using NadekoBot.Core.Common;
|
||||
@@ -24,7 +25,7 @@ namespace NadekoBot.Modules.Music.Services
|
||||
public Task JoinVoiceChannelAsync(ulong guildId, ulong voiceChannelId);
|
||||
|
||||
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 EnqueueDirectoryAsync(IMusicPlayer mp, string dirPath, string queuer);
|
||||
Task<int> EnqueueSoundcloudPlaylistAsync(IMusicPlayer mp, string playlist, string queuer);
|
||||
|
@@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Discord;
|
||||
@@ -93,7 +94,7 @@ namespace NadekoBot.Modules.Music.Services
|
||||
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);
|
||||
|
||||
public async Task<int> EnqueueYoutubePlaylistAsync(IMusicPlayer mp, string query, string queuer)
|
||||
|
@@ -3,12 +3,11 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<LangVersion>9.0</LangVersion>
|
||||
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
|
||||
<OutputType>exe</OutputType>
|
||||
<ApplicationIcon>nadeko_icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Modules\Administration\ModuleCommands.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AngleSharp" Version="0.14.0" />
|
||||
<PackageReference Include="AWSSDK.S3" Version="3.7.0.14" />
|
||||
@@ -50,6 +49,31 @@
|
||||
<ProjectReference Include="..\ayu\Ayu.Discord.Voice\Ayu.Discord.Voice.csproj" />
|
||||
</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' ">
|
||||
<DefineConstants>$(DefineConstants);GLOBAL_NADEKO</DefineConstants>
|
||||
<NoWarn>$(NoWarn);CS1573;CS1591</NoWarn>
|
||||
|
34
src/NadekoBot/Program.cs
Normal file
34
src/NadekoBot/Program.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using NadekoBot.Core.Services;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NadekoBot
|
||||
{
|
||||
public sealed class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
var pid = Process.GetCurrentProcess().Id;
|
||||
System.Console.WriteLine($"Pid: {pid}");
|
||||
if (args.Length == 2
|
||||
&& int.TryParse(args[0], out int shardId)
|
||||
&& int.TryParse(args[1], out int parentProcessId))
|
||||
{
|
||||
await new NadekoBot(shardId, parentProcessId == 0 ? pid : parentProcessId)
|
||||
.RunAndBlockAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
await new ShardsCoordinator()
|
||||
.RunAsync()
|
||||
.ConfigureAwait(false);
|
||||
#if DEBUG
|
||||
await new NadekoBot(0, pid)
|
||||
.RunAndBlockAsync();
|
||||
#else
|
||||
await Task.Delay(-1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
BIN
src/NadekoBot/libopus.so
Normal file
BIN
src/NadekoBot/libopus.so
Normal file
Binary file not shown.
BIN
src/NadekoBot/libsodium.dll
Normal file
BIN
src/NadekoBot/libsodium.dll
Normal file
Binary file not shown.
BIN
src/NadekoBot/libsodium.so
Normal file
BIN
src/NadekoBot/libsodium.so
Normal file
Binary file not shown.
BIN
src/NadekoBot/nadeko_icon.ico
Normal file
BIN
src/NadekoBot/nadeko_icon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 381 KiB |
BIN
src/NadekoBot/opus.dll
Normal file
BIN
src/NadekoBot/opus.dll
Normal file
Binary file not shown.
Reference in New Issue
Block a user