Compare commits

...

14 Commits
4.3.21 ... v4

Author SHA1 Message Date
Kwoth
cb7743e244 Update CHANGELOG.md 2024-05-10 15:31:16 +00:00
Kwoth
7b5fbd184b Update CHANGELOG.md 2024-05-09 06:43:10 +00:00
Kwoth
a9cd1534c2 docs: Updated changelog to have v5 changes. Probably last commit to this branch. 2024-05-09 06:41:43 +00:00
Kwoth
bca845d76a Merge branch 'v4' of https://gitlab.com/kwoth/nadekobot into v4 2024-04-26 12:50:03 +00:00
Kwoth
6c305860bc Fixed some compilation warnings 2024-04-26 12:49:55 +00:00
Kwoth
eee4e64d80 Merge branch 'hokutochen-v4-patch-28749' into 'v4'
Removed random W

See merge request Kwoth/nadekobot!316
2024-04-26 11:55:54 +00:00
Hokuto Chen
236a8aa9ac Removed random W 2024-04-26 05:00:41 +00:00
Kwoth
f491e3d37d Merge branch 'Kieteyuku-v4-patch-93427' into 'v4'
Correctly label auto-restart options

See merge request Kwoth/nadekobot!315
2024-04-24 09:59:12 +00:00
Ene
1f11e4f227 Correctly label auto-restart options 2024-04-24 09:59:11 +00:00
Kwoth
5060d606cf Merge branch 'v4' of https://gitlab.com/kwoth/nadekobot into v4 2024-04-23 09:17:34 +00:00
Kwoth
23b3ad5837 * Fixed pagination emoji, closes #427
* Version upped to 4.3.22
2024-04-23 09:17:02 +00:00
Kwoth
7297318538 Fixed pagination emoji, closes #427 2024-04-23 09:14:27 +00:00
Kwoth
18619b4d3a Merge branch 'banner' into 'v4'
SetBanner command

See merge request Kwoth/nadekobot!314
2024-04-19 16:08:51 +00:00
Cata
ef06388335 Added .setbanner command 2024-04-19 16:08:51 +00:00
12 changed files with 144 additions and 12 deletions

View File

