Exemple #1
0
    async def on_dbl_vote(self, data):

        memberID = data["user"]

        user = self.bot.get_user(int(memberID))
        msg = await user.send(f"""
Hey! Thanks for the vote :heart: :100:
You now have one extra token :moneybag: 
Please do this every now and then :heart:
Enjoy making commands using me!""")

        channel = self.bot.get_channel(724508676588699678)
        guild = channel.guild

        embed = discord.Embed(color=discord.Color.dark_blue())
        embed.set_author(name=f"{user} just voted", icon_url=user.avatar_url)

        if user in guild.members:

            vh = VoteHandler(user)
            vh.add_vote(msg.created_at)

            embed.description = f"""
{user.mention} You now have the supporter role for 12 hours
and you've gained an extra token :moneybag:
                """

            role = guild.get_role(724522070960111626)
            member = guild.get_member(user.id)
            print(member)
            await member.add_roles(role)

        else:
            embed.description = "User is not in this server"

        embed.set_footer(text="Discord Bot list",
                         icon_url="https://cdn.discordapp.com/emojis/393548388664082444.gif?v=1")

        await channel.send(embed=embed)

        tokenmaker = TokenMaker(user)
        tokenmaker.add_token()

        tc = self.bot.get_channel(730092888209227907)
        mc = self.bot.get_channel(730093053938761799)

        botinfo = await self.dblpy.get_bot_info()
        tv = botinfo["points"]
        mv = botinfo["monthlyPoints"]


        await tc.edit(name=f"🗳 Total Votes : {tv}")
        await mc.edit(name=f"❤  Monthly Votes : {mv}")
Exemple #2
0
    async def on_dbl_vote(self, data):

        print("vote testing")

        memberID = data["user"]

        print(f"got vote from {memberID}")

        member = self.bot.get_user(int(memberID))
        print(member.name)
        await member.send(f"""
Hey!Thanks for the vote :heart: :100:
You now have one extra token :moneybag: 
Please do this every now and then :heart:
Enjoy making commands using me!""")

        tokenmaker = TokenMaker(member)
        tokenmaker.add_token()
Exemple #3
0
    async def rate__error(self, ctx, error):
        if isinstance(error, commands.CommandOnCooldown):
            tokenmaker = TokenMaker(ctx.author)

            await reset_timer(ctx=ctx,
                              command_name="edit choice",
                              bot=self.bot,
                              tokenmaker=tokenmaker,
                              error=error,
                              rate_limit=3)
Exemple #4
0
    async def on_dbl_test(self, data):

        memberID = data["user"]

        user = self.bot.get_user(int(memberID))
        msg = await user.send(f"""
Hey! Thanks for the vote :heart: :100:
You now have one extra token :moneybag: 
Please do this every now and then :heart:
Enjoy making commands using me!""")

        channel = self.bot.get_channel(724508676588699678)
        guild = channel.guild

        embed = discord.Embed(color=discord.Color.dark_blue())
        embed.set_author(name=f"{user} just voted",icon_url=user.avatar_url)
        embed.set_thumbnail(url="https://cdn.discordapp.com/emojis/376811626197811200.png?v=1")

        if user in guild.members:

            vh = VoteHandler(user)
            vh.add_vote(msg.created_at)

            embed.description = f"""
        {user.mention} You now have the supporter role for 12 hours
        and you've gained an extra token :moneybag:!.
        """

            role = guild.get_role(724522070960111626)
            member = guild.get_member(user.id)
            print(member)
            await member.add_roles(role)

        else:
            embed.description = "User is not in this server"

        embed.set_footer(text="Discord Bot list",
                         icon_url="https://cdn.discordapp.com/emojis/393548388664082444.gif?v=1")

        await channel.send(embed=embed)

        tokenmaker = TokenMaker(user)
        tokenmaker.add_token()
Exemple #5
0
    async def text_error(self, ctx, error):

        if isinstance(error, commands.CommandOnCooldown):

            tokenmaker = TokenMaker(ctx.author)

            await reset_timer(ctx = ctx,command_name="make text",bot=self.bot,tokenmaker=tokenmaker,error = error,rate_limit=3)

        if isinstance(error, commands.MissingRequiredArgument):
            await ctx.send(f"bruh you aint even specifying {error.param}")
Exemple #6
0
    async def _choice_error(self, ctx, error):
        if isinstance(error, commands.CommandOnCooldown):
            tokenmaker = TokenMaker(ctx.author)

            await reset_timer(ctx=ctx,
                              command_name="edit choice",
                              bot=self.bot,
                              tokenmaker=tokenmaker,
                              error=error,
                              rate_limit=3)

        if isinstance(error, commands.CommandInvokeError):

            if str(error.original) == "You are not the owner of that command":
                await ctx.send(
                    ":x: | you don't seem to be the owner of that command")
Exemple #7
0
    async def add_token(self,ctx,member : discord.Member):

        tm = TokenMaker(member=member)
        tm.add_token()

        await ctx.send("done")