mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
Added .todo show, Renamed ReactionRole* commands to rero*
This commit is contained in:
@@ -22,6 +22,7 @@ Experimental changelog. Mostly based on [keepachangelog](https://keepachangelog.
|
|||||||
- `.todo done <id>` - completes a todo (marks it with a checkmark)
|
- `.todo done <id>` - completes a todo (marks it with a checkmark)
|
||||||
- `.todo list` - lists all todos
|
- `.todo list` - lists all todos
|
||||||
- `.todo edit <id> <new message>` - edits a todo item message
|
- `.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
|
- 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 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 list` - lists all your archived todo lists
|
||||||
@@ -38,8 +39,7 @@ Experimental changelog. Mostly based on [keepachangelog](https://keepachangelog.
|
|||||||
|
|
||||||
- Users who have manage messages perm in the channel will now be excluded from link and invite filtering (`.sfi` and `.sfl`)
|
- Users who have manage messages perm in the channel will now be excluded from link and invite filtering (`.sfi` and `.sfl`)
|
||||||
- You can now target a different channel with .repeat, for example `.repeat #some-other 1h Hello every hour`
|
- You can now target a different channel with .repeat, for example `.repeat #some-other 1h Hello every hour`
|
||||||
- `.cmds <module name>` looks better / simpler
|
- `.cmds <module name>`, `.cmds <group name` and `.mdls` looks better / cleaner / simpler
|
||||||
- Cleanup: Removed a lot of obsolete aliases.
|
|
||||||
- The bot will now send a discord Reply to every command
|
- The bot will now send a discord Reply to every command
|
||||||
- A lot of code cleanup (still a lot to be done) and Quality of Life improvements
|
- A lot of code cleanup (still a lot to be done) and Quality of Life improvements
|
||||||
|
|
||||||
@@ -51,10 +51,11 @@ Experimental changelog. Mostly based on [keepachangelog](https://keepachangelog.
|
|||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
- `.poll` commands removed, discord added polls.
|
- `.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
|
- `.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 a lot of useless and nsfw commands
|
||||||
- Removed log voice presence TTS
|
- Removed log voice presence TTS
|
||||||
|
- Cleanup: Removed a lot of obsolete aliases from aliases.yml
|
||||||
|
|
||||||
## [4.3.22] - 23.04.2023
|
## [4.3.22] - 23.04.2023
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@ public partial class Administration
|
|||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[UserPerm(GuildPerm.ManageRoles)]
|
[UserPerm(GuildPerm.ManageRoles)]
|
||||||
[BotPerm(GuildPerm.ManageRoles)]
|
[BotPerm(GuildPerm.ManageRoles)]
|
||||||
public async Task ReactionRoleAdd(
|
public async Task ReRoAdd(
|
||||||
ulong messageId,
|
ulong messageId,
|
||||||
string emoteStr,
|
string emoteStr,
|
||||||
IRole role,
|
IRole role,
|
||||||
@@ -68,7 +68,7 @@ public partial class Administration
|
|||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[UserPerm(GuildPerm.ManageRoles)]
|
[UserPerm(GuildPerm.ManageRoles)]
|
||||||
[BotPerm(GuildPerm.ManageRoles)]
|
[BotPerm(GuildPerm.ManageRoles)]
|
||||||
public async Task ReactionRolesList(int page = 1)
|
public async Task ReRoList(int page = 1)
|
||||||
{
|
{
|
||||||
if (--page < 0)
|
if (--page < 0)
|
||||||
return;
|
return;
|
||||||
@@ -124,7 +124,7 @@ public partial class Administration
|
|||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[UserPerm(GuildPerm.ManageRoles)]
|
[UserPerm(GuildPerm.ManageRoles)]
|
||||||
[BotPerm(GuildPerm.ManageRoles)]
|
[BotPerm(GuildPerm.ManageRoles)]
|
||||||
public async Task ReactionRolesRemove(ulong messageId)
|
public async Task ReRoRemove(ulong messageId)
|
||||||
{
|
{
|
||||||
var succ = await _rero.RemoveReactionRoles(ctx.Guild.Id, messageId);
|
var succ = await _rero.RemoveReactionRoles(ctx.Guild.Id, messageId);
|
||||||
if (succ)
|
if (succ)
|
||||||
@@ -137,7 +137,7 @@ public partial class Administration
|
|||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[UserPerm(GuildPerm.ManageRoles)]
|
[UserPerm(GuildPerm.ManageRoles)]
|
||||||
[BotPerm(GuildPerm.ManageRoles)]
|
[BotPerm(GuildPerm.ManageRoles)]
|
||||||
public async Task ReactionRolesDeleteAll()
|
public async Task ReRoDeleteAll()
|
||||||
{
|
{
|
||||||
await _rero.RemoveAllReactionRoles(ctx.Guild.Id);
|
await _rero.RemoveAllReactionRoles(ctx.Guild.Id);
|
||||||
await ctx.OkAsync();
|
await ctx.OkAsync();
|
||||||
@@ -148,7 +148,7 @@ public partial class Administration
|
|||||||
[UserPerm(GuildPerm.ManageRoles)]
|
[UserPerm(GuildPerm.ManageRoles)]
|
||||||
[BotPerm(GuildPerm.ManageRoles)]
|
[BotPerm(GuildPerm.ManageRoles)]
|
||||||
[Ratelimit(60)]
|
[Ratelimit(60)]
|
||||||
public async Task ReactionRolesTransfer(ulong fromMessageId, ulong toMessageId)
|
public async Task ReRoTransfer(ulong fromMessageId, ulong toMessageId)
|
||||||
{
|
{
|
||||||
var msg = await ctx.Channel.GetMessageAsync(toMessageId);
|
var msg = await ctx.Channel.GetMessageAsync(toMessageId);
|
||||||
|
|
||||||
|
@@ -283,14 +283,13 @@ public sealed class Help : NadekoModule<HelpService>
|
|||||||
//if cross is specified, and the command doesn't satisfy the requirements, cross it out
|
//if cross is specified, and the command doesn't satisfy the requirements, cross it out
|
||||||
if (opts.View == CommandsOptions.ViewType.Cross)
|
if (opts.View == CommandsOptions.ViewType.Cross)
|
||||||
{
|
{
|
||||||
return
|
return $"{(succ.Contains(x) ? "✅" : "❌")} {prefix + x.Aliases[0]}";
|
||||||
$"{(succ.Contains(x) ? "✅" : "❌")} {prefix + x.Aliases[0]}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x.Aliases.Count == 1)
|
if (x.Aliases.Count == 1)
|
||||||
return prefix + x.Aliases[0];
|
return prefix + x.Aliases[0];
|
||||||
|
|
||||||
return prefix + x.Aliases[0] + " / " + prefix + x.Aliases[1];
|
return prefix + x.Aliases[0] + " | " + prefix + x.Aliases[1];
|
||||||
});
|
});
|
||||||
|
|
||||||
embed.AddField(g.ElementAt(i).Key, "" + string.Join("\n", transformed) + "", true);
|
embed.AddField(g.ElementAt(i).Key, "" + string.Join("\n", transformed) + "", true);
|
||||||
@@ -304,12 +303,18 @@ public sealed class Help : NadekoModule<HelpService>
|
|||||||
private async Task Group(ModuleInfo group)
|
private async Task Group(ModuleInfo group)
|
||||||
{
|
{
|
||||||
var eb = _sender.CreateEmbed()
|
var eb = _sender.CreateEmbed()
|
||||||
.WithTitle(GetText(strs.cmd_group_commands(group.Name)))
|
.WithTitle(GetText(strs.cmd_group_commands(group.Name)))
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
|
|
||||||
foreach (var cmd in group.Commands.DistinctBy(x => x.Aliases[0]))
|
foreach (var cmd in group.Commands.DistinctBy(x => x.Aliases[0]))
|
||||||
{
|
{
|
||||||
eb.AddField(prefix + cmd.Aliases.First(), cmd.RealSummary(_strings, _medusae, Culture, prefix));
|
string cmdName;
|
||||||
|
if (cmd.Aliases.Count > 1)
|
||||||
|
cmdName = Format.Code(prefix +cmd.Aliases[0]) + " | " + Format.Code(prefix + cmd.Aliases[1]);
|
||||||
|
else
|
||||||
|
cmdName = Format.Code(prefix + cmd.Aliases.First());
|
||||||
|
|
||||||
|
eb.AddField(cmdName, cmd.RealSummary(_strings, _medusae, Culture, prefix));
|
||||||
}
|
}
|
||||||
|
|
||||||
await Response().Embed(eb).SendAsync();
|
await Response().Embed(eb).SendAsync();
|
||||||
@@ -536,8 +541,8 @@ public sealed class Help : NadekoModule<HelpService>
|
|||||||
SelfhostAction));
|
SelfhostAction));
|
||||||
|
|
||||||
var eb = _sender.CreateEmbed()
|
var eb = _sender.CreateEmbed()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithTitle("Thank you for considering to donate to the NadekoBot project!");
|
.WithTitle("Thank you for considering to donate to the NadekoBot project!");
|
||||||
|
|
||||||
eb
|
eb
|
||||||
.WithDescription("NadekoBot relies on donations to keep the servers, services and APIs running.\n"
|
.WithDescription("NadekoBot relies on donations to keep the servers, services and APIs running.\n"
|
||||||
|
@@ -66,6 +66,22 @@ public partial class Utility
|
|||||||
.SendAsync();
|
.SendAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Cmd]
|
||||||
|
public async Task TodoShow(kwum todoId)
|
||||||
|
{
|
||||||
|
var todo = await _service.GetTodoAsync(ctx.User.Id, todoId);
|
||||||
|
|
||||||
|
if (todo is null)
|
||||||
|
{
|
||||||
|
await Response().Error(strs.todo_not_found).SendAsync();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await Response()
|
||||||
|
.Confirm($"`{new kwum(todo.Id)}` {todo.Todo}")
|
||||||
|
.SendAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[Cmd]
|
[Cmd]
|
||||||
public async Task TodoComplete(kwum todoId)
|
public async Task TodoComplete(kwum todoId)
|
||||||
@@ -105,7 +121,7 @@ public partial class Utility
|
|||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
foreach (var todo in todos)
|
foreach (var todo in todos)
|
||||||
{
|
{
|
||||||
sb.AppendLine($"{(todo.IsDone ? "✔" : "□")} {Format.Code(new kwum(todo.Id).ToString())} {todo.Todo}");
|
sb.AppendLine(InternalItemShow(todo));
|
||||||
|
|
||||||
sb.AppendLine("---");
|
sb.AppendLine("---");
|
||||||
}
|
}
|
||||||
@@ -113,6 +129,9 @@ public partial class Utility
|
|||||||
eb.WithDescription(sb.ToString());
|
eb.WithDescription(sb.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string InternalItemShow(TodoModel todo)
|
||||||
|
=> $"{(todo.IsDone ? "✔" : "□")} {Format.Code(new kwum(todo.Id).ToString())} {todo.Todo}";
|
||||||
|
|
||||||
[Group("archive")]
|
[Group("archive")]
|
||||||
public partial class ArchiveCommands : NadekoModule<TodoService>
|
public partial class ArchiveCommands : NadekoModule<TodoService>
|
||||||
{
|
{
|
||||||
|
@@ -179,4 +179,14 @@ public sealed class TodoService
|
|||||||
|
|
||||||
return count > 0;
|
return count > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<TodoModel?> GetTodoAsync(ulong userId, int todoId)
|
||||||
|
{
|
||||||
|
await using var ctx = _db.GetDbContext();
|
||||||
|
|
||||||
|
return await ctx
|
||||||
|
.GetTable<TodoModel>()
|
||||||
|
.Where(x => x.UserId == userId && x.Id == todoId)
|
||||||
|
.FirstOrDefaultAsyncLinqToDB();
|
||||||
|
}
|
||||||
}
|
}
|
@@ -664,11 +664,17 @@ public partial class Utility : NadekoModule
|
|||||||
.WithReferences(this.GetType().Assembly)
|
.WithReferences(this.GetType().Assembly)
|
||||||
.WithImports(
|
.WithImports(
|
||||||
"System",
|
"System",
|
||||||
|
"System.Collections.Generic",
|
||||||
|
"System.IO",
|
||||||
"System.Linq",
|
"System.Linq",
|
||||||
|
"System.Net.Http",
|
||||||
|
"System.Threading",
|
||||||
|
"System.Threading.Tasks",
|
||||||
"NadekoBot",
|
"NadekoBot",
|
||||||
"NadekoBot.Extensions",
|
"NadekoBot.Extensions",
|
||||||
"Microsoft.Extensions.DependencyInjection",
|
"Microsoft.Extensions.DependencyInjection",
|
||||||
"NadekoBot.Common",
|
"NadekoBot.Common",
|
||||||
|
"NadekoBot.Modules",
|
||||||
"System.Text",
|
"System.Text",
|
||||||
"System.Text.Json"),
|
"System.Text.Json"),
|
||||||
globalsType: typeof(EvalGlobals));
|
globalsType: typeof(EvalGlobals));
|
||||||
|
@@ -17,7 +17,7 @@ public static class CommandNameLoadHelper
|
|||||||
|
|
||||||
public static string[] GetAliasesFor(string methodName)
|
public static string[] GetAliasesFor(string methodName)
|
||||||
=> _lazyCommandAliases.Value.TryGetValue(methodName.ToLowerInvariant(), out var aliases) && aliases.Length > 1
|
=> _lazyCommandAliases.Value.TryGetValue(methodName.ToLowerInvariant(), out var aliases) && aliases.Length > 1
|
||||||
? aliases.Skip(1).ToArray()
|
? aliases.ToArray()
|
||||||
: Array.Empty<string>();
|
: Array.Empty<string>();
|
||||||
|
|
||||||
public static string GetCommandNameFor(string methodName)
|
public static string GetCommandNameFor(string methodName)
|
||||||
|
@@ -35,7 +35,7 @@ public sealed class CommandsUtilityService : ICommandsUtilityService, INService
|
|||||||
var str = $"**`{prefix + com.Aliases.First()}`**";
|
var str = $"**`{prefix + com.Aliases.First()}`**";
|
||||||
var alias = com.Aliases.Skip(1).FirstOrDefault();
|
var alias = com.Aliases.Skip(1).FirstOrDefault();
|
||||||
if (alias is not null)
|
if (alias is not null)
|
||||||
str += $" **/ `{prefix + alias}`**";
|
str += $" **| `{prefix + alias}`**";
|
||||||
|
|
||||||
var culture = _loc.GetCultureInfo(guild);
|
var culture = _loc.GetCultureInfo(guild);
|
||||||
|
|
||||||
|
@@ -1160,19 +1160,19 @@ pathofexilecurrency:
|
|||||||
- poec
|
- poec
|
||||||
rollduel:
|
rollduel:
|
||||||
- rollduel
|
- rollduel
|
||||||
reactionroleadd:
|
reroadd:
|
||||||
- reactionroleadd
|
- reroadd
|
||||||
- reroa
|
- reroa
|
||||||
reactionroleslist:
|
rerolist:
|
||||||
- reactionroleslist
|
- rerolist
|
||||||
- reroli
|
- reroli
|
||||||
reactionrolesremove:
|
reroremove:
|
||||||
- reactionrolesremove
|
- reroremove
|
||||||
- rerorm
|
- rerorm
|
||||||
reactionrolesdeleteall:
|
rerodeleteall:
|
||||||
- rerodeleteall
|
- rerodeleteall
|
||||||
- rerodela
|
- rerodela
|
||||||
reactionrolestransfer:
|
rerotransfer:
|
||||||
- rerotransfer
|
- rerotransfer
|
||||||
- rerot
|
- rerot
|
||||||
blackjack:
|
blackjack:
|
||||||
@@ -1387,5 +1387,9 @@ todoarchivedelete:
|
|||||||
todoedit:
|
todoedit:
|
||||||
- edit
|
- edit
|
||||||
- change
|
- change
|
||||||
|
todoshow:
|
||||||
|
- show
|
||||||
|
- sh
|
||||||
|
- see
|
||||||
stickyroles:
|
stickyroles:
|
||||||
- stickyroles
|
- stickyroles
|
||||||
|
@@ -2067,7 +2067,7 @@ rollduel:
|
|||||||
args:
|
args:
|
||||||
- "50 @Someone"
|
- "50 @Someone"
|
||||||
- "@Challenger"
|
- "@Challenger"
|
||||||
reactionroleadd:
|
reroadd:
|
||||||
desc: |-
|
desc: |-
|
||||||
Specify a message id, emote and a role name to have the bot assign the specified role to the user who reacts to the specified message (in this channel) with the specified emoji.
|
Specify a message id, emote and a role name to have the bot assign the specified role to the user who reacts to the specified message (in this channel) with the specified emoji.
|
||||||
You can optionally specify an exclusivity group. Default is group 0 which is non-exclusive. Other groups are exclusive. Exclusive groups will let the user only have one of the roles specified in that group.
|
You can optionally specify an exclusivity group. Default is group 0 which is non-exclusive. Other groups are exclusive. Exclusive groups will let the user only have one of the roles specified in that group.
|
||||||
@@ -2078,19 +2078,19 @@ reactionroleadd:
|
|||||||
- 971276352684691466 😢 emo 1
|
- 971276352684691466 😢 emo 1
|
||||||
- 971276352684691466 🤔 philosopher 5 20
|
- 971276352684691466 🤔 philosopher 5 20
|
||||||
- 971276352684691466 👨 normie 5 20
|
- 971276352684691466 👨 normie 5 20
|
||||||
reactionroleslist:
|
rerolist:
|
||||||
desc: "Lists all ReactionRole messages on this server with their message ids. Clicking/Tapping message ids will send you to that message."
|
desc: "Lists all ReactionRole messages on this server with their message ids. Clicking/Tapping message ids will send you to that message."
|
||||||
args:
|
args:
|
||||||
- ""
|
- ""
|
||||||
reactionrolesremove:
|
reroremove:
|
||||||
desc: "Remove all reaction roles from message specified by the id"
|
desc: "Remove all reaction roles from message specified by the id"
|
||||||
args:
|
args:
|
||||||
- "971276352684691466"
|
- "971276352684691466"
|
||||||
reactionrolesdeleteall:
|
rerodeleteall:
|
||||||
desc: "Deletes all reaction roles on the server. This action is irreversible."
|
desc: "Deletes all reaction roles on the server. This action is irreversible."
|
||||||
args:
|
args:
|
||||||
- ""
|
- ""
|
||||||
reactionrolestransfer:
|
rerotransfer:
|
||||||
desc: "Transfers reaction roles from one message to another by specifying their ids. If the target message has reaction roles specified already, the reaction roles will be MERGED, not overwritten."
|
desc: "Transfers reaction roles from one message to another by specifying their ids. If the target message has reaction roles specified already, the reaction roles will be MERGED, not overwritten."
|
||||||
args:
|
args:
|
||||||
- "971276352684691466 971427748448964628"
|
- "971276352684691466 971427748448964628"
|
||||||
@@ -2371,6 +2371,10 @@ todoarchiveshow:
|
|||||||
desc: "Shows the archived todo list with the specified ID."
|
desc: "Shows the archived todo list with the specified ID."
|
||||||
args:
|
args:
|
||||||
- "3c"
|
- "3c"
|
||||||
|
todoshow:
|
||||||
|
desc: "Shows the text of the todo with the specified ID."
|
||||||
|
args:
|
||||||
|
- "4a"
|
||||||
todoarchivedelete:
|
todoarchivedelete:
|
||||||
desc: "Deletes the archived todo list with the specified ID."
|
desc: "Deletes the archived todo list with the specified ID."
|
||||||
args:
|
args:
|
||||||
|
Reference in New Issue
Block a user