Linking Experience Handler into the code, Also checking IF they they have config enabled for commands to count towards Experience
This commit is contained in:
parent
0ebcfdb605
commit
0058a68e48
@ -56,8 +56,15 @@ namespace ChaosBot.Discord.Services
|
||||
int argPos = 0;
|
||||
|
||||
string prefix = ConfigurationRepository.GetValue<string>("Discord:Prefix", context.Guild.Id, "!");
|
||||
if (!(message.HasMentionPrefix(_client.CurrentUser, ref argPos) || message.HasStringPrefix(prefix, ref argPos)))
|
||||
if (!(message.HasMentionPrefix(_client.CurrentUser, ref argPos) ||
|
||||
message.HasStringPrefix(prefix, ref argPos)))
|
||||
{
|
||||
ExperienceHandler.addXP(context.Guild.Id, context.User.Id);
|
||||
return;
|
||||
}
|
||||
|
||||
if(Convert.ToBoolean(ConfigurationRepository.GetValue<string>("Experience:Commands", context.Guild.Id, "false")))
|
||||
ExperienceHandler.addXP(context.Guild.Id, context.User.Id);
|
||||
|
||||
await _commands.ExecuteAsync(context, argPos, _services);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user