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,9 +56,16 @@ namespace ChaosBot.Discord.Services
|
|||||||
int argPos = 0;
|
int argPos = 0;
|
||||||
|
|
||||||
string prefix = ConfigurationRepository.GetValue<string>("Discord:Prefix", context.Guild.Id, "!");
|
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;
|
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);
|
await _commands.ExecuteAsync(context, argPos, _services);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user