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]}')
async def on_command_error(ctx, error): try: notify = Notify(ctx=ctx, title="Exception") notify.exception(content=error.args[0]) except Exception as e: error_file(e) pass
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)
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 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)
async def discriminator(ctx): notify = Notify(ctx=ctx, title='Getting All Members...') fields = [('Member Discriminators', '** **', False)] for guild in client.guilds: print(f'Subscribing to guild {guild.name}') await guild.subscribe() print('Subscribed') for member in guild.members: if member.discriminator == client.user.discriminator: fields.append(name=f'{member.name}#{member.discriminator}', value=f'{member.id}', inline=False) else: notify.fields(title='Members Discriminator',fields=fields)
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)
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))
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 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)
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)
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)
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 }")
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!')
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 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)
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')
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)
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)
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)
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 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')
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!')
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???
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}!')
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 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 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)
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')
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')