Пример #1
0
    async def suggest(self, ctx, *, message: str):
        member = ctx.message.author
        if ctx.message.author.id in BlacklistedUsers:
            await ctx.send(
                f"You may not use this command as you are blacklisted on PinkBot, for more info join PinkBots support server https://discord.gg/TUkcgWt"
            )
        else:
            channel = bot.get_channel(698581537066582066)
            channel2 = bot.get_channel(698581569371373610)
            dm = await member.create_dm()
            color = ctx.author.color
            embed = discord.Embed(title=f'{member} Suggestion',
                                  colour=color,
                                  timestamp=datetime.datetime.utcnow())
            embed.add_field(name="Name:", value=f'{member}', inline=False)
            embed.add_field(name="Suggestion:",
                            value=f"{message}",
                            inline=False)
            sent = await channel.send(embed=embed)
            await ctx.send("Your suggestion has been sent")

            def check(reaction, user):
                return reaction.message.id == sent.id

            try:
                reaction, _ = await self.bot.wait_for('reaction_add',
                                                      timeout=86400.0,
                                                      check=check)
                if reaction.emoji == "\U0001F44D":
                    color = ctx.author.color
                    embed = discord.Embed(title=f'{member} Suggestion',
                                          colour=color,
                                          timestamp=datetime.datetime.utcnow())
                    embed.add_field(name="Name:",
                                    value=f'{member}',
                                    inline=False)
                    embed.add_field(name="Suggestion:",
                                    value=f"{message}",
                                    inline=False)
                    sent2 = await channel2.send(embed=embed)
                    await sent2.add_reaction(emoji="\U0001F44D")
                    await sent2.add_reaction(emoji="\U0001F44E")
                    await dm.send(
                        f"Hello {member.mention}, your suggestion `{message}` has been approved to go on the main bord https://discord.gg/TUkcgWt where people can vote on your idea!"
                    )
                elif reaction.emoji == "\U0001F44E":
                    await dm.send(
                        f"Hello {member}, your suggestion `{message}` wasnt approved, this can be do to:\n1 your suggestion was spam/wasnt real \n2 This feature is already in the bot \n3 the reason is something else and you will get a dm from pinkbot staff within 10 minutes \nif you have any questions you can ask them in the support server https://discord.gg/TUkcgWt"
                    )
                elif reaction.emoji == "\u2705":
                    await dm.send(
                        f'wow {member.mention}, what a grate suggestion `{message}`, in fact, it was so grate it was auto approved, yup its going in PinkBot without the public vote'
                    )
            except asyncio.TimeoutError:
                await ctx.send(
                    f"Suggestion: `{message}` by {member.mention} wasnt approved in time"
                )
                await dm.send(
                    f"Your suggestion `{message}` wast approved in time")
Пример #2
0
 async def on_member_join(self, member):
     g = member.guild.id
     channel = bot.get_channel(681911212740575297)
     if g == 681561708052873358:
         await channel.send(
             f"Welcome {member.mention} to PinkBots support server, check out the info channel"
         )
Пример #3
0
 async def pStaff(self, ctx, arg1: str = None, member: discord.User = None):
     if ctx.author.id in PinkBotStaff:
         if arg1 is None:
             await ctx.send(
                 "please choose an action \nBan (puts a PinkBot blacklist on the person) \nunban (removes a PinkBot blacklist on the person)"
             )
         elif arg1 == "ban":
             with open('./private.json', 'w') as file:
                 BlacklistedUsers.append(member.id)
                 json.dump(private, file, indent=4)
                 await ctx.send(f"{ctx.author} has banned {member}")
                 channel = bot.get_channel(698923439729279016)
                 embed = discord.Embed(colour=0xfb0006,
                                       timestamp=datetime.datetime.utcnow())
                 embed.add_field(name=f"Banned by:",
                                 value=ctx.author,
                                 inline=False)
                 embed.add_field(name="User banned:",
                                 value=f"{member}",
                                 inline=False)
                 embed.add_field(name="User id:",
                                 value=member.id,
                                 inline=False)
                 await channel.send(embed=embed)
         elif arg1 == "unban":
             with open('./private.json', 'w') as file:
                 BlacklistedUsers.remove(member.id)
                 json.dump(private, file, indent=4)
                 await ctx.send(f"{ctx.author} has unbanned {member}")
                 channel = bot.get_channel(698923439729279016)
                 embed = discord.Embed(colour=0x00fb52,
                                       timestamp=datetime.datetime.utcnow())
                 embed.add_field(name=f"Unbanned by:",
                                 value=ctx.author,
                                 inline=False)
                 embed.add_field(name="User unbanned:",
                                 value=f"{member}",
                                 inline=False)
                 embed.add_field(name="User id:",
                                 value=member.id,
                                 inline=False)
                 await channel.send(embed=embed)
