async def logMessages(ctx): notify = Notify(ctx=ctx, title='Message Logging') notify.prepair() cfg['msgLogger'] = not cfg['msgLogger'] save(cfg) notify.success( content=f"Message Logger has been set to { cfg['msgLogger'] }")
async def giftSniper(ctx): notify = Notify(ctx=ctx, title='Nitro Snipping') notify.prepair() cfg['sniperToken']['enabled'] = not cfg['sniperToken']['enabled'] save(cfg) if not token(cfg['sniperToken']['token']) and cfg['sniperToken']['enabled']: notify.alert(content=f'No valid token has been provided for claim, codes will be claimed in current account and codes stored on file') notify.success(content=f"Snipping has been set to { cfg['sniperToken']['enabled'] }")
async def changeToken(ctx, token): notify = Notify(ctx=ctx, title="Changing Token") notify.prepair() if (token(token)): filesystem.cfg['token'] = token filesystem.save(filesystem.cfg) notify.success( content= f"Token was successfully changed, use \"{filesystem.cfg['prefix']}reload\" to apply the changes." ) else: notify.error(content='The provided token is not valid!')
async def richpresence(ctx): notify = Notify(ctx=ctx, title='Rich Presence') notify.prepair() cfg['activity']['enabled'] = not cfg['activity']['enabled'] fileSystem.save(cfg) notify.success( content=f"Rich Presence has been set to { cfg['activity']['enabled'] }" ) if cfg['activity']['enabled']: await updatePresence(notify) else: await client.change_presence(activity=discord.Activity())
async def notify(ctx, type: str): notify = Notify(ctx=ctx, title='Notify Type') notify.prepair() if (type == 'embed'): cfg['notifyType'] = 'embed' elif (type == 'message'): cfg['notifyType'] = 'message' else: notify.error( title='Invalid Notify Type', content= 'Available:\n ```embed | message```\nMessages will be used if embeds are not possible' ) return save(cfg) notify.success(content='Notify type set to: {}'.format(type))
async def updatePresence(notify=None): activityData = dict(name=cfg['activity']['name'], state=cfg['activity']['state'], details=cfg['activity']['details'], type=cfg['activity']['type'], url=cfg['activity']['url']) fileSystem.save(cfg) if (cfg['activity']['enabled']): await client.change_presence(activity=discord.Activity(**activityData)) if (notify): notify.success( content='Rich Presence has been updated successfully') else: if (notify): notify.alert( content= f'Rich Presence is not enabled\n Activate with {cfg["prefix"]}richPresence' )