mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2024-10-02 12:09:07 +00:00
docs: Updated more links to point to new repo url
dev: Fixed project id as nadeko is moved to nadeko/nadekobot
This commit is contained in:
parent
d30fa44f3c
commit
6caea8e9e7
6 changed files with 68 additions and 53 deletions
|
@ -78,7 +78,7 @@ build:
|
||||||
# - if: $CI_COMMIT_TAG
|
# - if: $CI_COMMIT_TAG
|
||||||
# script:
|
# script:
|
||||||
# - |
|
# - |
|
||||||
# release-cli create --name "NadekoBot v$CI_COMMIT_TAG" --description "## [Changelog](https://gitlab.com/Kwoth/nadekobot/-/blob/v4/CHANGELOG.md#$(echo "$CI_COMMIT_TAG" | sed "s/\.//g")-$(date +%d%m%Y))" --tag-name $CI_COMMIT_TAG \
|
# release-cli create --name "NadekoBot v$CI_COMMIT_TAG" --description "## [Changelog](https://gitlab.com/nadeko/nadekobot/-/blob/v5/CHANGELOG.md#$(echo "$CI_COMMIT_TAG" | sed "s/\.//g")-$(date +%d%m%Y))" --tag-name $CI_COMMIT_TAG \
|
||||||
# --assets-link "{\"name\":\"${LINUX_X64_RELEASE}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${LINUX_X64_RELEASE}\"}" \
|
# --assets-link "{\"name\":\"${LINUX_X64_RELEASE}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${LINUX_X64_RELEASE}\"}" \
|
||||||
# --assets-link "{\"name\":\"${LINUX_ARM64_RELEASE}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${LINUX_ARM64_RELEASE}\"}" \
|
# --assets-link "{\"name\":\"${LINUX_ARM64_RELEASE}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${LINUX_ARM64_RELEASE}\"}" \
|
||||||
# --assets-link "{\"name\":\"${WIN_X64_RELEASE}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${WIN_X64_RELEASE}\"}" \
|
# --assets-link "{\"name\":\"${WIN_X64_RELEASE}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${WIN_X64_RELEASE}\"}" \
|
||||||
|
|
|
@ -5,5 +5,5 @@
|
||||||
[![nadeko2](https://cdn.nadeko.bot/tutorial/docs-bot.png)](https://nadeko.bot/commands)
|
[![nadeko2](https://cdn.nadeko.bot/tutorial/docs-bot.png)](https://nadeko.bot/commands)
|
||||||
|
|
||||||
### Useful links
|
### Useful links
|
||||||
- [Self hosting Guides and Docs](https://nadekobot.readthedocs.io/en/v4)
|
- [Self hosting Guides and Docs](https://nadekobot.readthedocs.io/en/latest)
|
||||||
- [Discord support server](https://discord.nadeko.bot)
|
- [Discord support server](https://discord.nadeko.bot)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# How to contribute
|
# How to contribute
|
||||||
|
|
||||||
1. Make Merge Requests to the [**v4 branch**](https://gitlab.com/nadeko/nadekobot/tree/v5)
|
1. Make Merge Requests to the [**v5 branch**](https://gitlab.com/nadeko/nadekobot/tree/v5)
|
||||||
2. Keep a single Merge Request to a single feature
|
2. Keep a single Merge Request to a single feature
|
||||||
3. Fill out the MR template
|
3. Fill out the MR template
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
site_name: 'NadekoBot'
|
site_name: 'NadekoBot'
|
||||||
site_url: 'https://nadeko.bot'
|
site_url: 'https://nadeko.bot'
|
||||||
repo_url: 'https://gitlab.com/kwoth/nadekobot'
|
repo_url: 'https://gitlab.com/nadeko/nadekobot'
|
||||||
site_author: 'Kwoth'
|
site_author: 'Kwoth'
|
||||||
|
|
||||||
theme:
|
theme:
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
using System.Net.Http.Json;
|
using System.Net.Http.Json;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using NadekoBot.Common.ModuleBehaviors;
|
using NadekoBot.Common.ModuleBehaviors;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace NadekoBot.Modules.Administration.Self;
|
namespace NadekoBot.Modules.Administration.Self;
|
||||||
|
|
||||||
|
public sealed class GitlabReleaseModel
|
||||||
|
{
|
||||||
|
[JsonPropertyName("tag_name")]
|
||||||
|
public required string TagName { get; init; }
|
||||||
|
}
|
||||||
public sealed class CheckForUpdatesService : INService, IReadyExecutor
|
public sealed class CheckForUpdatesService : INService, IReadyExecutor
|
||||||
{
|
{
|
||||||
private readonly BotConfigService _bcs;
|
private readonly BotConfigService _bcs;
|
||||||
|
@ -12,8 +18,15 @@ public sealed class CheckForUpdatesService : INService, IReadyExecutor
|
||||||
private readonly DiscordSocketClient _client;
|
private readonly DiscordSocketClient _client;
|
||||||
private readonly IMessageSenderService _sender;
|
private readonly IMessageSenderService _sender;
|
||||||
|
|
||||||
public CheckForUpdatesService(BotConfigService bcs, IBotCredsProvider bcp, IHttpClientFactory httpFactory,
|
|
||||||
DiscordSocketClient client, IMessageSenderService sender)
|
private const string RELEASES_URL = "https://gitlab.com/api/v4/projects/57687445/releases";
|
||||||
|
|
||||||
|
public CheckForUpdatesService(
|
||||||
|
BotConfigService bcs,
|
||||||
|
IBotCredsProvider bcp,
|
||||||
|
IHttpClientFactory httpFactory,
|
||||||
|
DiscordSocketClient client,
|
||||||
|
IMessageSenderService sender)
|
||||||
{
|
{
|
||||||
_bcs = bcs;
|
_bcs = bcs;
|
||||||
_bcp = bcp;
|
_bcp = bcp;
|
||||||
|
@ -21,12 +34,12 @@ public sealed class CheckForUpdatesService : INService, IReadyExecutor
|
||||||
_client = client;
|
_client = client;
|
||||||
_sender = sender;
|
_sender = sender;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task OnReadyAsync()
|
public async Task OnReadyAsync()
|
||||||
{
|
{
|
||||||
if (_client.ShardId != 0)
|
if (_client.ShardId != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var timer = new PeriodicTimer(TimeSpan.FromHours(1));
|
using var timer = new PeriodicTimer(TimeSpan.FromHours(1));
|
||||||
while (await timer.WaitForNextTickAsync())
|
while (await timer.WaitForNextTickAsync())
|
||||||
{
|
{
|
||||||
|
@ -34,17 +47,17 @@ public sealed class CheckForUpdatesService : INService, IReadyExecutor
|
||||||
|
|
||||||
if (!conf.CheckForUpdates)
|
if (!conf.CheckForUpdates)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const string URL = "https://cdn.nadeko.bot/cmds/versions.json";
|
|
||||||
using var http = _httpFactory.CreateClient();
|
using var http = _httpFactory.CreateClient();
|
||||||
var versions = await http.GetFromJsonAsync<string[]>(URL);
|
var gitlabRelease = (await http.GetFromJsonAsync<GitlabReleaseModel[]>(RELEASES_URL))
|
||||||
|
?.FirstOrDefault();
|
||||||
|
|
||||||
if (versions is null)
|
if (gitlabRelease?.TagName is null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var latest = versions[0];
|
var latest = gitlabRelease.TagName;
|
||||||
var latestVersion = Version.Parse(latest);
|
var latestVersion = Version.Parse(latest);
|
||||||
var lastKnownVersion = GetLastKnownVersion();
|
var lastKnownVersion = GetLastKnownVersion();
|
||||||
|
|
||||||
|
@ -53,13 +66,13 @@ public sealed class CheckForUpdatesService : INService, IReadyExecutor
|
||||||
UpdateLastKnownVersion(latestVersion);
|
UpdateLastKnownVersion(latestVersion);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (latestVersion > lastKnownVersion)
|
if (latestVersion > lastKnownVersion)
|
||||||
{
|
{
|
||||||
UpdateLastKnownVersion(latestVersion);
|
UpdateLastKnownVersion(latestVersion);
|
||||||
|
|
||||||
// pull changelog
|
// pull changelog
|
||||||
var changelog = await http.GetStringAsync("https://gitlab.com/Kwoth/nadekobot/-/raw/v4/CHANGELOG.md");
|
var changelog = await http.GetStringAsync("https://gitlab.com/nadeko/nadekobot/-/raw/v5/CHANGELOG.md");
|
||||||
|
|
||||||
var thisVersionChangelog = GetVersionChangelog(latestVersion, changelog);
|
var thisVersionChangelog = GetVersionChangelog(latestVersion, changelog);
|
||||||
|
|
||||||
|
@ -72,22 +85,24 @@ public sealed class CheckForUpdatesService : INService, IReadyExecutor
|
||||||
|
|
||||||
var creds = _bcp.GetCreds();
|
var creds = _bcp.GetCreds();
|
||||||
await creds.OwnerIds
|
await creds.OwnerIds
|
||||||
.Select(async x =>
|
.Select(async x =>
|
||||||
{
|
{
|
||||||
var user = await _client.GetUserAsync(x);
|
var user = await _client.GetUserAsync(x);
|
||||||
if (user is null)
|
if (user is null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var eb = _sender.CreateEmbed()
|
var eb = _sender.CreateEmbed()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithAuthor($"NadekoBot v{latestVersion} Released!")
|
.WithAuthor($"NadekoBot v{latest} Released!")
|
||||||
.WithTitle("Changelog")
|
.WithTitle("Changelog")
|
||||||
.WithUrl("https://gitlab.com/Kwoth/nadekobot/-/blob/v4/CHANGELOG.md")
|
.WithUrl("https://gitlab.com/nadeko/nadekobot/-/blob/v5/CHANGELOG.md")
|
||||||
.WithDescription(thisVersionChangelog.TrimTo(4096))
|
.WithDescription(thisVersionChangelog.TrimTo(4096))
|
||||||
.WithFooter("You may disable these messages by typing '.conf bot checkforupdates false'");
|
.WithFooter(
|
||||||
|
"You may disable these messages by typing '.conf bot checkforupdates false'");
|
||||||
|
|
||||||
await _sender.Response(user).Embed(eb).SendAsync();
|
await _sender.Response(user).Embed(eb).SendAsync();
|
||||||
}).WhenAll();
|
})
|
||||||
|
.WhenAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -111,7 +126,7 @@ public sealed class CheckForUpdatesService : INService, IReadyExecutor
|
||||||
// if we got to previous version, end
|
// if we got to previous version, end
|
||||||
if (line.StartsWith("## ["))
|
if (line.StartsWith("## ["))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// if we're reading a new segment, reformat it to print it better to discord
|
// if we're reading a new segment, reformat it to print it better to discord
|
||||||
if (line.StartsWith("### "))
|
if (line.StartsWith("### "))
|
||||||
{
|
{
|
||||||
|
@ -136,11 +151,12 @@ public sealed class CheckForUpdatesService : INService, IReadyExecutor
|
||||||
}
|
}
|
||||||
|
|
||||||
private const string LAST_KNOWN_VERSION_PATH = "data/last_known_version.txt";
|
private const string LAST_KNOWN_VERSION_PATH = "data/last_known_version.txt";
|
||||||
|
|
||||||
private Version? GetLastKnownVersion()
|
private Version? GetLastKnownVersion()
|
||||||
{
|
{
|
||||||
if (!File.Exists(LAST_KNOWN_VERSION_PATH))
|
if (!File.Exists(LAST_KNOWN_VERSION_PATH))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return Version.TryParse(File.ReadAllText(LAST_KNOWN_VERSION_PATH), out var ver)
|
return Version.TryParse(File.ReadAllText(LAST_KNOWN_VERSION_PATH), out var ver)
|
||||||
? ver
|
? ver
|
||||||
: null;
|
: null;
|
||||||
|
|
|
@ -519,7 +519,7 @@ public sealed class Help : NadekoModule<HelpService>
|
||||||
=> smc.RespondConfirmAsync(_sender,
|
=> smc.RespondConfirmAsync(_sender,
|
||||||
"""
|
"""
|
||||||
- In case you don't want or cannot Donate to NadekoBot project, but you
|
- In case you don't want or cannot Donate to NadekoBot project, but you
|
||||||
- NadekoBot is a completely free and fully [open source](https://gitlab.com/kwoth/nadekobot) project which means you can run your own "selfhosted" instance on your computer or server for free.
|
- NadekoBot is a free and [open source](https://gitlab.com/nadeko/nadekobot) project which means you can run your own "selfhosted" instance on your computer.
|
||||||
|
|
||||||
*Keep in mind that running the bot on your computer means that the bot will be offline when you turn off your computer*
|
*Keep in mind that running the bot on your computer means that the bot will be offline when you turn off your computer*
|
||||||
|
|
||||||
|
@ -532,7 +532,6 @@ public sealed class Help : NadekoModule<HelpService>
|
||||||
[OnlyPublicBot]
|
[OnlyPublicBot]
|
||||||
public async Task Donate()
|
public async Task Donate()
|
||||||
{
|
{
|
||||||
// => new NadekoInteractionData(new Emoji("🖥️"), "donate:selfhosting", "Selfhosting");
|
|
||||||
var selfhostInter = _inter.Create(ctx.User.Id,
|
var selfhostInter = _inter.Create(ctx.User.Id,
|
||||||
new SimpleInteraction<object>(new ButtonBuilder(
|
new SimpleInteraction<object>(new ButtonBuilder(
|
||||||
emote: new Emoji("🖥️"),
|
emote: new Emoji("🖥️"),
|
||||||
|
@ -545,33 +544,33 @@ public sealed class Help : NadekoModule<HelpService>
|
||||||
.WithTitle("Thank you for considering to donate to the NadekoBot project!");
|
.WithTitle("Thank you for considering to donate to the NadekoBot project!");
|
||||||
|
|
||||||
eb
|
eb
|
||||||
.WithDescription("NadekoBot relies on donations to keep the servers, services and APIs running.\n"
|
.WithDescription("""
|
||||||
+ "Donating will give you access to some exclusive features. You can read about them on the [patreon page](https://patreon.com/join/nadekobot)")
|
NadekoBot relies on donations to keep the servers, services and APIs running.
|
||||||
|
Donating will give you access to some exclusive features. You can read about them on the [patreon page](https://patreon.com/join/nadekobot)
|
||||||
|
""")
|
||||||
.AddField("Donation Instructions",
|
.AddField("Donation Instructions",
|
||||||
$@"
|
$"""
|
||||||
🗒️ Before pledging it is recommended to open your DMs as Nadeko will send you a welcome message with instructions after you pledge has been processed and confirmed.
|
🗒️ Before pledging it is recommended to open your DMs as Nadeko will send you a welcome message with instructions after you pledge has been processed and confirmed.
|
||||||
|
|
||||||
**Step 1:** ❤️ Pledge on Patreon ❤️
|
**Step 1:** ❤️ Pledge on Patreon ❤️
|
||||||
|
|
||||||
`1.` Go to <https://patreon.com/join/nadekobot> and choose a tier.
|
`1.` Go to <https://patreon.com/join/nadekobot> and choose a tier.
|
||||||
`2.` Make sure your payment is processed and accepted.
|
`2.` Make sure your payment is processed and accepted.
|
||||||
|
|
||||||
**Step 2** 🤝 Connect your Discord account 🤝
|
**Step 2** 🤝 Connect your Discord account 🤝
|
||||||
|
|
||||||
`1.` Go to your profile settings on Patreon and connect your Discord account to it.
|
`1.` Go to your profile settings on Patreon and connect your Discord account to it.
|
||||||
*please make sure you're logged into the correct Discord account*
|
*please make sure you're logged into the correct Discord account*
|
||||||
|
|
||||||
If you do not know how to do it, you may follow instructions in this link:
|
If you do not know how to do it, you may [follow instructions here](https://support.patreon.com/hc/en-us/articles/212052266-How-do-I-connect-Discord-to-Patreon-Patron-)
|
||||||
<https://support.patreon.com/hc/en-us/articles/212052266-How-do-I-connect-Discord-to-Patreon-Patron->
|
|
||||||
|
|
||||||
**Step 3** ⏰ Wait a short while (usually 1-3 minutes) ⏰
|
**Step 3** ⏰ Wait a short while (usually 1-3 minutes) ⏰
|
||||||
|
|
||||||
Nadeko will DM you the welcome instructions, and you may start using the patron-only commands and features!
|
Nadeko will DM you the welcome instructions, and you may will receive your rewards!
|
||||||
🎉 **Enjoy!** 🎉
|
🎉 **Enjoy!** 🎉
|
||||||
")
|
""")
|
||||||
.AddField("Troubleshooting",
|
.AddField("Troubleshooting",
|
||||||
"""
|
"""
|
||||||
|
|
||||||
*In case you didn't receive the rewards within 5 minutes:*
|
*In case you didn't receive the rewards within 5 minutes:*
|
||||||
`1.` Make sure your DMs are open to everyone. Maybe your pledge was processed successfully but the bot was unable to DM you. Use the `.patron` command to check your status.
|
`1.` Make sure your DMs are open to everyone. Maybe your pledge was processed successfully but the bot was unable to DM you. Use the `.patron` command to check your status.
|
||||||
`2.` Make sure you've connected the CORRECT Discord account. Quite often users log in to different Discord accounts in their browser. You may also try disconnecting and reconnecting your account.
|
`2.` Make sure you've connected the CORRECT Discord account. Quite often users log in to different Discord accounts in their browser. You may also try disconnecting and reconnecting your account.
|
||||||
|
|
Loading…
Reference in a new issue