Пример #4
0
    async def on_message(self, message):
        member = message.author
        author_id = str(message.author.id)
        user = await self.bot.pg_con.fetchrow(
            "SELECT * FROM global_level WHERE user_id = $1", author_id)
        cur_xp = user['xp']
        cur_lvl = user['lvl']
        if not user:
            await self.bot.pg_con.execute(
                "INSERT INTO global_level (user_id, lvl, xp, dm, msgs) VALUES ($1, 1, 0, 1, 0)",
                author_id)
        else:
            await self.bot.pg_con.execute(
                "UPDATE global_level SET xp = $1 WHERE user_id = $2",
                user["xp"] + 1, author_id)
            await self.bot.pg_con.execute(
                "UPDATE global_level SET msgs = $1 WHERE user_id = $2",
                user["msgs"] + 1, author_id)

            if cur_xp >= round(4 * (cur_lvl**3) / 5):
                await self.bot.pg_con.execute(
                    "UPDATE global_level SET lvl = $1 WHERE user_id = $2",
                    cur_lvl + 1, user["user_id"])
                lvl_c = bot.get_channel(707593824385368145)
                pfp = member.avatar_url
                embed = discord.Embed(title=f'{member} has leveled up ^^',
                                      colour=0xe99ae2,
                                      timestamp=datetime.datetime.utcnow())
                embed.set_thumbnail(url=pfp)
                embed.add_field(name="Level:",
                                value=user["lvl"] + 1,
                                inline=False)
                embed.add_field(name="XP:", value=user["xp"], inline=False)
                embed.add_field(name="Msgs sent:",
                                value=user["msgs"],
                                inline=False)
                embed.add_field(name="Server in:",
                                value=message.guild.name,
                                inline=False)
                embed.add_field(name="Server id:",
                                value=message.guild.id,
                                inline=False)
                embed.add_field(
                    name="Note:",
                    value=
                    "This is a global level system, to disable theses dms plase use >lvlToggle, to join the support server do >help",
                    inline=False)
                await lvl_c.send(embed=embed)

                dm = await member.create_dm()
                if user['dm'] == 1:
                    await dm.send(embed=embed)
                elif user['dm'] == 0:
                    return
Пример #5
0
 async def dm(self, ctx, *, message: str):
     if ctx.message.author.id in BlacklistedUsers:
         await ctx.send(
             f"You may not use this command as you are blacklisted on PinkBot, for more info join PinkBots support server [here](https://discord.gg/TUkcgWt)"
         )
     else:
         channel = bot.get_channel(698635497966403636)
         color = ctx.author.color
         member = ctx.message.author
         embed = discord.Embed(title=f'Dm from {member}',
                               colour=color,
                               timestamp=datetime.datetime.utcnow())
         embed.add_field(name="Name:", value=f'{member}', inline=False)
         embed.add_field(name="Message:", value=f"{message}", inline=False)
         await channel.send(embed=embed)
         await ctx.send(
             "Your dm has been sent and will be proceed soon, remember, abuse of this or any other system could get you banned from doing these commands, dms and suggestions are monitored by PinkBots staff team"
         )
Пример #6
0
 async def dmsend(self, ctx, user_id: int, *, message: str):
     if ctx.author.id in AdminList:
         member = bot.get_user(user_id)
         channel = await member.create_dm()
         channel2 = bot.get_channel(698635545408045087)
         color = ctx.author.color
         embed = discord.Embed(title=f'Dm from PinkBot',
                               colour=color,
                               timestamp=datetime.datetime.utcnow())
         embed.add_field(name="Name of the receiver:", value=f"{member}")
         embed.add_field(name="Message:", value=f"{message}", inline=False)
         embed.add_field(
             name="Note:",
             value=
             "If you want to send us a message please use >dm your message here(only works in dms), abuse of this or any other features can get you banned from doing commands in the future",
             inline=False)
         await channel.send(embed=embed)
         await channel2.send(embed=embed)
Пример #7
0
    async def verifyme(
        self,
        ctx,
        arg1: str = None,
        arg2: str = None,
    ):
        if ctx.guild.id == 696786836613496934:
            if arg1 is None:
                await ctx.send("I need an IGN", delete_after=5)
                return
            if arg2 is None:
                async with aiohttp.ClientSession() as session:
                    async with session.get(
                            f'https://api.slothpixel.me/api/players/{arg1}'
                    ) as resp:
                        player = await resp.json()
                    async with session.get(
                            f'https://api.slothpixel.me/api/guilds/{arg1}'
                    ) as resp:
                        guild = await resp.json()
                    if player['links']['DISCORD'] == str(ctx.author):
                        if guild["name"] == "PinkNation":
                            member = ctx.message.author
                            role = get(member.guild.roles,
                                       name="Guild Members")

                            await member.add_roles(role)
                            await ctx.send("You have been verified",
                                           delete_after=5)
                            channel = bot.get_channel(697516184794562600)
                            await channel.send(
                                f'{ctx.author.mention} is now a verified guild member with ign {arg1}'
                            )
                        else:
                            await ctx.send("You are not in the guild",
                                           delete_after=5)
                    else:
                        await ctx.send(
                            "Connect your discord and try again, or maybe your just not in the guild",
                            delete_after=5)
        else:
            await ctx.send(
                'This is PinkNations Discord servers private command')
