mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 09:18:27 -04:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7ba345b0fc | ||
|
5d775c9589 | ||
|
2bd8ead10c | ||
|
1148ba3e6e | ||
|
5498bec8cc | ||
|
9eed0c6be5 | ||
|
acf6b7cf58 | ||
|
8598419c5f | ||
|
758093eb32 | ||
|
f44dd03f1a | ||
|
8ac5ec9f57 | ||
|
5209ba802a | ||
|
adfce6670c | ||
|
f8fbc71985 | ||
|
d4e2516a17 | ||
|
f62a67e2e6 |
34
CHANGELOG.md
34
CHANGELOG.md
@@ -2,7 +2,37 @@
|
||||
|
||||
Mostly based on [keepachangelog](https://keepachangelog.com/en/1.0.0/) except date format. a-c-f-r-o
|
||||
|
||||
## [5.3.0] - 07.12.2024
|
||||
|
||||
## [5.3.3] - 15.12.2024
|
||||
|
||||
## Fixed
|
||||
|
||||
- `.notify` commands are no longer owner only, they now require Admin permissions
|
||||
- `.notify` messages can now mention anyone
|
||||
|
||||
## [5.3.2] - 14.12.2024
|
||||
|
||||
## Fixed
|
||||
|
||||
- `.banner` should be working properly now with both server and global user banners
|
||||
|
||||
## [5.3.1] - 13.12.2024
|
||||
|
||||
## Changed
|
||||
|
||||
- `.translate` will now use 2 embeds, to allow for longer messages
|
||||
- Added role icon to `.inrole`, if it exists
|
||||
- `.honeypot` will now add a 'Honeypot' as a ban reason.
|
||||
|
||||
## Fixed
|
||||
|
||||
- `.winlb` looks better, has a title, shows 9 entries now
|
||||
- `.sar ex` help updated
|
||||
- `.banner` partially fixed, it still can't show global banners, but it will show guild ones correctly, in a good enough size
|
||||
- `.sclr` will now show correct color hexes without alpha
|
||||
- `.dmcmd` will now correctly block commands in dms, not globally
|
||||
|
||||
## [5.3.0] - 10.12.2024
|
||||
|
||||
## Added
|
||||
|
||||
@@ -35,10 +65,12 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.0.0/) except da
|
||||
- `.sclr show` will now show hex code of the current color
|
||||
- Queueing a song will now restart the playback if the queue is on the last track and stopped (there were no more tracks
|
||||
to play)
|
||||
- `.translate` will now use 2 embeds instead of 1
|
||||
|
||||
## Fixed
|
||||
|
||||
- .setstream and .setactivity will now pause .ropl (rotating statuses)
|
||||
- Fixed `.sar ex` help description
|
||||
|
||||
## Removed
|
||||
|
||||
|
@@ -71,7 +71,7 @@ public sealed class HoneyPotService : IHoneyPotService, IReadyExecutor, IExecNoC
|
||||
try
|
||||
{
|
||||
Log.Information("Honeypot caught user {User} [{UserId}]", user, user.Id);
|
||||
await user.BanAsync(pruneDays: 1);
|
||||
await user.BanAsync(pruneDays: 1, reason: "Honeypot");
|
||||
await user.Guild.RemoveBanAsync(user.Id);
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@@ -8,7 +8,7 @@ public partial class Administration
|
||||
public class NotifyCommands : NadekoModule<NotifyService>
|
||||
{
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async Task Notify()
|
||||
{
|
||||
await Response()
|
||||
@@ -42,7 +42,7 @@ public partial class Administration
|
||||
};
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async Task Notify(NotifyType nType, [Leftover] string? message = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(message))
|
||||
@@ -76,7 +76,7 @@ public partial class Administration
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async Task NotifyList(int page = 1)
|
||||
{
|
||||
if (--page < 0)
|
||||
@@ -104,7 +104,7 @@ public partial class Administration
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async Task NotifyClear(NotifyType nType)
|
||||
{
|
||||
await _service.DisableAsync(ctx.Guild.Id, nType);
|
||||
|
@@ -75,7 +75,7 @@ public sealed class NotifyService : IReadyExecutor, INotifySubscriber, INService
|
||||
data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private async Task OnEvent<T>(T model)
|
||||
where T : struct, INotifyModel
|
||||
{
|
||||
@@ -146,6 +146,7 @@ public sealed class NotifyService : IReadyExecutor, INotifySubscriber, INService
|
||||
|
||||
await _mss.Response(channel)
|
||||
.Text(st)
|
||||
.Sanitize(false)
|
||||
.SendAsync();
|
||||
}
|
||||
|
||||
|
@@ -149,7 +149,10 @@ public partial class Gambling
|
||||
?? (await _userService.GetUserAsync(x.UserId))?.Username
|
||||
?? x.UserId.ToString();
|
||||
|
||||
outputItems.Add(new WinLbStat(i + 1 + (page * 10), user, x.Game, x.MaxWin));
|
||||
if (user.StartsWith("??"))
|
||||
user = x.UserId.ToString();
|
||||
|
||||
outputItems.Add(new WinLbStat(i + 1 + (page * 9), user, x.Game, x.MaxWin));
|
||||
}
|
||||
|
||||
return outputItems;
|
||||
@@ -166,11 +169,12 @@ public partial class Gambling
|
||||
await Response()
|
||||
.Paginated()
|
||||
.PageItems(p => GetCachedWinLbAsync(p))
|
||||
.PageSize(10)
|
||||
.PageSize(9)
|
||||
.Page((items, curPage) =>
|
||||
{
|
||||
var eb = CreateEmbed()
|
||||
.WithOkColor();
|
||||
.WithTitle(GetText(strs.winlb))
|
||||
.WithOkColor();
|
||||
|
||||
if (items.Count == 0)
|
||||
{
|
||||
@@ -182,7 +186,8 @@ public partial class Gambling
|
||||
{
|
||||
var item = items[i];
|
||||
eb.AddField($"#{item.Rank} {item.User}",
|
||||
$"{N(item.MaxWin)}\n`{item.Game.ToString().ToLower()}`");
|
||||
$"{N(item.MaxWin)}\n`{item.Game.ToString().ToLower()}`",
|
||||
true);
|
||||
}
|
||||
|
||||
return eb;
|
||||
|
@@ -135,7 +135,6 @@ public partial class Gambling : GamblingModule<GamblingService>
|
||||
});
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task Timely()
|
||||
{
|
||||
var val = Config.Timely.Amount;
|
||||
|
@@ -60,8 +60,8 @@ public sealed class UserBetStatsService : INService
|
||||
await using var ctx = _db.GetDbContext();
|
||||
return await ctx.GetTable<UserBetStats>()
|
||||
.OrderByDescending(x => x.MaxWin)
|
||||
.Skip(page * 10)
|
||||
.Take(10)
|
||||
.Skip(page * 9)
|
||||
.Take(9)
|
||||
.ToArrayAsyncLinqToDB();
|
||||
}
|
||||
}
|
@@ -92,13 +92,13 @@ public class GlobalPermissionService : IExecPreCommand, INService
|
||||
{
|
||||
if (priv)
|
||||
{
|
||||
if (bs.Blocked.Commands.Add(commandName))
|
||||
if (bs.DmBlocked.Commands.Add(commandName))
|
||||
{
|
||||
added = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
bs.Blocked.Commands.Remove(commandName);
|
||||
bs.DmBlocked.Commands.Remove(commandName);
|
||||
added = false;
|
||||
}
|
||||
|
||||
|
@@ -417,15 +417,25 @@ public partial class Searches : NadekoModule<SearchesService>
|
||||
{
|
||||
usr ??= (IGuildUser)ctx.User;
|
||||
|
||||
var bannerUrl = usr.GetGuildBannerUrl();
|
||||
var bannerUrl = usr.GetGuildBannerUrl(size: 2048)
|
||||
?? (await ((DiscordSocketClient)ctx.Client).Rest.GetUserAsync(usr.Id))?.GetBannerUrl();
|
||||
|
||||
if (bannerUrl is null)
|
||||
{
|
||||
await Response()
|
||||
.Error(strs.no_banner)
|
||||
.SendAsync();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
await Response()
|
||||
.Embed(
|
||||
CreateEmbed()
|
||||
.WithOkColor()
|
||||
.AddField("Username", usr.ToString())
|
||||
.AddField("Banner Url", bannerUrl)
|
||||
.WithThumbnailUrl(bannerUrl))
|
||||
.AddField("Username", usr.ToString(), true)
|
||||
.AddField("Banner Url", bannerUrl, true)
|
||||
.WithImageUrl(bannerUrl))
|
||||
.SendAsync();
|
||||
}
|
||||
|
||||
|
@@ -13,9 +13,9 @@ public partial class Utility
|
||||
public async Task ServerColorsShow()
|
||||
{
|
||||
var colors = _service.GetColors(ctx.Guild.Id);
|
||||
var okHex = colors?.Ok?.RawValue.ToString("X8");
|
||||
var warnHex = colors?.Warn?.RawValue.ToString("X8");
|
||||
var errHex = colors?.Error?.RawValue.ToString("X8");
|
||||
var okHex = colors?.Ok?.RawValue.ToString("x6");
|
||||
var warnHex = colors?.Warn?.RawValue.ToString("x6");
|
||||
var errHex = colors?.Error?.RawValue.ToString("x6");
|
||||
EmbedBuilder[] ebs =
|
||||
[
|
||||
CreateEmbed()
|
||||
|
@@ -186,7 +186,7 @@ public partial class Utility : NadekoModule
|
||||
|
||||
return CreateEmbed()
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText(strs.inrole_list(roleName, roleUsers.Count)))
|
||||
.WithTitle(GetText(strs.inrole_list(role?.GetIconUrl() + roleName, roleUsers.Count)))
|
||||
.WithDescription(string.Join("\n", pageUsers));
|
||||
})
|
||||
.SendAsync();
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>true</ImplicitUsings>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
<Version>5.3.0</Version>
|
||||
<Version>5.3.3</Version>
|
||||
|
||||
<!-- Output/build -->
|
||||
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
|
||||
|
@@ -961,6 +961,56 @@
|
||||
"MuteMembers Server Permission"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".notify",
|
||||
".nfy"
|
||||
],
|
||||
"Description": "Sends a message to the current channel once the specified event occurs.\nProvide no parameters to see all available events.",
|
||||
"Usage": [
|
||||
".notify levelup Congratulations to user %user.name% for reaching level %event.level%"
|
||||
],
|
||||
"Submodule": "NotifyCommands",
|
||||
"Module": "Administration",
|
||||
"Options": null,
|
||||
"Requirements": [
|
||||
"Bot Owner Only"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".notifylist",
|
||||
".notifyl"
|
||||
],
|
||||
"Description": "Lists all active notifications in this server.",
|
||||
"Usage": [
|
||||
".notifylist"
|
||||
],
|
||||
"Submodule": "NotifyCommands",
|
||||
"Module": "Administration",
|
||||
"Options": null,
|
||||
"Requirements": [
|
||||
"Bot Owner Only"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".notifyclear",
|
||||
".notifyremove",
|
||||
".notifyrm",
|
||||
".notifclr"
|
||||
],
|
||||
"Description": "Removes the specified notify event.",
|
||||
"Usage": [
|
||||
".notifyclear levelup"
|
||||
],
|
||||
"Submodule": "NotifyCommands",
|
||||
"Module": "Administration",
|
||||
"Options": null,
|
||||
"Requirements": [
|
||||
"Bot Owner Only"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".dpo"
|
||||
@@ -1523,6 +1573,22 @@
|
||||
"Administrator Server Permission"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".temprole"
|
||||
],
|
||||
"Description": "Grants a user a temporary role for the specified number of time.\nThe role must exist and be lower in the role hierarchy than your highest role.",
|
||||
"Usage": [
|
||||
".temprole 15m @User Jail",
|
||||
".temprole 7d @Newbie Trial Member"
|
||||
],
|
||||
"Submodule": "RoleCommands",
|
||||
"Module": "Administration",
|
||||
"Options": null,
|
||||
"Requirements": [
|
||||
"Administrator Server Permission"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".iam"
|
||||
@@ -1648,9 +1714,9 @@
|
||||
".sar excl",
|
||||
".sar tesar"
|
||||
],
|
||||
"Description": "Toggles whether self-assigned roles are exclusive. While enabled, users can only have one self-assignable role per group.",
|
||||
"Description": "Toggles the sar group as exclusive.\nWhile enabled, users can only have one self-assignable role from that group.",
|
||||
"Usage": [
|
||||
".sar exclusive"
|
||||
".sar exclusive 1"
|
||||
],
|
||||
"Submodule": "sar",
|
||||
"Module": "Administration",
|
||||
@@ -3274,6 +3340,21 @@
|
||||
"Options": null,
|
||||
"Requirements": []
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".winlb",
|
||||
".wins"
|
||||
],
|
||||
"Description": "Shows the biggest wins leaderboard",
|
||||
"Usage": [
|
||||
".winlb",
|
||||
".winlb 5"
|
||||
],
|
||||
"Submodule": "BetStatsCommands",
|
||||
"Module": "Gambling",
|
||||
"Options": null,
|
||||
"Requirements": []
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".gamblestats",
|
||||
@@ -3915,6 +3996,20 @@
|
||||
"Options": null,
|
||||
"Requirements": []
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".minesweeper",
|
||||
".mw"
|
||||
],
|
||||
"Description": "Creates a spoiler-based minesweeper mini game.\nYou may specify the number of mines.",
|
||||
"Usage": [
|
||||
".minesweeper 15"
|
||||
],
|
||||
"Submodule": "Games",
|
||||
"Module": "Games",
|
||||
"Options": null,
|
||||
"Requirements": []
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".acrophobia",
|
||||
@@ -5522,6 +5617,38 @@
|
||||
"Bot Owner Only"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".dmmodule",
|
||||
".dmmod"
|
||||
],
|
||||
"Description": "Toggles whether a module can be used in DMs.",
|
||||
"Usage": [
|
||||
".dmmodule Gambling"
|
||||
],
|
||||
"Submodule": "GlobalPermissionCommands",
|
||||
"Module": "Permissions",
|
||||
"Options": null,
|
||||
"Requirements": [
|
||||
"Bot Owner Only"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".dmcommand",
|
||||
".dmcmd"
|
||||
],
|
||||
"Description": "Toggles whether a command can be used in DMs.",
|
||||
"Usage": [
|
||||
".dmcommand .stats"
|
||||
],
|
||||
"Submodule": "GlobalPermissionCommands",
|
||||
"Module": "Permissions",
|
||||
"Options": null,
|
||||
"Requirements": [
|
||||
"Bot Owner Only"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".resetperms"
|
||||
@@ -5791,6 +5918,19 @@
|
||||
"Options": null,
|
||||
"Requirements": []
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".banner"
|
||||
],
|
||||
"Description": "Shows a mentioned person's banner.",
|
||||
"Usage": [
|
||||
".banner @Someone"
|
||||
],
|
||||
"Submodule": "Searches",
|
||||
"Module": "Searches",
|
||||
"Options": null,
|
||||
"Requirements": []
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".wikia",
|
||||
@@ -7778,21 +7918,6 @@
|
||||
"Options": null,
|
||||
"Requirements": []
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".xpnotify",
|
||||
".xpn"
|
||||
],
|
||||
"Description": "Sets how the bot should notify you when you get a `server` or `global` level. This is a personal setting and affects only how you receive Global or Server level-up notifications. You can set `dm` (for the bot to send you a direct message), `channel` (to get notified in the channel you sent the last message in) or `none` to disable.",
|
||||
"Usage": [
|
||||
".xpnotify global dm",
|
||||
".xpnotify server channel"
|
||||
],
|
||||
"Submodule": "Xp",
|
||||
"Module": "Xp",
|
||||
"Options": null,
|
||||
"Requirements": []
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".xpexclude",
|
||||
@@ -7854,6 +7979,21 @@
|
||||
"Options": null,
|
||||
"Requirements": []
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".xplevelset"
|
||||
],
|
||||
"Description": "Sets the level of the user you specify.",
|
||||
"Usage": [
|
||||
".xplevelset 10 @User"
|
||||
],
|
||||
"Submodule": "Xp",
|
||||
"Module": "Xp",
|
||||
"Options": null,
|
||||
"Requirements": [
|
||||
"Administrator Server Permission"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".xpadd"
|
||||
|
@@ -1157,5 +1157,7 @@
|
||||
"notify_desc_protection": "Triggers when antialt, antispam or antiraid is triggered.",
|
||||
"notify_desc_addrolerew": "Triggers when a user gets a role as a reward for reaching a level (xprew).",
|
||||
"notify_desc_removerolerew": "Triggers when a user loses a role as a reward for reaching a level (xprew).",
|
||||
"notify_desc_not_found": "No description found for this notify event. Please report this."
|
||||
"notify_desc_not_found": "No description found for this notify event. Please report this.",
|
||||
"winlb": "Biggest Wins Leaderboard",
|
||||
"no_banner": "No banner set."
|
||||
}
|
||||
|
Reference in New Issue
Block a user