mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 09:18:27 -04:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
23b3ad5837 | ||
|
18619b4d3a | ||
|
ef06388335 |
11
CHANGELOG.md
11
CHANGELOG.md
@@ -2,7 +2,16 @@
|
||||
|
||||
Experimental changelog. Mostly based on [keepachangelog](https://keepachangelog.com/en/1.0.0/) except date format. a-c-f-r-o
|
||||
|
||||
## [4.3.21]
|
||||
## [4.3.22] - 23.04.2023
|
||||
|
||||
### Added
|
||||
- Added `.setbanner` command (thx cata)
|
||||
|
||||
### Fixed
|
||||
- Fixed pagination error due to a missing emoji
|
||||
|
||||
|
||||
## [4.3.21] - 19.04.2023
|
||||
|
||||
### Fixed
|
||||
- Possible fix for a duplicate in `.h bank`
|
||||
|
@@ -12,7 +12,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Discord.Net.Core" Version="3.104.0" />
|
||||
<PackageReference Include="Discord.Net.Core" Version="3.204.0" />
|
||||
<PackageReference Include="Serilog" Version="2.11.0" />
|
||||
<PackageReference Include="YamlDotNet" Version="11.2.1" />
|
||||
</ItemGroup>
|
||||
|
@@ -146,4 +146,5 @@ public sealed class DoAsUserMessage : IUserMessage
|
||||
public MessageResolvedData ResolvedData => _msg.ResolvedData;
|
||||
|
||||
public IUserMessage ReferencedMessage => _msg.ReferencedMessage;
|
||||
public IMessageInteractionMetadata InteractionMetadata { get; }
|
||||
}
|
@@ -501,6 +501,16 @@ public partial class Administration
|
||||
if (success)
|
||||
await ReplyConfirmLocalizedAsync(strs.set_avatar);
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async Task SetBanner([Leftover] string img = null)
|
||||
{
|
||||
var success = await _service.SetBanner(img);
|
||||
|
||||
if (success)
|
||||
await ReplyConfirmLocalizedAsync(strs.set_banner);
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
|
@@ -3,7 +3,6 @@ using Microsoft.EntityFrameworkCore;
|
||||
using NadekoBot.Common.ModuleBehaviors;
|
||||
using NadekoBot.Services.Database.Models;
|
||||
using System.Collections.Immutable;
|
||||
using Nadeko.Common;
|
||||
|
||||
namespace NadekoBot.Modules.Administration.Services;
|
||||
|
||||
@@ -321,6 +320,40 @@ public sealed class SelfService : IExecNoCommand, IReadyExecutor, INService
|
||||
return true;
|
||||
}
|
||||
|
||||
public async Task<bool> SetBanner(string img)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(img))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Uri.IsWellFormedUriString(img, UriKind.Absolute))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var uri = new Uri(img);
|
||||
|
||||
using var http = _httpFactory.CreateClient();
|
||||
using var sr = await http.GetAsync(uri, HttpCompletionOption.ResponseHeadersRead);
|
||||
|
||||
if (!sr.IsImage())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sr.GetContentLength() > 8.Megabytes().Bytes)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
await using var imageStream = await sr.Content.ReadAsStreamAsync();
|
||||
|
||||
await _client.CurrentUser.ModifyAsync(x => x.Banner = new Image(imageStream));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void ClearStartupCommands()
|
||||
{
|
||||
using var uow = _db.GetDbContext();
|
||||
|
@@ -27,7 +27,7 @@
|
||||
<PackageReference Include="CodeHollow.FeedReader" Version="1.2.4" />
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="CsvHelper" Version="28.0.1" />
|
||||
<PackageReference Include="Discord.Net" Version="3.203.0" />
|
||||
<PackageReference Include="Discord.Net" Version="3.204.0" />
|
||||
<PackageReference Include="CoreCLR-NCalc" Version="2.2.110" />
|
||||
<PackageReference Include="Google.Apis.Urlshortener.v1" Version="1.41.1.138" />
|
||||
<PackageReference Include="Google.Apis.YouTube.v3" Version="1.62.1.3205" />
|
||||
|
@@ -7,7 +7,7 @@ namespace NadekoBot.Services;
|
||||
|
||||
public sealed class StatsService : IStatsService, IReadyExecutor, INService
|
||||
{
|
||||
public const string BOT_VERSION = "4.3.21";
|
||||
public const string BOT_VERSION = "4.3.22";
|
||||
|
||||
public string Author
|
||||
=> "Kwoth#2452";
|
||||
|
@@ -167,8 +167,8 @@ public static class MessageChannelExtensions
|
||||
private const string BUTTON_LEFT = "BUTTON_LEFT";
|
||||
private const string BUTTON_RIGHT = "BUTTON_RIGHT";
|
||||
|
||||
private static readonly IEmote _arrowLeft = Emote.Parse("<:x:969658061805465651>");
|
||||
private static readonly IEmote _arrowRight = Emote.Parse("<:x:969658062220701746>");
|
||||
private static readonly IEmote _arrowLeft = Emote.Parse("<:x:1232256519844790302>");
|
||||
private static readonly IEmote _arrowRight = Emote.Parse("<:x:1232256515298295838>");
|
||||
|
||||
public static Task SendPaginatedConfirmAsync(
|
||||
this ICommandContext ctx,
|
||||
|
@@ -195,6 +195,8 @@ setnick:
|
||||
setavatar:
|
||||
- setavatar
|
||||
- setav
|
||||
setbanner:
|
||||
- setbanner
|
||||
setgame:
|
||||
- setgame
|
||||
send:
|
||||
|
@@ -402,6 +402,10 @@ setavatar:
|
||||
desc: "Sets a new avatar image for the NadekoBot. Parameter is a direct link to an image."
|
||||
args:
|
||||
- "https://i.imgur.com/xTG3a1I.jpg"
|
||||
setbanner:
|
||||
desc: "Sets a new banner image for the NadekoBot. Parameter is a direct link to an image. Supports gifs."
|
||||
args:
|
||||
- "https://i.imgur.com/xTG3a1I.jpg"
|
||||
setgame:
|
||||
desc: "Sets the bots game status to either Playing, Listening, or Watching."
|
||||
args:
|
||||
|
@@ -184,6 +184,7 @@
|
||||
"setrole": "Successfully added role {0} to user {1}",
|
||||
"setrole_err": "Failed to add role. I have insufficient permissions.",
|
||||
"set_avatar": "New avatar set!",
|
||||
"set_banner": "New banner set!",
|
||||
"set_channel_name": "New channel name set.",
|
||||
"set_game": "New game set!",
|
||||
"set_stream": "New stream set!",
|
||||
|
Reference in New Issue
Block a user