@@ -430,7 +430,7 @@ async def activity(self, ctx, activity_type: str.lower, *, message: str = ''):
430
430
self .bot .config ['activity_type' ] = None
431
431
self .bot .config ['activity_message' ] = None
432
432
await self .bot .config .update ()
433
- await self .set_presence (log = False )
433
+ await self .set_presence ()
434
434
embed = Embed (
435
435
title = 'Activity Removed' ,
436
436
color = self .bot .main_color
@@ -440,14 +440,12 @@ async def activity(self, ctx, activity_type: str.lower, *, message: str = ''):
440
440
if not message :
441
441
raise commands .UserInputError
442
442
443
- try :
444
- activity , msg = (await self .set_presence (
443
+ activity , msg = (await self .set_presence (
445
444
activity_identifier = activity_type ,
446
445
activity_by_key = True ,
447
- activity_message = message ,
448
- log = False
449
- ))['activity' ]
450
- except ValueError :
446
+ activity_message = message
447
+ ))['activity' ]
448
+ if activity is None :
451
449
raise commands .UserInputError
452
450
453
451
self .bot .config ['activity_type' ] = activity .type .value
@@ -480,21 +478,19 @@ async def status(self, ctx, *, status_type: str.lower):
480
478
if status_type == 'clear' :
481
479
self .bot .config ['status' ] = None
482
480
await self .bot .config .update ()
483
- await self .set_presence (log = False )
481
+ await self .set_presence ()
484
482
embed = Embed (
485
483
title = 'Status Removed' ,
486
484
color = self .bot .main_color
487
485
)
488
486
return await ctx .send (embed = embed )
489
487
status_type = status_type .replace (' ' , '_' )
490
488
491
- try :
492
- status , msg = (await self .set_presence (
489
+ status , msg = (await self .set_presence (
493
490
status_identifier = status_type ,
494
491
status_by_key = True ,
495
- log = False
496
- ))['status' ]
497
- except ValueError :
492
+ ))['status' ]
493
+ if status is None :
498
494
raise commands .UserInputError
499
495
500
496
self .bot .config ['status' ] = status .value
@@ -512,8 +508,7 @@ async def set_presence(self, *,
512
508
status_by_key = True ,
513
509
activity_identifier = None ,
514
510
activity_by_key = True ,
515
- activity_message = None ,
516
- log = True ):
511
+ activity_message = None ):
517
512
518
513
activity = status = None
519
514
if status_identifier is None :
@@ -528,10 +523,7 @@ async def set_presence(self, *,
528
523
except (KeyError , ValueError ):
529
524
if status_identifier is not None :
530
525
msg = f'Invalid status type: { status_identifier } '
531
- if log :
532
- logger .warning (error (msg ))
533
- else :
534
- raise ValueError (msg )
526
+ logger .warning (error (msg ))
535
527
536
528
if activity_identifier is None :
537
529
if activity_message is not None :
@@ -548,10 +540,7 @@ async def set_presence(self, *,
548
540
except (KeyError , ValueError ):
549
541
if activity_identifier is not None :
550
542
msg = f'Invalid activity type: { activity_identifier } '
551
- if log :
552
- logger .warning (error (msg ))
553
- else :
554
- raise ValueError (msg )
543
+ logger .warning (error (msg ))
555
544
else :
556
545
url = None
557
546
activity_message = (
@@ -575,10 +564,7 @@ async def set_presence(self, *,
575
564
url = url )
576
565
else :
577
566
msg = 'You must supply an activity message to use custom activity.'
578
- if log :
579
- logger .warning (error (msg ))
580
- else :
581
- raise ValueError (msg )
567
+ logger .warning (error (msg ))
582
568
583
569
await self .bot .change_presence (activity = activity , status = status )
584
570
0 commit comments