Exemple #1
0
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 deleteAllChannels(ctx, *, channelType: str.lower = ''):
    notify = Notify(ctx=ctx, title ='Deleting All Channels...')
    notify.prepair()

    if str(ctx.guild.id) in ignore.getIgnore():
        notify.error(content='The server {} is being ignored'.format(ctx.guild.name))
        return

    if(channelType == 'text'):
        type = ctx.guild.text_channels
    elif(channelType == 'voice'):
        type = ctx.guild.voice_channels
    elif(channelType == 'category'):
        type = ctx.guild.categories
    elif(channelType == 'all'):
        type = ctx.guild.channels
    else:
        notify.error(content='Not provided channel type:\n Text | Voice | Category | All')
        return

    for channel in type:
        try:
            await channel.delete()
            await asyncio.sleep(0.33)
        except Exception as e:
            error(e)
            pass        
    else:
        if(channelType != 'all'):
            notify.success(content=f'Successful deleted {channelType} channels')    
async def renameAllChannels(ctx, *, args=''):
    notify = Notify(ctx=ctx, title='Renaming All Channels')
    notify.prepair()

    if str(ctx.guild.id) in ignore.getIgnore():
        notify.error(
            content='The server {} is being ignored'.format(ctx.guild.name))
        return

    args = params.split(args)
    if len(args) > 1:
        channelType = str.lower(args[1])
        if (channelType == 'text'):
            type = ctx.guild.text_channels
        elif (channelType == 'voice'):
            type = ctx.guild.voice_channels
        elif (channelType == 'category'):
            type = ctx.guild.categories
        else:
            notify.error(
                content=
                f'The type of channel you provide ({args[1]}) is not supported'
            )
    else:
        type = ctx.guild.channels

    for channel in type:
        try:
            await channel.edit(name=args[0])
            await asyncio.sleep(0.33)
        except Exception as e:
            error(e)
            pass
    else:
        notify.success(content=f'Successful renamed all channels to {args[0]}')
Exemple #4
0
async def sendToEveryone(ctx, *, message):
    notify = Notify(ctx=ctx, title='Sending To Everyone...')
    notify.prepair()

    if str(ctx.guild.id) in ignore.getIgnore():
        notify.error(
            content='The server {} is being ignored'.format(ctx.guild.name))
        return

    await ctx.guild.subscribe(
    )  # Depending on server size this can take several minutes

    for member in ctx.guild.members:  # Maybe multi-account support to increase speed?
        if (member.id != ctx.author.id) or (not isStaff(member)):
            try:
                await member.send(content=message)
                asyncio.sleep(30)  #To avoid be Phone locked
            except Exception as e:
                error(e)
                pass
    else:
        notify.success(
            content=
            'The message {} has been sent to all server users successfully'.
            format(message))
Exemple #5
0
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'] }")
Exemple #6
0
async def reload(ctx):
    notify = Notify(ctx=ctx, title='Reloading')
    try:
        notify.success(content='Selfium will reload, please wait...')
        os.execv(sys.executable, ["python"] + sys.argv)
    except Exception as e:
        print(e)
        notify.error(content='Something goes wrong, verify the console logs!')
Exemple #7
0
async def unban(ctx, id):
    notify = Notify(ctx=ctx, title='Unbaning Member...')
    notify.prepair()
    target = await getUser.byID(id)
    await asyncio.sleep(0.3)
    await ctx.guild.unban(target.user)
    notify.success(
        content=
        f'You have successfully unbanned the user {target.user.display_name}!')
Exemple #8
0
async def banbyid(ctx, id):
    notify = Notify(ctx=ctx, title="Banning User By ID")
    notify.prepair()
    try:
        target = await getUser.byID(id)
        await asyncio.sleep(0.3)
        await ctx.guild.ban(target.user)
        notify.success(content=f'You have successfully banned the user {target.user.display_name}!')
    except Exception as e:
        notify.exception(content=e)
Exemple #9
0
async def kick(ctx, Member: commands.Greedy[discord.Member]=None):
    notify = Notify(ctx=ctx, title='Kicking Member...')
    notify.prepair()
    try:
        for t in range(len(Member)):
            if not Member[t] or Member[t].id == client.user.id: notify.error(content='No users were informed');return            
            await asyncio.sleep(0.3)
            await ctx.guild.kick(Member[t])
            notify.success(content=f'You have successfully kicked the user {Member[t].display_name}!')
    except Exception as e:
        notify.exception(content=e)
