コード例 #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]}')
コード例 #2
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')    
コード例 #3
0
ファイル: userInfo.py プロジェクト: caiocinel/Selfium
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)
コード例 #4
0
ファイル: sendToEveryone.py プロジェクト: caiocinel/Selfium
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))
コード例 #5
0
ファイル: reload.py プロジェクト: caiocinel/Selfium
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!')
コード例 #6
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)
コード例 #7
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!')
コード例 #8
0
ファイル: renameAll.py プロジェクト: caiocinel/Selfium
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 }")
コード例 #9
0
ファイル: tokenInfo.py プロジェクト: caiocinel/Selfium
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!')
コード例 #10
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')
コード例 #11
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)
コード例 #12
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))
コード例 #13
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')    
コード例 #14
0
ファイル: kickAll.py プロジェクト: caiocinel/Selfium
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')
コード例 #15
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')
コード例 #16
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!')
        
コード例 #17
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)
コード例 #18
0
ファイル: richPresence.py プロジェクト: caiocinel/Selfium
async def setPresenceType(ctx, *, type: str.lower):
    notify = Notify(ctx=ctx, title='Presence Type')
    if (type == 'playing'):
        cfg['activity']['type'] = 0
    elif (type == 'streaming'):
        cfg['activity']['type'] = 1
    elif (type == 'listening'):
        cfg['activity']['type'] = 2
    elif (type == 'watching'):
        cfg['activity']['type'] = 3
    elif (type == 'custom'):
        cfg['activity']['type'] = 4
    elif (type == 'competing'):
        cfg['activity']['type'] = 5
    elif (type == 'unknown'):
        cfg['activity']['type'] = -1
    else:
        notify.error(content='Invalid Activity Type')
        return
    await updatePresence(ctx)
コード例 #19
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')
コード例 #20
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!")