Implement disabling the exp module
This commit is contained in:
parent
ff854df99d
commit
d71f4ac3c6
@ -20,6 +20,7 @@ namespace ChaosBot.Discord.Modules.User
|
|||||||
[Command("level")]
|
[Command("level")]
|
||||||
[Alias("xp", "exp", "experience", "lvl")]
|
[Alias("xp", "exp", "experience", "lvl")]
|
||||||
[CheckCommandPerm("User")]
|
[CheckCommandPerm("User")]
|
||||||
|
[CheckModuleEnabled("Experience")]
|
||||||
public async Task XpShowInfo()
|
public async Task XpShowInfo()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using ChaosBot.Discord.PreConditions;
|
||||||
using ChaosBot.Models;
|
using ChaosBot.Models;
|
||||||
using ChaosBot.Repositories;
|
using ChaosBot.Repositories;
|
||||||
using Discord;
|
using Discord;
|
||||||
@ -19,6 +20,8 @@ namespace ChaosBot.Discord.Services
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (!CheckModuleEnabled.GetResult(context, "Experience")) return;
|
||||||
|
|
||||||
using (ChaosbotContext dbContext = new ChaosbotContext())
|
using (ChaosbotContext dbContext = new ChaosbotContext())
|
||||||
{
|
{
|
||||||
IQueryable<Experience> ctxUser = dbContext.ExperiencePoints;
|
IQueryable<Experience> ctxUser = dbContext.ExperiencePoints;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user