@@ -1,8 +1,86 @@
# Changelog
Experimental changelog. Mostly based on [keepachangelog](https://keepachangelog.com/en/1.0.0/) except date format. a-c-f-r-o
Mostly based on [keepachangelog](https://keepachangelog.com/en/1.0.0/) except date format. a-c-f-r-o
## [4.3.21]
## [5.0.4] - 10.05.2024
### Added
- Added `.shopadd command` You can now sell commands in the shop. The command will execute as if you were the one running it when someone buys it
- type `.h .shopadd` for more info
- Added `.stickyroles` Users leaving the server will have their roles saved to the database and reapplied if they rejoin within 30 days.
- Giveaway commands
- `.ga start <duration> <text>` starts the giveway with the specified duration and message (prize). You may have up to 5 giveaways on the server at once
- `.ga end <id>` prematurely ends the giveaway and selects a winner
- `.ga cancel <id>` cancels the giveaway and doesn't select a winner
- `.ga list` lists active giveaways on the current server
- `.ga reroll <id>` rerolls the winner on the completed giveaway. This only works for 24 hours after the giveaway has ended, or until the bot restarts.
- Users can join the giveaway by adding a :tada: reaction
- Added Todo Commands
- `.todo add <name>` - adds a new todo
- `.todo delete <id>` - deletes a todo item
- `.todo done <id>` - completes a todo (marks it with a checkmark)
- `.todo list` - lists all todos
- `.todo edit <id> <new message>` - edits a todo item message
- `.todo show <id>` - Shows the text of the specified todo item
- In addition to that, there are also Todo archive commands
- `.todo archive add <name>` - adds all current todos (completed and not completed) to the archived list, your current todo list will become cleared
- `.todo archive list` - lists all your archived todo lists
- `.todo archive show <id>` - shows the todo items from one of your archived lists
- `.todo archive delete <id>` - deletes and archived todo list
- Added `.queufairplay` / `.qfp` (music feature) re-added but it works differently
- Once you run it, it will reorganize currently queued songs so that they're in a fair order.
- Added `.clubrename` command to uh rename your club
- For self-hosters:
- Added `.sqlselectcsv` which will return results in a csv file instead of an embed.
- You can set whether nadeko ignores other bots in `bot.yml`
- You can set shop sale cut in `gambling.yml`
- Added a page parameter to `.feedlist`
- Added seconds/sec/s to `.convert` command
- Added `.prunecancel` to cancel an active prune
- Added progress reporting when using `.prune`.
- Added audit log reason for `.setrole` and some other features
### Changed
- Users who have manage messages perm in the channel will now be excluded from link and invite filtering (`.sfi` and `.sfl`)
- `.send` command should work consistently and correctly now. You can have targets from other shards too. The usage has been changed. refer to `.h .send` for more info
- `.serverinfo` no longer takes a server name. It only takes an id or no arguments
- You can now target a different channel with .repeat
- `.cmds <module name>`, `.cmds <group name` and `.mdls` looks better
- The bot will now send a discord Reply to every command
- `.queuesearch` / `.qs` will now show the results with respective video thumbnails
- A lot of code cleanup (still a lot to be done) and Quality of Life improvements
- `.inrole` will now show mentions primarily, and use a spoiler to show usernames
### Fixed
- `.feed` should now correctly accept (and show) the message which can be passed as the third parameter
- `.say` will now correctly report errors if the user or the bot don't have sufficent perms to send a message in the targeted channel
- Fixed `.invitelist` not paginating correctly
- `.serverinfo` will now correctly work for other shards
- `.send` will now correctly work for other shards
- `.translate` command will no longer fail if the user capitalizes the language name
- Fixed xp card user avatar not showing for some users
### Removed
- `.poll` commands removed as discord added polls
- `.scpl` and other music soundcloud commands have been removed as soundcloud isn't issuing new api tokens for years now
- Removed a lot of useless and nsfw commands
- Removed log voice presence TTS
- Cleanup: Removed a lot of obsolete aliases from aliases.yml
## [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`

View File

@@ -1,4 +1,4 @@
w# Setting up NadekoBot on Linux
# Setting up NadekoBot on Linux
| Table of Contents |
| :-------------------------------------------------- |
@@ -180,8 +180,8 @@ Choose:
[1] to Run NadekoBot with Auto Restart on "die" command without updating.
[2] to Run with Auto Updating on restart after using "die" command.
```
- Run `1` to update the bot upon restart. (This is done using the `.die` command)
- Run `2` to restart the bot without updating. (This is also done using the `.die` command)
- Run `1` to restart the bot without updating. (This is done using the `.die` command)
- Run `2` to update the bot upon restart. (This is also done using the `.die` command)
5. That's it! to detatch the tmux session:
- Press `Ctrl` + `B`

View File

@@ -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>

View File

@@ -113,6 +113,7 @@ public sealed class DoAsUserMessage : IUserMessage
public MessageFlags? Flags => _msg.Flags;
[Obsolete("Obsolete in favor of InteractionMetadata")]
public IMessageInteraction Interaction => _msg.Interaction;
public MessageRoleSubscriptionData RoleSubscriptionData => _msg.RoleSubscriptionData;
@@ -146,4 +147,7 @@ public sealed class DoAsUserMessage : IUserMessage
public MessageResolvedData ResolvedData => _msg.ResolvedData;
public IUserMessage ReferencedMessage => _msg.ReferencedMessage;
public IMessageInteractionMetadata InteractionMetadata
=> _msg.InteractionMetadata;
}

View File

@@ -502,6 +502,16 @@ public partial class Administration
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]
public async Task SetGame(ActivityType type, [Leftover] string game = null)

View File

@@ -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();

View File

@@ -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" />
@@ -60,7 +60,7 @@
<PackageReference Include="Serilog.Sinks.Seq" Version="5.1.1" />
<PackageReference Include="SharpToken" Version="1.2.14" />
<PackageReference Include="SixLabors.Fonts" Version="1.0.0-beta17" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.8" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta14" />
<PackageReference Include="SixLabors.Shapes" Version="1.0.0-beta0009" />
<PackageReference Include="StackExchange.Redis" Version="2.6.48" />

View File

@@ -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";

View File

@@ -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,

View File

@@ -195,6 +195,8 @@ setnick:
setavatar:
- setavatar
- setav
setbanner:
- setbanner
setgame:
- setgame
send:

View File

@@ -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:

View File

@@ -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!",