Ejemplo n.º 1
0
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]}')
Ejemplo n.º 2
0
async def serverInfo(ctx):
    notify = Notify(ctx=ctx, title='Server Information')
    notify.prepair()
    userData = await getUser.byID(ctx.guild.owner_id)
    fields = [
        ("ID", f"```{ctx.guild.id}```", True),
        ("Owner::",
         f"```{userData.user.display_name}#{userData.user.discriminator}```",
         True),
        ("Owner ID:", f"```{ctx.guild.owner_id}```", True),
        ("Region:", f"```{ctx.guild.region}```", True),
        ("Created in:", f'```{ctx.guild.created_at.strftime("%d/%m/%Y")}```',
         True),
        ("Member Count:", f"```{int(ctx.guild.member_count)}```", True),
        ("Text Channels:", f"```{len(ctx.guild.text_channels)}```", True),
        ("Voice Channel:", f"```{len(ctx.guild.voice_channels)}```", True),
        ("Category:", f"```{len(ctx.guild.categories)}```", True),
        ("Roles", f"```{len(ctx.guild.roles)}```", True),
        ("\u200b", "\u200b", True),
    ]
    if ctx.message.author.guild_permissions.ban_members:
        fields.append(
            ("Ban Count:", f"```{len(await ctx.guild.bans())}```", True), )

    notify.fields(fields=fields)
Ejemplo n.º 3
0
async def inviteInfo(ctx, link):
    notify = Notify(ctx=ctx, title='Invite information')
    notify.prepair()
    linkData = await client.fetch_invite(url=link)
    
    if (linkData.inviter):
        inviterData = await getUser.byID(linkData.inviter.id)
    try:
        guildData = await getGuild.byID(linkData.guild.id)
    except:
        guildData = linkData.guild

    fields = [
        ("ID", f"```{guildData.id}```", False),
        ("Name::", f"```{guildData.name}```", False),
        ("Description", f"```{guildData.description}```", False),
        ("Created in:", f'```{guildData.created_at.strftime("%d/%m/%Y")}```', False),
        ("Member Count:", f"```{int(linkData.approximate_member_count)}```", False), 
        ("Link", f"```{linkData.url}```", False),
        ("\u200b", "\u200b", False),
    ]
        
    if (linkData.inviter):
        fields.append(("Inviter ID:", f"```{inviterData.user.id}```", False))
        fields.append(("Inviter:", f"```{inviterData.user.name + '#' + inviterData.user.discriminator}```", False))

    notify.fields(fields=fields)
Ejemplo n.º 4
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'] }")
Ejemplo n.º 5
0
async def Categories(ctx):
    notify = Notify(ctx=ctx, title="Server Categories")
    notify.prepair()
    fields = []
    for channel in ctx.guild.categories:
        fields.append(("\u2800", f"```{channel.name}```", False))
    notify.fields(fields=fields)
Ejemplo n.º 6
0
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')    
Ejemplo n.º 7
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))
Ejemplo n.º 8
0
async def userInfo(ctx, Member: discord.Member = None):
    notify = Notify(ctx=ctx, title="User Info")
    notify.prepair()
    if not (Member):
        notify.error(content='No user has passed')
        return

    try:
        if (Member.bot):
            IsBot = '✔️'
        else:
            IsBot = '❌'

        if (Member.premium_since):
            Booster = '✔️'
        else:
            Booster = '❌'
            
        fields = [(f"User:"******"ID:", f'```{Member.id}```', True),
                    ("Bot?", f'```{IsBot}```', True),
                    ("Status: ", f'```{str(Member.status).title()}```', True),
                    ("Activity:", f"```{str(Member.activity.type).split('.')[-1].title() if Member.activity else 'N/A'} {Member.activity.name if Member.activity else ''}```", True),
                    ("Created In:", f'```{Member.created_at.strftime("%d/%m/%Y")}```', True),
                    ("Joined In:", f'```{Member.joined_at.strftime("%d/%m/%Y")}```', True),
                    ("Booster?", f'```{Booster}```', True)]
        notify.fields(fields=fields)
    except Exception as e:
        notify.error(content=e)
Ejemplo n.º 9
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'] }")
Ejemplo n.º 10
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}!')
Ejemplo n.º 11
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)
Ejemplo n.º 12
0
async def setPresenceURL(ctx, *, url):
    notify = Notify(ctx=ctx, title='Presence URL')
    notify.prepair()
    cfg['activity']['url'] = url
    if (cfg['activity']['type']) != 1:
        notify.alert(
            content=
            'Streaming will only be displayed if presence is set to "Streaming"'
        )
    await updatePresence(notify)
Ejemplo n.º 13
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)
Ejemplo n.º 14
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)
Ejemplo n.º 15
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 }")
Ejemplo n.º 16
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())
Ejemplo n.º 17
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!')
Ejemplo n.º 18
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!')
Ejemplo n.º 19
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)
Ejemplo n.º 20
0
async def channels(ctx):
    notify = Notify(ctx=ctx,
                    title="Server Channels",
                    color=discord.Color.purple())
    notify.prepair()
    fields = [("Voice Channels", "** **", False)]
    for channel in ctx.guild.voice_channels:
        fields.append(("\u2800", f"```{channel.name}```", True))
    fields.append(("Categories", "** **", False))
    for channel in ctx.guild.categories:
        fields.append(("\u2800", f"```{channel.name}```", True))
    fields.append(("Text Channels", "** **", False))
    for channel in ctx.guild.text_channels:
        fields.append(("\u2800", f"```{channel.name}```", True))
    notify.fields(fields=fields)
Ejemplo n.º 21
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))
Ejemplo n.º 22
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')    
Ejemplo n.º 23
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)
Ejemplo n.º 24
0
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')
Ejemplo n.º 25
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')
Ejemplo n.º 26
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)
Ejemplo n.º 27
0
async def ip(ctx, *, IP):
    notify = Notify(ctx=ctx, title='IP Information')
    notify.prepair()
    ipInfo = requests.get(f'http://extreme-ip-lookup.com/json/{IP}').json()
    fields = [
        ('IP', ipInfo['query'], True),
        ('Type', ipInfo['ipType'], True),
        ('Country', ipInfo['country'], True),
        ('City', ipInfo['city'], True),
        ('Country', ipInfo['country'], True),
        ('Hostname', ipInfo['ipName'], True),
        ('ISP', ipInfo['isp'], True),
        ('Latitute', ipInfo['lat'], True),
        ('Longitude', ipInfo['lon'], True),
        ('Org', ipInfo['org'], True),
        ('Region', ipInfo['region'], True),
    ]

    notify.fields(fields=fields)
Ejemplo n.º 28
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')
Ejemplo n.º 29
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!**"
    )
Ejemplo n.º 30
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???