@@ -465,9 +465,9 @@ async def add_exp(self, user_id):
465
465
if t < level_cooldown [f'{ user_id } ' ]:
466
466
return self .bot .db ['exp' ][f'{ user_id } ' ]['experience' ], self .bot .db ['exp' ][f'{ user_id } ' ]['progress' ] >= 1
467
467
else :
468
- level_cooldown [f'{ user_id } ' ] = round (time .time ()) + 30
468
+ level_cooldown [f'{ user_id } ' ] = round (time .time ()) + self . bot . config [ 'exp_cooldown' ]
469
469
else :
470
- level_cooldown .update ({f'{ user_id } ' : round (time .time ()) + 30 })
470
+ level_cooldown .update ({f'{ user_id } ' : round (time .time ()) + self . bot . config [ 'exp_cooldown' ] })
471
471
self .bot .db ['exp' ][f'{ user_id } ' ]['experience' ] += random .randint (80 ,120 )
472
472
ratio , remaining = await self .progression (user_id )
473
473
if ratio >= 1 :
@@ -2677,6 +2677,8 @@ async def serverstatus(self,ctx):
2677
2677
2678
2678
@commands .command (aliases = ['exp' ,'lvl' ,'experience' ], description = 'Shows you or someone else\' s level and EXP.' )
2679
2679
async def level (self ,ctx ,* ,user = None ):
2680
+ if not self .bot .config ['enable_exp' ]:
2681
+ return await ctx .send ('Leveling system is disabled on this instance.' )
2680
2682
if not user :
2681
2683
user = ctx .author
2682
2684
else :
@@ -2710,6 +2712,8 @@ async def level(self,ctx,*,user=None):
2710
2712
2711
2713
@commands .command (aliases = ['lb' ],description = 'Shows EXP leaderboard.' )
2712
2714
async def leaderboard (self ,ctx ):
2715
+ if not self .bot .config ['enable_exp' ]:
2716
+ return await ctx .send ('Leveling system is disabled on this instance.' )
2713
2717
expdata = copy .copy (self .bot .db ['exp' ])
2714
2718
lb_data = await self .bot .loop .run_in_executor (None , lambda : sorted (
2715
2719
expdata .items (),
@@ -3734,7 +3738,7 @@ async def on_message(self, message):
3734
3738
text = text + f'\n { msgid } '
3735
3739
await message .channel .send ('Mismatch detected.' + text )
3736
3740
3737
- if not message .author .bot :
3741
+ if not message .author .bot and self . bot . config [ 'enable_exp' ] :
3738
3742
_newexp , levelup = await self .bot .bridge .add_exp (message .author .id )
3739
3743
3740
3744
if levelup :
0 commit comments