Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dotnet_style_qualification_for_field = true:suggestion
dotnet_style_qualification_for_method = true:suggestion
dotnet_style_qualification_for_property = true:suggestion
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
file_header_template = SPDX-License-Identifier: AGPL-3.0-or-later\nCopyright (C) 2021-2025 N0D4N
file_header_template = SPDX-License-Identifier: AGPL-3.0-or-later\nCopyright (C) 2021-2026 N0D4N


# ReSharper properties
Expand Down
60 changes: 54 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,67 @@ Tantei


[![.NET build](https://github.com/TanteiBot/Tantei/actions/workflows/build.yml/badge.svg)](https://github.com/TanteiBot/Tantei/actions/workflows/build.yml) ![GitHub](https://img.shields.io/github/license/TanteiBot/Tantei?label=License&style=flat-square)
Tantei is Discord bot that tracks user's updates from various anime/manga list websites such as [MyAnimeList](https://myanimelist.net), [Shikimori](https://shikimori.one), [AniList](https://anilist.co) and posts them to Discord server/s.
Tantei is Discord bot that tracks user's updates from various anime/manga list websites such as [MyAnimeList](https://myanimelist.net), [AniList](https://anilist.co), [Shikimori](https://shikimori.one) and posts them to Discord server/s.

Installation
---------------------
Prerequisites: git, [.NET SDK 9.0](https://get.dot.net/9)

#### Running with Docker (recommended)

Prerequisites: [Docker](https://docs.docker.com/get-started/get-docker/) (Podman should work as well, but was not tested)

- `mkdir tantei && cd tantei`
- In the new folder create file `docker-compose.yml` and copy-paste following content there
```yaml
services:
tantei:
image: ghcr.io/tanteibot/tantei:latest
restart: unless-stopped
container_name: tantei
volumes:
- <path-to-config-directory>:/config:ro
- <path-to-data-directory>:/data
```
- Edit the file, replace `<path-to-config-directory>` with the path where the config file for Tantei will be stored.

Replace `<path-to-data-directory>` with the path where the data for Tantei (database file) will be stored.
- In the directory, which you used to replace `<path-to-config-directory>`, create a file `appsettings.Production.json`, copy structure of its contents [from the repo](https://github.com/TanteiBot/Tantei/blob/release/v2/src/PaperMalKing/template.appsettings.Production.json)
- Edit the newly created file, provide your Discord bot's token, ClientId and secret, which can be found on [Discord's website](https://discord.com/developers/applications)
- By default bot tries to check updates from ALL available providers, to disable one, you need to set `DelayBetweenChecksInMilliseconds` in its section to -1. For example, here is how part of config may look like with disabled AniList provider
```json
{
"AniList": {
"DelayBetweenChecksInMilliseconds": -1
}
}
```
- To fetch list updates from MyAnimeList, you need to register your bot on [MAL's website](https://myanimelist.net/apiconfig), and set Client ID and Client Secret in the config.
- To fetch list updates for Shikimori, you need to create application on [Shikimori's website](https://shikimori.io/oauth) adn set its name in config
- Switch back to directory `tantei` directory you created in first step and start the app with `docker compose up`

#### Running on bare metal
Prerequisites: [ASP.NET Core Runtime 10](https://get.dot.net/10), wget, unzip

- Create a directory for the bot, `cd` there and obtain latest release from GitHub `wget https://github.com/TanteiBot/Tantei/releases/latest/download/Tantei.zip`
- `unzip Tantei.zip && cd output`
- `cp template.appsettings.Production.json appsettings.Production.json`
- Fill necessary data in `appsettings.Production.json`, see relevant section in setup guide for docker
- `dotnet PaperMalKing.dll`

In this scenario you will need to worry about setting up the bot to work in background, having it autorestart manually.

#### Building from source and running on bare metal

Prerequisites: git, [.NET SDK 10.0](https://get.dot.net/10)
- `git clone --branch v2 https://github.com/TanteiBot/Tantei.git`
- `cd Tantei/`
- `dotnet publish -c Release -o publish/ PaperMalKing/PaperMalKing.csproj`
- `dotnet publish -c Release -o publish/ src/PaperMalKing/PaperMalKing.csproj`
- `cd publish/`
- `cp template.appsettings.Production.json appsettings.Production.json`
- Fill necessary data in `appsettings.Production.json`
- Fill necessary data in `appsettings.Production.json`, see relevant section in setup guide for docker
- Run with `dotnet PaperMalKing.dll`

Run with `dotnet PaperMalKing.dll`
In this scenario you will need to worry about setting up the bot to work in background, having it autorestart manually.~~~~

Notice
---------------------
Expand All @@ -24,7 +72,7 @@ Project is unofficial and is not affiliated with MyAnimeList.net, Shikimori.one,
License
---------------------

Copyright 2021-2025 N0D4N
Copyright 2021-2026 N0D4N

Licensed under the AGPLv3: https://www.gnu.org/licenses/agpl-3.0.html

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Globalization;
using BenchmarkDotNet.Attributes;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Tantei.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using BenchmarkDotNet.Running;

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Tantei.Benchmarks/UnwantedRolesSearch.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Buffers;
using System.Diagnostics.CodeAnalysis;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Tantei.Benchmarks/Utf8NumberParsing.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Buffers.Text;
using System.Globalization;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Tantei.Benchmarks/Utf8String.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Text;
using System.Text.Unicode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Globalization;
using System.Net;
Expand Down
2 changes: 1 addition & 1 deletion src/PaperMalKing.AniList.UpdateProvider.Installer/Log.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using Microsoft.Extensions.Logging;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Text.Json;
using GraphQL.Client.Http;
using GraphQL.Client.Serializer.SystemTextJson;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using PaperMalKing.AniList.Wrapper;
Expand All @@ -18,8 +19,13 @@ namespace PaperMalKing.AniList.UpdateProvider.Installer;

public static class ServiceCollectionExtensions
{
public static void AddAniList(this IServiceCollection serviceCollection)
public static void AddAniList(this IServiceCollection serviceCollection, IConfiguration configuration)
{
if (configuration.GetSection(AniListOptions.AniList).GetValue<int>(nameof(AniListOptions.DelayBetweenChecksInMilliseconds)) < 0)
{
return;
}

serviceCollection.AddOptions<AniListOptions>().BindConfiguration(AniListOptions.AniList).ValidateDataAnnotations().ValidateOnStart();
const int rpm = 29;

Expand Down
2 changes: 1 addition & 1 deletion src/PaperMalKing.AniList.UpdateProvider/AniListCommands.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using DSharpPlus.Entities;
using DSharpPlus.SlashCommands;
Expand Down
4 changes: 2 additions & 2 deletions src/PaperMalKing.AniList.UpdateProvider/AniListOptions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.ComponentModel.DataAnnotations;
using PaperMalKing.Common.Options;
Expand All @@ -9,7 +9,7 @@ namespace PaperMalKing.AniList.UpdateProvider;
public sealed class AniListOptions : ITimerOptions<AniListUpdateProvider>
{
[Required]
[Range(1, int.MaxValue)]
[Range(-1, int.MaxValue)]
public int DelayBetweenChecksInMilliseconds { get; init; }

public const string AniList = ProviderConstants.Name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Diagnostics.CodeAnalysis;
using System.Globalization;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using PaperMalKing.Common.Attributes;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Diagnostics.CodeAnalysis;
using Microsoft.EntityFrameworkCore;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Diagnostics.CodeAnalysis;
using DSharpPlus.Entities;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using PaperMalKing.AniList.Wrapper.Abstractions.Models;
using PaperMalKing.AniList.Wrapper.Abstractions.Models.Responses;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using PaperMalKing.AniList.Wrapper.Abstractions.Models;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using PaperMalKing.AniList.Wrapper.Abstractions.Models;
using PaperMalKing.AniList.Wrapper.Abstractions.Models.Responses;
Expand Down
2 changes: 1 addition & 1 deletion src/PaperMalKing.AniList.UpdateProvider/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Buffers;
using System.Diagnostics.CodeAnalysis;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Diagnostics;
using DSharpPlus;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using DSharpPlus.Entities;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

namespace PaperMalKing.AniList.Wrapper.Abstractions;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using PaperMalKing.AniList.Wrapper.Abstractions.Models;
using PaperMalKing.AniList.Wrapper.Abstractions.Models.Enums;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Text.Json.Serialization;
using PaperMalKing.AniList.Wrapper.Abstractions.Models.Interfaces;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Text.Json.Serialization;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Text.Json.Serialization;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Text.Json.Serialization;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Text.Json.Serialization;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Text.Json.Serialization;
using Microsoft.Extensions.EnumStrings;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.ComponentModel;
using System.Text.Json.Serialization;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Text.Json.Serialization;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Text.Json.Serialization;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Text.Json.Serialization;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Text.Json.Serialization;

Expand Down Expand Up @@ -27,7 +27,7 @@
EnglishStylised = 6,
}

public static class TitleLanguageExtensions

Check warning on line 30 in src/PaperMalKing.AniList.Wrapper.Abstractions/Models/Enums/TitleLanguage.cs

View workflow job for this annotation

GitHub Actions / Test (Debug)

File name must match type name (class TitleLanguageExtensions) (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0048.md)

Check warning on line 30 in src/PaperMalKing.AniList.Wrapper.Abstractions/Models/Enums/TitleLanguage.cs

View workflow job for this annotation

GitHub Actions / Build

File name must match type name (class TitleLanguageExtensions) (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0048.md)

Check warning on line 30 in src/PaperMalKing.AniList.Wrapper.Abstractions/Models/Enums/TitleLanguage.cs

View workflow job for this annotation

GitHub Actions / Build

File name must match type name (class TitleLanguageExtensions) (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0048.md)

Check warning on line 30 in src/PaperMalKing.AniList.Wrapper.Abstractions/Models/Enums/TitleLanguage.cs

View workflow job for this annotation

GitHub Actions / Run CodeQL analysis

File name must match type name (class TitleLanguageExtensions) (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0048.md)

Check warning on line 30 in src/PaperMalKing.AniList.Wrapper.Abstractions/Models/Enums/TitleLanguage.cs

View workflow job for this annotation

GitHub Actions / Run CodeQL analysis

File name must match type name (class TitleLanguageExtensions) (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0048.md)

Check warning on line 30 in src/PaperMalKing.AniList.Wrapper.Abstractions/Models/Enums/TitleLanguage.cs

View workflow job for this annotation

GitHub Actions / Test (Release)

File name must match type name (class TitleLanguageExtensions) (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0048.md)
{
extension(TitleLanguage)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.ComponentModel;
using System.Text.Json.Serialization;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Text.Json.Serialization;
using PaperMalKing.AniList.Wrapper.Abstractions.Models.Enums;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Text.Json.Serialization;
using PaperMalKing.AniList.Wrapper.Abstractions.Models.Enums;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

using System.Text.Json.Serialization;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

namespace PaperMalKing.AniList.Wrapper.Abstractions.Models.Interfaces;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

namespace PaperMalKing.AniList.Wrapper.Abstractions.Models.Interfaces;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021-2025 N0D4N
// Copyright (C) 2021-2026 N0D4N

namespace PaperMalKing.AniList.Wrapper.Abstractions.Models.Interfaces;

Expand Down
Loading
Loading