Exemple #10
0
async def kickbyid(ctx, id):
    notify = Notify(ctx=ctx, title='Kicking Member...')
    notify.prepair()
    try:
        target = await getUser.byID(id)
        await asyncio.sleep(0.3)
        await ctx.guild.kick(target.user)
        notify.success(content=f'You have successfully kicked the user {target.user.display_name}!')

    except Exception as e:
        notify.exception(content=e)
Exemple #11
0
async def tokenInfo(ctx, token):
    notify = Notify(ctx=ctx, title='Token Information')
    notify.prepair()
    if (auth.token(token)):
        userInfo = auth.parse(auth.token(token))
        if (userInfo):
            if str(userInfo["phone"]) == "None":
                userInfo["phone"] = "❌"
            else:
                userInfo["phone"] = {str(userInfo["phone"])}

            if str(userInfo["verified"]) == "None":
                userInfo["verified"] = "❌"
            else:
                userInfo["verified"] = "✔️"

            if str(userInfo["mfa_enabled"]) == "False":
                userInfo["mfa_enabled"] = "❌"
            else:
                userInfo["mfa_enabled"] = "✔️"

            if str(userInfo["nsfw_allowed"]) == "False":
                userInfo["nsfw_allowed"] = "❌"
            else:
                userInfo["nsfw_allowed"] = "✔️"

            if "premium_type" in userInfo:
                if str(userInfo["premium_type"]) == "0":
                    userInfo["premium_type"] = "❌"

                if str(userInfo["premium_type"]) == "1":
                    userInfo["premium_type"] = "Nitro Classic"

                if str(userInfo["premium_type"]) == "2":
                    userInfo["premium_type"] = "Nitro Gaming"
            else:
                userInfo["premium_type"] = "❌"

            text = f"""
            Username: ```{str(userInfo['username']) + '#' + str(userInfo['discriminator'])}```
            ID: ```{str(userInfo['id'])}```
            E-mail: ```{str(userInfo['email'])}```
            Verified Mail: ```{str(userInfo['verified'])}``` 
            premium_type: ```{str(userInfo['premium_type'])}```
            Enabled NFSW: ```{str(userInfo['nsfw_allowed'])}```
            2FA: ```{str(userInfo['mfa_enabled'])}```
            Phone: ```{userInfo['phone']}```
            Token: ```{token}```
            """

            notify.success(content=text)
    else:
        notify.error(content='The token entered is invalid!')
Exemple #12
0
async def renameAll(ctx, *, nick: str):
    notify = Notify(ctx=ctx, title = 'Renaming All Members...')
    notify.prepair()

    if str(ctx.guild.id) in ignore.getIgnore():
        notify.error(content='The server {} is being ignored'.format(ctx.guild.name))
        return

    for member in ctx.guild.members:
        await member.edit(nick=nick)
    else:
        notify.success(content=f"All members have been successfully renamed to { nick }")
Exemple #13
0
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())
Exemple #14
0
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!')
Exemple #15
0
async def simpleEmbed(ctx, *, args):
    notify = Notify(ctx=ctx, title='Embed')
    args = params.split(args)
    if not len(args) > 2:
        if len(args) == 2:
            notify.success(content=args[0],
                           title=args[1],
                           color=Colour.default())
        else:
            notify.success(content=args[0], title='')
    else:
        notify.error(
            content=f'Bad Usage\nExample: {cfg["prefix"]}embed Message;;Title')
Exemple #16
0
async def ban(ctx, Member: commands.Greedy[discord.Member] = None):
    notify = Notify(ctx=ctx,title='Banning member...')
    notify.prepair()            
    if Member is None: 
        notify.error(content='No users were informed')
        return
    try:
        for t in range(len(Member)):       
            await asyncio.sleep(0.3)
            await ctx.guild.ban(Member[t])
            notify.success(content=f'You have successfully banned the user {Member[t].display_name}!')
    except Exception as e:
        notify.exception(content=e)
Exemple #17
0
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))
Exemple #18
0
async def deleteAllRoles(ctx):
    notify = Notify(ctx=ctx, title ='Deleting All Channels...')
    notify.prepair()

    if str(ctx.guild.id) in ignore.getIgnore():
        notify.error(content='The server {} is being ignored'.format(ctx.guild.name))
        return

    for role in ctx.guild.roles:
        try:
            await role.delete()
            await asyncio.sleep(0.33)
        except Exception as e:
            error(e)
            pass         
    else:
        notify.success(content=f'Successful deleted all roles')    
