Added possibility of target
This commit is contained in:
parent
5225c6fc88
commit
0d8571509e
@ -119,10 +119,17 @@ namespace NadekoBot.Modules.Conversations
|
|||||||
{
|
{
|
||||||
var c = cgb.CreateCommand(command.Key);
|
var c = cgb.CreateCommand(command.Key);
|
||||||
c.Description($"Custom reaction.\n**Usage**:{command.Key}");
|
c.Description($"Custom reaction.\n**Usage**:{command.Key}");
|
||||||
|
c.Parameter("args", ParameterType.Unparsed);
|
||||||
c.Do(async e =>
|
c.Do(async e =>
|
||||||
{
|
{
|
||||||
var str = command.Value;
|
var str = command.Value;
|
||||||
str = str.Replace("%user%", e.User.Mention);
|
str = str.Replace("%user%", e.User.Mention);
|
||||||
|
if (str.Contains("%target%"))
|
||||||
|
{
|
||||||
|
var args = e.GetArg("args");
|
||||||
|
if (string.IsNullOrWhiteSpace(args)) args = string.Empty;
|
||||||
|
str = str.Replace("%target%", e.GetArg("args"));
|
||||||
|
}
|
||||||
await e.Channel.SendMessage(str);
|
await e.Channel.SendMessage(str);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user