Merged projects with plugins and modules
This commit is contained in:
@@ -7,42 +7,42 @@ namespace DiscordBotCore.Others;
|
||||
public class DbCommandExecutingArguments
|
||||
{
|
||||
|
||||
public SocketCommandContext context { get; init; }
|
||||
public string cleanContent { get; init; }
|
||||
public string commandUsed { get; init; }
|
||||
public string[]? arguments { get; init; }
|
||||
public ISocketMessageChannel Channel => context.Channel;
|
||||
public SocketCommandContext Context { get; init; }
|
||||
public string CleanContent { get; init; }
|
||||
public string CommandUsed { get; init; }
|
||||
public string[]? Arguments { get; init; }
|
||||
public ISocketMessageChannel Channel => Context.Channel;
|
||||
|
||||
public DbCommandExecutingArguments(
|
||||
SocketCommandContext context, string cleanContent, string commandUsed, string[]? arguments)
|
||||
{
|
||||
this.context = context;
|
||||
this.cleanContent = cleanContent;
|
||||
this.commandUsed = commandUsed;
|
||||
this.arguments = arguments;
|
||||
this.Context = context;
|
||||
this.CleanContent = cleanContent;
|
||||
this.CommandUsed = commandUsed;
|
||||
this.Arguments = arguments;
|
||||
}
|
||||
|
||||
public DbCommandExecutingArguments(SocketUserMessage? message, DiscordSocketClient client)
|
||||
{
|
||||
context = new SocketCommandContext(client, message);
|
||||
Context = new SocketCommandContext(client, message);
|
||||
var pos = 0;
|
||||
if (message.HasMentionPrefix(client.CurrentUser, ref pos))
|
||||
{
|
||||
var mentionPrefix = "<@" + client.CurrentUser.Id + ">";
|
||||
cleanContent = message.Content.Substring(mentionPrefix.Length + 1);
|
||||
CleanContent = message.Content.Substring(mentionPrefix.Length + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
cleanContent = message.Content.Substring(Application.CurrentApplication.DiscordBotClient.BotPrefix.Length);
|
||||
CleanContent = message.Content.Substring(Application.CurrentApplication.DiscordBotClient.BotPrefix.Length);
|
||||
}
|
||||
|
||||
var split = cleanContent.Split(' ');
|
||||
var split = CleanContent.Split(' ');
|
||||
|
||||
string[]? argsClean = null;
|
||||
if (split.Length > 1)
|
||||
argsClean = string.Join(' ', split, 1, split.Length - 1).Split(' ');
|
||||
|
||||
commandUsed = split[0];
|
||||
arguments = argsClean;
|
||||
CommandUsed = split[0];
|
||||
Arguments = argsClean;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user