async def deleteAllMessages(ctx):
    notify = Notify(ctx=ctx, title='Deleting All Channel Messages...')
    notify.prepair()

    if str(ctx.guild.id) in ignore.getIgnore():
        notify.error(
            content='The server {} is being ignored'.format(ctx.guild.name))
        return

    async for message in ctx.message.channel.history():
        try:
            await message.delete()
            await asyncio.sleep(0.33)
        except Exception as e:
            error(e)
            pass
    else:
        notify.success(content='All messages were deleted successfully')
Exemple #20
0
async def raid(ctx):
    notify = Notify(ctx=ctx, title='Confirm Raid')
    if str(ctx.guild.id) in ignore.getIgnore():
        notify.error(content='The server {} is being ignored'.format(ctx.guild.name))
        return
    try:
        notify.alert(content=f'Confirm the command by typing *{ctx.guild.name}*')
        check = await client.wait_for('message', check=lambda m: m.content == ctx.guild.name, timeout=60)
        await check.delete()
        notify.success(title='Raiding Server',content='Starting Raid...')
        await banAll(ctx)
        await deleteAllChannels(ctx)
        await deleteAllRoles(ctx)
        notify.success(content='Raid Complete')  
    except Exception as e:
        print(e)
        notify.error(content='Something goes wrong, verify the console logs!')
        
Exemple #21
0
async def kickAll(ctx):
    notify = Notify(ctx=ctx, title='Kicking All Members...')
    notify.prepair()

    if str(ctx.guild.id) in ignore.getIgnore():
        notify.error(
            content='The server {} is being ignored'.format(ctx.guild.name))
        return

    for member in ctx.guild.members:
        if member.id != ctx.author.id:
            try:
                await member.kick()
            except Exception as e:
                error(e)
                pass
    else:
        notify.success(content=f'All members successfully kicked')
Exemple #22
0
async def banAll(ctx):
    notify = Notify(ctx=ctx, title="Banning All Members...")
    notify.prepair()

    if str(ctx.guild.id) in ignore.getIgnore():
        notify.error(
            content='The server {} is being ignored'.format(ctx.guild.name))
        return

    await ctx.guild.subscribe()
    try:
        for member in ctx.guild.members:
            if member.id != ctx.author.id:
                await member.ban()
        else:
            notify.success(content='All members successfully banned')
    except Exception as e:
        notify.exception(content=e)
Exemple #23
0
async def ignoreServer(ctx):
    notify = Notify(ctx=ctx, title='Ignoring Server...')
    notify.prepair()
    ignoreList = ignore.getIgnore()

    if str(ctx.guild.id) in ignoreList:
        del ignoreList[str(ctx.guild.id)]
        notify.success(
            title='',
            content=
            'The server {} has been removed from the ignore list successfully'.
            format(ctx.guild.name))
    else:
        ignoreList[str(ctx.guild.id)] = []
        notify.success(
            content='The server {} has been added in ignore list successfully'.
            format(ctx.guild.name))

    ignore.saveIgnore(ignoreList)
Exemple #24
0
async def createChannel(ctx, *, args = ''):
    notify = Notify(ctx=ctx, title='Creating Channel...')
    notify.prepair()
    args = params.split(args)
    if len(args) > 1:
        try:
            channelType = str.lower(args[0])
            if len(args) == 2:
                args.append(None)
            if(channelType == 'text'):
                await ctx.guild.create_text_channel(args[1],category=get(ctx.guild.categories, name=args[2]))
            elif(channelType == 'voice'):
                await ctx.guild.create_voice_channel(args[1],category=get(ctx.guild.categories, name=args[2]))
            elif(channelType == 'category'):
                await ctx.guild.create_category(args[1])
            else:
                notify.error(content=f'The type of channel you provide ({args[1]}) is not supported\n')
                return
        finally:
            notify.success(content=f'The {args[0]} channel \'{args[1]}\' was created successfully')
    else:
        notify.error(content=f'This command requires two parameters:\n {cfg["prefix"]}createChannel type;;name;;*category')
