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 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 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 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 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)
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)
async def textChannels(ctx): notify = Notify(ctx=ctx, title='Server Text Channels...') fields = [] for channel in ctx.guild.text_channels: fields.append(("\u2800", f"```{channel.name}```", True)) notify.fields(fields=fields)