Пример #8
0
 async def on_member_remove(self, member):
     g = member.guild.id
     channel = bot.get_channel(681911212740575297)
     if g == 681561708052873358:
         await channel.send(
             f"Aww {member.mention} just left :c, hope we see them again")
Пример #9
0
 async def pAdmin(self, ctx, arg1: str = None, member: discord.User = None):
     if ctx.author.id in PinkBotStaff:
         if arg1 is None:
             await ctx.send(
                 "Available PinkBot admin commands \nstaff (add the person as a PinkBot staff) \nunstaff (removes somones PinkBot staff) \npso (adds a server partner) \npsor (removes a server partner)"
             )
         elif arg1 == "staff":
             with open('./private.json', 'w') as file:
                 PinkBotStaff.append(member.id)
                 json.dump(private, file, indent=4)
                 await ctx.send(f"{ctx.author} has made {member} staff")
                 channel = bot.get_channel(698923439729279016)
                 embed = discord.Embed(colour=0x56fed8,
                                       timestamp=datetime.datetime.utcnow())
                 embed.add_field(name=f"Admin:",
                                 value=ctx.author,
                                 inline=False)
                 embed.add_field(name="User made staff:",
                                 value=f"{member}",
                                 inline=False)
                 embed.add_field(name="User id:",
                                 value=member.id,
                                 inline=False)
                 await channel.send(embed=embed)
         elif arg1 == "unstaff":
             with open('./private.json', 'w') as file:
                 PinkBotStaff.remove(member.id)
                 json.dump(private, file, indent=4)
                 await ctx.send(f"{ctx.author} has removed {member} staff")
                 channel = bot.get_channel(698923439729279016)
                 embed = discord.Embed(colour=0xaa0004,
                                       timestamp=datetime.datetime.utcnow())
                 embed.add_field(name=f"Admin:",
                                 value=ctx.author,
                                 inline=False)
                 embed.add_field(name="User removed staff:",
                                 value=f"{member}",
                                 inline=False)
                 embed.add_field(name="User id:",
                                 value=member.id,
                                 inline=False)
                 await channel.send(embed=embed)
         if arg1 == "pso":
             with open('./private.json', 'w') as file:
                 PinkBotPSO.append(member.id)
                 json.dump(private, file, indent=4)
                 await ctx.send(
                     f"{ctx.author} has made {member} a PinkBot partner")
                 channel = bot.get_channel(698923439729279016)
                 embed = discord.Embed(colour=0xff8b77,
                                       timestamp=datetime.datetime.utcnow())
                 embed.add_field(name=f"Admin:",
                                 value=ctx.author,
                                 inline=False)
                 embed.add_field(name="User made partner:",
                                 value=f"{member}",
                                 inline=False)
                 embed.add_field(name="User id:",
                                 value=member.id,
                                 inline=False)
                 await channel.send(embed=embed)
         elif arg1 == "psor":
             with open('./private.json', 'w') as file:
                 PinkBotPSO.remove(member.id)
                 json.dump(private, file, indent=4)
                 await ctx.send(
                     f"{ctx.author} has removed {member} from being a PinkBot partner"
                 )
                 channel = bot.get_channel(698923439729279016)
                 embed = discord.Embed(colour=0x3f4678,
                                       timestamp=datetime.datetime.utcnow())
                 embed.add_field(name=f"Admin:",
                                 value=ctx.author,
                                 inline=False)
                 embed.add_field(name="Users partner removed:",
                                 value=f"{member}",
                                 inline=False)
                 embed.add_field(name="User id:",
                                 value=member.id,
                                 inline=False)
                 await channel.send(embed=embed)
         elif arg1 == "lvl clear:":
             author_id = str(ctx.author.id)
             user = await self.bot.pg_con.fetchrow(
                 "SELECT * FROM users WHERE user_id = $1", author_id)
             if user["dm"] == 1:
                 await self.bot.pg_con.execute(
                     "UPDATE users SET dm = $1 WHERE user_id = $2",
                     user["dm"] - 1, author_id)
                 await ctx.send("Level up dms have been disabled")
             elif user["dm"] == 0:
                 await self.bot.pg_con.execute(
                     "UPDATE users SET dm = $1 WHERE user_id = $2",
                     user["dm"] + 1, author_id)
                 await ctx.send("Level up dms have been enabled")
Пример #10
0
 async def say(self, ctx, channel_id: int, *, message: str):
     if ctx.author.id in AdminList:
         channel = bot.get_channel(channel_id)
         await channel.send(message)