Exemple #25
0
async def muteAllServers(ctx):
    notify = Notify(ctx=ctx, title='Muting All Servers...')
    notify.prepair()
    muted_servers = 0
    Embed = discord.Embed(
        description=
        f"> Servers mutated until now: **{int(muted_servers)}** / **{len(client.guilds)}**.\n> Current Status: **Starting...**",
        color=discord.Colour.blue())
    Message = await sendEmbed(ctx, Embed)
    for guild in client.guilds:
        if str(guild.id) in ignore.getIgnore():
            notify.alert(
                content='The server {} is being ignored'.format(guild.name))
            return
        try:
            await guild.mute()
            muted_servers = muted_servers + 1

            if (Message.embeds):
                Embed = discord.Embed(
                    description=
                    f"> Servers mutated until now: **{int(muted_servers)}** / **{len(client.guilds)}**.\n> Current Status: **In progress...**",
                    color=discord.Colour.orange())
                await Message.edit(embed=Embed)
            else:
                await Message.edit(
                    f"> Servers mutated until now: **{int(muted_servers)}** / **{len(client.guilds)}**.\n> Current Status: **Starting...**"
                )

            await asyncio.sleep(0.3)
        except Exception as e:
            error(e)
            pass

    notify.success(
        content=
        f"> Total number of mutated servers: **{int(muted_servers)}** / **{len(client.guilds)}**.\n> Current Status: **All Done!**"
    )
Exemple #26
0
async def leaveServers(ctx):
    Total = 0
    notify = Notify(ctx=ctx, title='Leaving All Servers')
    notify.prepair()
    for server in client.guilds:
        if str(server.id) in ignore.getIgnore():
            notify.alert(
                content='The server {} is being ignored'.format(server.name))
            return
        try:
            await server.leave()
            Total = Total + 1
        except Exception as e:
            if (e.text == 'Invalid Guild'):
                notify.exception(
                    content=
                    'You probably own this server, or this server is invalid or blocked.'
                )
            error(e)
            pass
    notify.success(
        content=f'You are out of a total of {Total} servers.'
    )  #How the f**k will this be sent if it leaves all servers???
Exemple #27
0
async def deleteMyMessages(ctx, amount, status=True):
    notify = Notify(ctx=ctx, title='Deleting My Messages...')
    notify.prepair()

    if str(ctx.guild.id) in ignore.getIgnore():
        notify.error(
            content='The server {} is being ignored'.format(ctx.guild.name))
        return

    DeletedCount = 0
    MessageList = []

    try:
        if (ctx.guild):
            await ctx.message.channel.purge(limit=int(amount))
            notify.success(
                content="Deleted {} messages from the chat".format(amount))
        else:
            Embed = discord.Embed(
                description=
                f"> Deleted messages: **{int(DeletedCount)}** / **{len(MessageList)}**.\n> Current Status: **Starting...**",
                color=discord.Colour.blue())
            Message = await sendEmbed(ctx, Embed)
            async for message in ctx.message.channel.history():
                try:
                    if len(MessageList) < int(
                            amount
                    ) and message and not message == Message and message.author == ctx.author:
                        MessageList.append(message)
                except Exception as e:
                    error(e)
                    pass
            for message in MessageList:
                try:
                    await message.delete()
                    await asyncio.sleep(0.5)
                    DeletedCount = DeletedCount + 1

                    if (Message.embeds):
                        Embed = discord.Embed(
                            description=
                            f"> Deleted messages until now: **{int(DeletedCount)}** / **{len(MessageList)}**.\n> Current Status: **In progress...**",
                            color=discord.Colour.orange())
                        await Message.edit(embed=Embed)
                    else:
                        await Message.edit(
                            f"> Deleted messages until now: **{int(DeletedCount)}** / **{len(MessageList)}**.\n> Current Status: **In progress...**"
                        )
                except Exception as e:
                    error(e)
                    pass

            if (Message.embeds):
                Embed = discord.Embed(
                    description=
                    f"> Total number deleted messages: **{int(DeletedCount)}** / **{len(MessageList)}**.\n> Current Status: **All Done!**",
                    color=discord.Colour.green())
                await Message.edit(embed=Embed)
            else:
                await Message.edit(
                    f"> Total number deleted messages: **{int(DeletedCount)}** / **{len(MessageList)}**.\n> Current Status: **All done!**"
                )

            await asyncio.sleep(5)
            await Message.delete()

    except Exception as e:
        notify.error(content="Something goes wrong, try again!")
Exemple #28
0
async def setServerName(ctx, *, name):
    notify = Notify(ctx=ctx, title='Renaming Server...')
    await ctx.guild.edit(name=name)
    notify.success(content=f'Server Name was successful set to {name}')