Compare commits
No commits in common. "v5" and "5.3.2" have entirely different histories.
7 changed files with 10 additions and 30 deletions
|
@ -2,13 +2,6 @@
|
||||||
|
|
||||||
Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except date format. a-c-f-r-o
|
Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except date format. a-c-f-r-o
|
||||||
|
|
||||||
## [5.3.3] - 16.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
|
## [5.3.2] - 14.12.2024
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>true</ImplicitUsings>
|
<ImplicitUsings>true</ImplicitUsings>
|
||||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||||
<Version>5.3.3</Version>
|
<Version>5.3.2</Version>
|
||||||
|
|
||||||
<!-- Output/build -->
|
<!-- Output/build -->
|
||||||
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
|
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
|
||||||
|
|
|
@ -17,9 +17,6 @@ public static class MigrationQueries
|
||||||
|
|
||||||
public static void MigrateSar(MigrationBuilder migrationBuilder)
|
public static void MigrateSar(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
if (migrationBuilder.IsNpgsql())
|
|
||||||
return;
|
|
||||||
|
|
||||||
migrationBuilder.Sql("""
|
migrationBuilder.Sql("""
|
||||||
INSERT INTO GroupName (Number, GuildConfigId)
|
INSERT INTO GroupName (Number, GuildConfigId)
|
||||||
SELECT DISTINCT "Group", GC.Id
|
SELECT DISTINCT "Group", GC.Id
|
||||||
|
|
|
@ -8,7 +8,7 @@ public partial class Administration
|
||||||
public class NotifyCommands : EllieModule<NotifyService>
|
public class NotifyCommands : EllieModule<NotifyService>
|
||||||
{
|
{
|
||||||
[Cmd]
|
[Cmd]
|
||||||
[UserPerm(GuildPerm.Administrator)]
|
[OwnerOnly]
|
||||||
public async Task Notify()
|
public async Task Notify()
|
||||||
{
|
{
|
||||||
await Response()
|
await Response()
|
||||||
|
@ -42,7 +42,7 @@ public partial class Administration
|
||||||
};
|
};
|
||||||
|
|
||||||
[Cmd]
|
[Cmd]
|
||||||
[UserPerm(GuildPerm.Administrator)]
|
[OwnerOnly]
|
||||||
public async Task Notify(NotifyType nType, [Leftover] string? message = null)
|
public async Task Notify(NotifyType nType, [Leftover] string? message = null)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(message))
|
if (string.IsNullOrWhiteSpace(message))
|
||||||
|
@ -76,7 +76,7 @@ public partial class Administration
|
||||||
}
|
}
|
||||||
|
|
||||||
[Cmd]
|
[Cmd]
|
||||||
[UserPerm(GuildPerm.Administrator)]
|
[OwnerOnly]
|
||||||
public async Task NotifyList(int page = 1)
|
public async Task NotifyList(int page = 1)
|
||||||
{
|
{
|
||||||
if (--page < 0)
|
if (--page < 0)
|
||||||
|
@ -104,7 +104,7 @@ public partial class Administration
|
||||||
}
|
}
|
||||||
|
|
||||||
[Cmd]
|
[Cmd]
|
||||||
[UserPerm(GuildPerm.Administrator)]
|
[OwnerOnly]
|
||||||
public async Task NotifyClear(NotifyType nType)
|
public async Task NotifyClear(NotifyType nType)
|
||||||
{
|
{
|
||||||
await _service.DisableAsync(ctx.Guild.Id, nType);
|
await _service.DisableAsync(ctx.Guild.Id, nType);
|
||||||
|
|
|
@ -146,7 +146,6 @@ public sealed class NotifyService : IReadyExecutor, INotifySubscriber, IEService
|
||||||
|
|
||||||
await _mss.Response(channel)
|
await _mss.Response(channel)
|
||||||
.Text(st)
|
.Text(st)
|
||||||
.Sanitize(false)
|
|
||||||
.SendAsync();
|
.SendAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ public sealed class CheckForUpdatesService : IEService, IReadyExecutor
|
||||||
private readonly IMessageSenderService _sender;
|
private readonly IMessageSenderService _sender;
|
||||||
|
|
||||||
|
|
||||||
private const string RELEASES_URL = "https://toastielab.dev/api/v1/repos/EllieBotDevs/elliebot/releases";
|
private const string RELEASES_URL = "https://toastielab.dev/api/v1/repos/Emotions-stuff/elliebot/releases";
|
||||||
|
|
||||||
public CheckForUpdatesService(
|
public CheckForUpdatesService(
|
||||||
BotConfigService bcs,
|
BotConfigService bcs,
|
||||||
|
@ -72,7 +72,7 @@ public sealed class CheckForUpdatesService : IEService, IReadyExecutor
|
||||||
UpdateLastKnownVersion(latestVersion);
|
UpdateLastKnownVersion(latestVersion);
|
||||||
|
|
||||||
// pull changelog
|
// pull changelog
|
||||||
var changelog = await http.GetStringAsync("https://toastielab.dev/EllieBotDevs/elliebot/raw/branch/v5/CHANGELOG.md");
|
var changelog = await http.GetStringAsync("https://toastielab.dev/Emotions-stuff/elliebot/raw/branch/v5/CHANGELOG.md");
|
||||||
|
|
||||||
var thisVersionChangelog = GetVersionChangelog(latestVersion, changelog);
|
var thisVersionChangelog = GetVersionChangelog(latestVersion, changelog);
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ public sealed class CheckForUpdatesService : IEService, IReadyExecutor
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithAuthor($"EllieBot v{latest} Released!")
|
.WithAuthor($"EllieBot v{latest} Released!")
|
||||||
.WithTitle("Changelog")
|
.WithTitle("Changelog")
|
||||||
.WithUrl("https://toastielab.dev/EllieBotDevs/elliebot/src/branch/v5/CHANGELOG.md")
|
.WithUrl("https://toastielab.dev/Emotions-stuff/elliebot/src/branch/v5/CHANGELOG.md")
|
||||||
.WithDescription(thisVersionChangelog.TrimTo(4096))
|
.WithDescription(thisVersionChangelog.TrimTo(4096))
|
||||||
.WithFooter(
|
.WithFooter(
|
||||||
"You may disable these messages by typing '.conf bot checkforupdates false'");
|
"You may disable these messages by typing '.conf bot checkforupdates false'");
|
||||||
|
|
|
@ -59,15 +59,10 @@ public class SelfAssignedRolesService : IEService, IReadyExecutor
|
||||||
},
|
},
|
||||||
_ => new()
|
_ => new()
|
||||||
{
|
{
|
||||||
SarGroupId = ctx.GetTable<SarGroup>()
|
|
||||||
.Where(x => x.GuildId == guildId && x.GroupNumber == groupNumber)
|
|
||||||
.Select(x => x.Id)
|
|
||||||
.First()
|
|
||||||
},
|
},
|
||||||
() => new()
|
() => new()
|
||||||
{
|
{
|
||||||
RoleId = roleId,
|
RoleId = roleId,
|
||||||
GuildId = guildId,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,12 +280,8 @@ public sealed class SarAssignerService : IEService, IReadyExecutor
|
||||||
|
|
||||||
if (item.Group.IsExclusive)
|
if (item.Group.IsExclusive)
|
||||||
{
|
{
|
||||||
var rolesToRemove = item.Group.Roles
|
var rolesToRemove = item.Group.Roles.Select(x => x.RoleId);
|
||||||
.Where(x => item.User.RoleIds.Contains(x.RoleId))
|
await item.User.RemoveRolesAsync(rolesToRemove);
|
||||||
.Select(x => x.RoleId)
|
|
||||||
.ToArray();
|
|
||||||
if (rolesToRemove.Length > 0)
|
|
||||||
await item.User.RemoveRolesAsync(rolesToRemove);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await item.User.AddRoleAsync(item.RoleId);
|
await item.User.AddRoleAsync(item.RoleId);
|
||||||
|
|
Loading…
Reference in a new issue