Added .exds to complement .exas

This commit is contained in:
Kwoth
2022-09-09 21:02:16 +02:00
parent f1c7d7437a
commit 8107a80c4c
4 changed files with 35 additions and 10 deletions

View File

@@ -2,6 +2,12 @@
Experimental changelog. Mostly based on [keepachangelog](https://keepachangelog.com/en/1.0.0/) except date format. a-c-f-r-o
## Unreleased
### Added
- Added `.exprdelserv` (.exds) to completement .exas. Deletes an expression on the current server and is susceptible to .dpo, unlike .exd
## [4.3.6] - 08.09.2022
### Added

View File

@@ -160,15 +160,8 @@ public partial class NadekoExpressions : NadekoModule<NadekoExpressionsService>
found.Response.TrimTo(1000).Replace("](", "]\\(")));
}
[Cmd]
public async Task ExprDelete(kwum id)
public async Task ExprDeleteInternalAsync(kwum id)
{
if (!AdminInGuildOrOwnerInDm())
{
await ReplyErrorLocalizedAsync(strs.expr_insuff_perms);
return;
}
var ex = await _service.DeleteAsync(ctx.Guild?.Id, id);
if (ex is not null)
@@ -186,6 +179,24 @@ public partial class NadekoExpressions : NadekoModule<NadekoExpressionsService>
}
}
[Cmd]
[UserPerm(GuildPerm.Administrator)]
[RequireContext(ContextType.Guild)]
public async Task ExprDeleteServer(kwum id)
=> await ExprDeleteInternalAsync(id);
[Cmd]
public async Task ExprDelete(kwum id)
{
if (!AdminInGuildOrOwnerInDm())
{
await ReplyErrorLocalizedAsync(strs.expr_insuff_perms);
return;
}
await ExprDeleteInternalAsync(id);
}
[Cmd]
public async Task ExprReact(kwum id, params string[] emojiStrs)
{

View File

@@ -1309,6 +1309,10 @@ exprdelete:
- exd
- exdel
- dcr
exprdeleteserver:
- exprdelserv
- exds
- exdelserv
exprclear:
- exprclear
- exc

View File

@@ -217,13 +217,17 @@ exprlist:
- "1"
- "all"
exprshow:
desc: "Shows a expression's response on a given ID."
desc: "Shows an expression's response on a given ID."
args:
- "1"
exprdelete:
desc: "Deletes a expression on a specific index. If ran in DM, it is bot owner only and deletes a global expression. If ran in a server, it requires Administration privileges and removes server expression."
desc: "Deletes an expression on a specific index. If ran in DM, it is bot owner only and deletes a global expression. If ran in a server, it requires Administration privileges and removes server expression."
args:
- "5"
exprdeleteserver:
desc: "Deletes an expression on a specific index on this server."
args:
- "5c"
exprclear:
desc: "Deletes all expression on this server."
args: