mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 09:18:27 -04:00
- Initial work on Dockerfile
- Updated README.md with more information - Added some todos
This commit is contained in:
13
.dockerignore
Normal file
13
.dockerignore
Normal file
@@ -0,0 +1,13 @@
|
||||
# Ignore all files
|
||||
*
|
||||
|
||||
# Use NadekoBot project
|
||||
!src/NadekoBot/**
|
||||
# Use NadekoBot.Coordinator project
|
||||
!src/NadekoBot.Coordinator/**
|
||||
# Use Ayu stuff
|
||||
!src/ayu/**
|
||||
|
||||
# ignore bin and obj folders in projects
|
||||
src/**/bin/*
|
||||
src/**/obj/*
|
20
Dockerfile
Normal file
20
Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
COPY src/NadekoBot/*.csproj src/NadekoBot/
|
||||
COPY src/NadekoBot.Coordinator/*.csproj src/NadekoBot.Coordinator/
|
||||
COPY src/ayu/Ayu.Discord.Voice/*.csproj src/ayu/Ayu.Discord.Voice/
|
||||
RUN dotnet restore src/NadekoBot/
|
||||
|
||||
COPY . .
|
||||
WORKDIR /source/src/NadekoBot
|
||||
RUN dotnet publish -c Release -o /app --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0
|
||||
ENV shard_id=0
|
||||
ENV total_shards=1
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
VOLUME [ "/data" ]
|
||||
ENTRYPOINT dotnet NadekoBot.dll "$shard_id" "$total_shards"
|
20
README.md
20
README.md
@@ -2,7 +2,7 @@
|
||||
|
||||
## Migration from 2.x
|
||||
|
||||
:warning: You **MUST** update to latest version of 2.x and **run yourbot at least once** before switching over to v3
|
||||
:warning: You **MUST** update to latest version of 2.x and **run your bot at least once** before switching over to v3
|
||||
|
||||
## Changes
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
- All database migrations and data (json file) migrations have been removed
|
||||
- As updating to the latest 2.x version before switching over to v3 is mandated (or fresh v3install), that means all migration code has ran and it can be safely removed
|
||||
- There are 2 projects: NadekoBot and NadekoBot.Coordinator
|
||||
- NadekoBot is the regular bot with one shard, or if you can run it if you want to run your shards
|
||||
- credentials.json moved to `creds.yml`, example is in `creds_example.yml`, most of the credentials from 2.x will be automatically migrated
|
||||
- Guide will now instruct users to set build output to nadekobot/output instead of running from nadekobot/src/NadekoBot/bin/release/net5
|
||||
- todo: Reworked from source installation (linux/windows) guide <todo link>
|
||||
- todo: Added docker installation guide at <todo link>
|
||||
- todo?: votes functionality changed
|
||||
- todo?: maybe use https://github.com/Humanizr/Humanizer for trimto, time printing, date printing, etc
|
||||
- todo?: use guild locale more in the code (from guild settings) (for dates, currency, etc?)
|
||||
- todo?: Write a sourcegen for response strings and use const/static fields (maybe even typed to enforce correct number of arguments)
|
||||
- You can directly run NadekoBot as the regular bot with one shard
|
||||
- Run NadekoBot.Coordinator if you want more control over your shards and a grpc api for coordinator with which you can start, restart, kill and see status of shards
|
||||
- credentials.json moved to `creds.yml`
|
||||
- example is in `creds_example.yml`
|
||||
- most of the credentials from 2.x will be automatically migrated
|
||||
- Guides
|
||||
- Now instruct users to set build output to nadekobot/output instead of running from nadekobot/src/NadekoBot/bin/release/net5
|
||||
- todo: Reworked from source installation (linux/windows) guide <todo link>
|
||||
- todo: Added docker support, installation guide at <todo link>
|
@@ -46,10 +46,12 @@ namespace NadekoBot.Modules.Gambling.Services
|
||||
}
|
||||
}
|
||||
|
||||
// todo future use votes api directly?
|
||||
private async Task BotlistUpvoteLoop()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(_creds.VotesUrl))
|
||||
return;
|
||||
|
||||
while (true)
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromHours(1)).ConfigureAwait(false);
|
||||
|
@@ -11,7 +11,7 @@ if (args.Length > 0)
|
||||
{
|
||||
if (!int.TryParse(args[0], out shardId))
|
||||
{
|
||||
Console.Error.WriteLine("Invalid first argument (shard id)");
|
||||
Console.Error.WriteLine("Invalid first argument (shard id): {0}", args[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ if (args.Length > 0)
|
||||
{
|
||||
if (!int.TryParse(args[1], out var shardCount))
|
||||
{
|
||||
Console.Error.WriteLine("Invalid second argument (total shards)");
|
||||
Console.Error.WriteLine("Invalid second argument (total shards): {0}", args[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -11,6 +11,9 @@ using NadekoBot.Modules.Administration;
|
||||
|
||||
namespace NadekoBot.Services
|
||||
{
|
||||
// todo future use guild locale more in the code (from guild settings) (for dates, currency, etc?)
|
||||
// todo future maybe Write a sourcegen for response strings
|
||||
// and use const/static fields (maybe even typed to enforce correct number of arguments)
|
||||
public class Localization : ILocalization, INService
|
||||
{
|
||||
private readonly BotConfigService _bss;
|
||||
|
@@ -32,6 +32,7 @@ namespace NadekoBot.Extensions
|
||||
return Regex.Replace(input, "<.*?>", String.Empty);
|
||||
}
|
||||
|
||||
// todo future maybe use humanizer lib for this kind of work
|
||||
public static string TrimTo(this string str, int maxLength, bool hideDots = false)
|
||||
{
|
||||
if (maxLength < 0)
|
||||
|
Reference in New Issue
Block a user