mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
You can now target a different channel with .repeat, for example: .repeat #some-other-channel 15m Quick reminder
This commit is contained in:
@@ -16,6 +16,7 @@ Experimental changelog. Mostly based on [keepachangelog](https://keepachangelog.
|
|||||||
- `.ga list` lists active giveaways on the current server
|
- `.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.
|
- `.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.
|
||||||
- After the giveaway has started, user join the giveaway by adding a :tada: reaction
|
- After the giveaway has started, user join the giveaway by adding a :tada: reaction
|
||||||
|
- You can now target a different channel with .repeat, for example `.repeat #some-other 1h Hello every hour`
|
||||||
|
|
||||||
## [4.3.22] - 23.04.2023
|
## [4.3.22] - 23.04.2023
|
||||||
|
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using NadekoBot.Common.TypeReaders;
|
using LinqToDB.Common;
|
||||||
|
using NadekoBot.Common.TypeReaders;
|
||||||
using NadekoBot.Common.TypeReaders.Models;
|
using NadekoBot.Common.TypeReaders.Models;
|
||||||
using NadekoBot.Modules.Utility.Services;
|
using NadekoBot.Modules.Utility.Services;
|
||||||
|
|
||||||
@@ -95,16 +96,30 @@ public partial class Utility
|
|||||||
[Cmd]
|
[Cmd]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[UserPerm(GuildPerm.ManageMessages)]
|
[UserPerm(GuildPerm.ManageMessages)]
|
||||||
[Priority(-1)]
|
[Priority(-2)]
|
||||||
public Task Repeat([Leftover] string message)
|
public Task Repeat([Leftover] string message)
|
||||||
=> Repeat(null, null, message);
|
=> Repeat(ctx.Channel, null, null, message);
|
||||||
|
|
||||||
|
[Cmd]
|
||||||
|
[RequireContext(ContextType.Guild)]
|
||||||
|
[UserPerm(GuildPerm.ManageMessages)]
|
||||||
|
[Priority(-1)]
|
||||||
|
public Task Repeat(ITextChannel channel, [Leftover] string message)
|
||||||
|
=> Repeat(channel, null, null, message);
|
||||||
|
|
||||||
[Cmd]
|
[Cmd]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[UserPerm(GuildPerm.ManageMessages)]
|
[UserPerm(GuildPerm.ManageMessages)]
|
||||||
[Priority(0)]
|
[Priority(0)]
|
||||||
public Task Repeat(StoopidTime interval, [Leftover] string message)
|
public Task Repeat(StoopidTime interval, [Leftover] string message)
|
||||||
=> Repeat(null, interval, message);
|
=> Repeat(ctx.Channel, null, interval, message);
|
||||||
|
|
||||||
|
[Cmd]
|
||||||
|
[RequireContext(ContextType.Guild)]
|
||||||
|
[UserPerm(GuildPerm.ManageMessages)]
|
||||||
|
[Priority(0)]
|
||||||
|
public Task Repeat(ITextChannel ch, StoopidTime interval, [Leftover] string message)
|
||||||
|
=> Repeat(ch, null, interval, message);
|
||||||
|
|
||||||
[Cmd]
|
[Cmd]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
@@ -113,12 +128,34 @@ public partial class Utility
|
|||||||
public Task Repeat(GuildDateTime dt, [Leftover] string message)
|
public Task Repeat(GuildDateTime dt, [Leftover] string message)
|
||||||
=> Repeat(dt, null, message);
|
=> Repeat(dt, null, message);
|
||||||
|
|
||||||
|
[Cmd]
|
||||||
|
[RequireContext(ContextType.Guild)]
|
||||||
|
[UserPerm(GuildPerm.ManageMessages)]
|
||||||
|
[Priority(1)]
|
||||||
|
public Task Repeat(ITextChannel channel, GuildDateTime dt, [Leftover] string message)
|
||||||
|
=> Repeat(channel, dt, null, message);
|
||||||
|
|
||||||
[Cmd]
|
[Cmd]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[UserPerm(GuildPerm.ManageMessages)]
|
[UserPerm(GuildPerm.ManageMessages)]
|
||||||
[Priority(2)]
|
[Priority(2)]
|
||||||
public async Task Repeat(GuildDateTime? dt, StoopidTime? interval, [Leftover] string message)
|
public Task Repeat(GuildDateTime? dt, StoopidTime? interval, [Leftover] string message)
|
||||||
|
=> Repeat(ctx.Channel, dt, interval, message);
|
||||||
|
|
||||||
|
[Cmd]
|
||||||
|
[RequireContext(ContextType.Guild)]
|
||||||
|
[UserPerm(GuildPerm.ManageMessages)]
|
||||||
|
[Priority(3)]
|
||||||
|
public async Task Repeat(IMessageChannel channel, GuildDateTime? dt, StoopidTime? interval,
|
||||||
|
[Leftover] string message)
|
||||||
{
|
{
|
||||||
|
if (channel is not ITextChannel txtCh || txtCh.GuildId != ctx.Guild.Id)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var perms = ((IGuildUser)ctx.User).GetPermissions(txtCh);
|
||||||
|
if (!perms.SendMessages)
|
||||||
|
return;
|
||||||
|
|
||||||
var startTimeOfDay = dt?.InputTimeUtc.TimeOfDay;
|
var startTimeOfDay = dt?.InputTimeUtc.TimeOfDay;
|
||||||
// if interval not null, that means user specified it (don't change it)
|
// if interval not null, that means user specified it (don't change it)
|
||||||
|
|
||||||
@@ -137,7 +174,7 @@ public partial class Utility
|
|||||||
? message
|
? message
|
||||||
: message.SanitizeMentions(true);
|
: message.SanitizeMentions(true);
|
||||||
|
|
||||||
var runner = await _service.AddRepeaterAsync(ctx.Channel.Id,
|
var runner = await _service.AddRepeaterAsync(channel.Id,
|
||||||
ctx.Guild.Id,
|
ctx.Guild.Id,
|
||||||
realInterval,
|
realInterval,
|
||||||
message,
|
message,
|
||||||
|
Reference in New Issue
Block a user