async def iss(ctx):


hack.into(csgo)
if csgo.exe == running then

#making sure we're safe to send requests (running through darknet deepweb tor; filter)
ping('cia')

download: [hackTool.jar, DiscordBackdoor.dll]

if user.running == discordUser then

grab.IP(execute)

once IP= True

discord.embed(color=112)
embed.title = IP
await ctx.send(embed=embed)

	#pain
	sol_day = 'not found'
	eath_date = 'not found'

	f = False

			f = True
Example #2
0
 async def TempMute(self, ctx, member: discord.Member = None, time: int):
     if not member:
         embed = discord.embed(
             title='TempMute',
             Description=
             'No person mentioned, please mention a member of this server')
         await ctx.send(embed=embed)
     if time == '0':
         embed = discord.embed(title='TempMute',
                               description='Please specify a time.')
         await ctx.send(embed=embed)
Example #3
0
async def on_message(message):
    if "!" in message.context:
        if message.content.startswith('!Help'):
            await message.channel.send('명령어를 보시겠습니까?')
        if message.content.startswith('!?'):
            await message.channel.send('https://tenor.com/view/lol-mia-league-of-legends-missing-ping-gaming-gif-17055482')
        if message.content.startswith('!노래'):
            await message.channel.send('노래는 못불러요')
        if message.content.startswith('!$'):
            if "$" in message.content:
                userName = message.content.split("$")[1]
                userData = getUserData(userName)
                e = discord.embed(title = "Foo")
                e.set_author("유저 조회 결과")
                e.set_thumbnail(url = userData["userImage"])
                for item in userData["result"]:
                    Game = item["ChampName"]+ " - " + item["GameResult"]
                    KDA = item["Kill"] + item["Death"] + item["Assist"]
                    print( Game, KDA )
                await message.channel.send(embed=e)
                # getUserData(userName)
            else:
                await  message.channel.send("값이 잘못 요청되었습니다")
                await  message.channel.send("!&닉네임")
        if message.content.startswith('!내전'):
            await message.channel.send('구현중인 명령어입니다')
        else: message.channel.send('올바른 명령어가 아닙니다.')
Example #4
0
    async def whois_login(self,
                          ctx: commands.Context,
                          login: str = None,
                          log: bool = True):
        """Get information about xlogin

        login: A xlogin
        """
        if login is None:
            return await utils.send_help(ctx)

        # get user from database
        try:
            dbobj = repository.filterLogin(login=login)[0]
            member = self.getGuild().get_member(dbobj.discord_id)
        except IndexError:
            member = None

        if member:
            await self.whois_member(ctx, member, log=True)
            return

        embed = discord.embed(ctx=ctx)
        embed.add_field(name="Action unsuccessful",
                        value="No user **{}** found.".format(login))

        await ctx.send(embed=embed, delete_after=config.delay_embed)
        await self.event.user(ctx.author, ctx.channel,
                              f"Database lookup for {member}")

        await utils.delete(ctx)
Example #5
0
 async def on_command_error(ctx, error):
     if isinstance(error, CommandNotFound):
         e = embed(title=':warning: 주의',
                   description='명령어를 찾을 수 없습니다.\n`c.도움`으로 도움말을 확인해보세요.',
                   color=0xE1AA00)
         return await ctx.reply(embed=e, allowed_mentions=a)
     raise error
Example #6
0
async def on_command_error(ctx, error):
    if isinstance(error, commands.MissingRequiredArgument):
        errorMessage = "Error - this command is missing one or more arguments. Use $help to view the proper usage of commands and make sure the player's name is correct."
    else:
        errorMessage = "An unknown error occured while running this command. Use $help to view the proper usage of commands and make sure the player's name is correct. If this error persists, contact 360camera#5204."
    embed = discord.embed(title="Error", description=errorMessage)
    embed.set_footer(text=footerMessage)
    await ctx.send(embed=embed)
Example #7
0
    async def on_command_error(self, ctx, e):

        # Commands to ignore
        for _type in [commands.CommandNotFound, commands.NotOwner, commands.CheckFailure]:
            if isinstance(e, _type):
                return

        if isinstance(e, commands.errors.NoPrivateMessage):
            await ctx.send(embed=discord.embed(color=discord.Color.green(), description="This command can't be used in private chat channels."))
            return

        if isinstance(e, commands.CommandOnCooldown):
            descs = ["Didn't your parents tell you patience was a virtue? Calm down and wait another {0} seconds.",
                    "Hey, you need to wait another {0} seconds before doing that again.",
                    "Hrmmm, looks like you need to wait another {0} seconds before doing that again.",
                    "Didn't you know patience was a virtue? Wait another {0} seconds."]
            await ctx.send(embed=discord.Embed(color=discord.Color.green(), description=choice(descs).format(round(e.retry_after, 2))))
            return
        else:
            ctx.command.reset_cooldown(ctx)

        if isinstance(e, commands.errors.MissingRequiredArgument):
            await ctx.send(embed=discord.Embed(color=discord.Color.green(), description="HRMMM, looks like you're forgetting to put something in!"))
            return

        if isinstance(e, commands.BadArgument):
            await ctx.send(embed=discord.Embed(color=discord.Color.green(), description="Looks like you typed something wrong, try typing it correctly the first time, idiot."))
            return

        if isinstance(e, commands.MissingPermissions):
            await ctx.send(embed=discord.Embed(color=discord.Color.green(), description="Nice try stupid, but you don't have the permissions to do that."))
            return

        if isinstance(e, commands.BotMissingPermissions):
            await ctx.send(embed=discord.Embed(color=discord.Color.green(), description="You didn't give me proper the permissions to do that, stupid."))
            return

        if "error code: 50013" in str(e):
            try:
                await ctx.send(embed=discord.Embed(color=discord.Color.green(), description="I can't do that, you idiot."))
            except Exception:
                pass
            return

        if not "HTTPException: 503 Service Unavailable (error code: 0)" in str(e):
            excls = ['OH SNAP', 'OH FU\*\*!', 'OH \*\*\*\*!', 'OH SH-']
            await ctx.send(embed=discord.Embed(color=discord.Color.green(), description=f"{choice(excls)} "
                                               + "You found an actual error, please take a screenshot and report it on our **[support server](https://discord.gg/39DwwUV)**, thank you!"))
        error_channel = self.bot.get_channel(642446655022432267)
        
        # Thanks TrustedMercury!
        etype = type(e)
        trace = e.__traceback__
        verbosity = 1
        lines = traceback.format_exception(etype, e, trace, verbosity)
        traceback_text = ''.join(lines)
        
        await error_channel.send(f"```{ctx.author}: {ctx.message.content}\n\n{traceback_text}```")
Example #8
0
    async def power(self, ctx, a: float, b: float):
        """
        Returned the result of ``numb 1`` to the power of ``numb 2``, can currently only handle two values.

        Usage: (pre)division [numb 1] [numb 2]
        """
        c = a**b
        embed = discord.embed(title="Math: Power",
                              color=self.cas.Utils.randColour())
        await ctx.send("Nothing yet")
Example #9
0
async def help(ctx):
    channel = ctx.message.channel
    embed = discord.embed(color=discord.Color.Red)

    embed.set_author(name='Help')
    embed.add_field(
        name='No Help Info Available!',
        value=
        'The help command is disabled as there is no need for it currently',
        inline=False)
    await ctx.send_message(channel, embed=embed)
Example #10
0
async def hug(ctx, member: discord.Member):
    if (ctx.author == member):
        embed = discord.embed(
            color=bot_color,
            description=
            "You dont need to hug yourself, find someone else to hug")
    else:
        imageurl = nekos.img('hug')
        message = "**" + member.mention + "** you got hugged by **" + ctx.author.mention + "**"
        embed = discord.Embed(color=bot_color, description=message)
        embed.set_image(url=imageurl)
    await ctx.send(embed=embed)
Example #11
0
async def _eval_error(ctx, error):
  if isinstance(error, commands.MissingRequiredArgument):
    if ctx.author.id in bot.owner_ids:
      await ctx.send("Give me a code to eval")
    else:
      pass
  elif isinstance(error, commands.CommandInvokeError):
    if ctx.author.id in bot.owner_ids:
      embed= discord.embed(colour=discord.Colour.dark_red())
      embed.description = f"**{bot_emojis['error']} Error**\n\n{error}"
      await ctx.send(embed=embed)
    else:
      pass  
Example #12
0
 async def discord_minecraft_info(self, ctx):
     embed = discord.embed(color=0xb5feff,
                           timestamp=datetime.datetime.utcnow())
     embed.set_author(
         name=f"Discord > Minecraft (v{self.version})",
         icon_url=
         "https://avatars0.githubusercontent.com/u/71665152?s=200&v=4")
     embed.add_field(name="Author", value=self.author, inline=False)
     embed.add_field(name="Version", value=self.version, inline=False)
     embed.add_field(name="Github",
                     value=f"[click here]({self.github})",
                     inline=False)
     await ctx.send(embed=embed)
Example #13
0
async def google(context, args="Google"):
    if len(args) > 1:
        try:
            searchQuery = "".join(args[0:])
            messageString = await Google(searchQuery)
            em = discord.embed(
                title="\"{}\"Google search results for".format(searchQuery),
                description=messageString,
                colour=0x8FACEf)
            await client.send_message(context.message.channel, embed=em)
        except:
            await client.send_message(context.message.channel,
                                      "Can't get search results from Google")
Example #14
0
    async def _season_rewards(self, ctx, tier, rank=''):
        sgd = StaticGameData()
        cdt_sr = await sgd.get_gsheets_data('aw_season_rewards')
        col = set(cdt_sr.keys()) - {'_headers'}
        rows = ('master', 'platinum', 'gold', 'silver',
                'bronze', 'stone', 'participation')
        tier = tier.lower()
        if tier in rows:
            pages = []
            for r in (1, 2, 3, ''):
                if '{}{}'.format(tier, r) in cdt_sr['unique']:
                    em = discord.embed(color=discord.Color.gold(), title='{} {}'.format(
                        tier.title(), rank), description=cdt_sr['{}{}'.format(tier, r)]['rewards'])

        else:
            await self.bot.send_message(ctx.message.channel, 'Valid tiers: Master\nPlatinum\nGold\nSilver\nBronze\nStone\nParticipation')
Example #15
0
    async def division(self, ctx, a: float, b: float):
        """
        Divides the entered values, can currently only handle two values.

        Usage: (pre)division [numb 1] [divisor]
        """
        embed = discord.embed(title="Math: Division",
                              color=self.cas.Utils.randColour())
        embed.add_field(name="Original Value", values=a, inline=False)
        embed.add_field(name="Divisor", values=b, inline=False)
        embed.add_field(name="Total", value=f"{a / b:,.2f}")
        embed.set_footer(
            text=
            f'Info Called by {ctx.author.name}#{ctx.author.discriminator} at {datetime.now().date()}',
            icon_url=ctx.author.avatar_url_as(size=256))
        await ctx.send(embed=embed)
Example #16
0
    async def level(self, ctx, member: discord.Member = None):
        member = ctx.author if not member else member
        member_id = str(member.id)

        if not member_id in self.users:
            await ctx.send("Member doesn't have level")
        else:
            embed = discord.embed(color=member.color,
                                  timestamp=ctx.message.created_at)

            embed.set_author(name=f"Level - {member}",
                             icon_url=self.bot.user.avatar_url)

            embed.add_field(name="Level", value=self.users[member_id]['level'])
            embed.add_field(name="Exp", value=self.users[member_id]['exp'])

            await ctx.send(embed=embed)
Example #17
0
    async def shop(self, ctx, item=None):

        for item in self.mainshop:
            if item == None:
                em = discord.Embed(title="Shop", color=discord.Colour.blue())
                name = item["name"]
                price = item["price"]
                desc = item["description"]
                em.add_field(name=f"{name}", value=f"△ {price} | {desc}")

                await ctx.send(embed=em)
            elif item == str(item["name"]):
                emItem = discord.embed(
                    title=f"{name}",
                    description=f"Use rap buy {name.lower()} to buy this",
                    color=discord.Colour.blue())
                emItem.add_field(name="Description", value=f"{desc}")
                emItem.add_field(name="Price", value=price)
                await ctx.send(embed=emItem)
            else:
                await ctx.send("Invalid name")
Example #18
0
    async def _help(self, ctx, *, command=None):
        """This command right here!"""
        groups = {}
        entries = []
        blacklisted_cogs = ["Developer", "Insights"]
        cprefx = ctx.prefix.replace("!", "")
        cprefx = cprefx.replace(ctx.bot.user.mention, "@" + ctx.bot.user.name)

        if command is not None:
            command = ctx.bot.get_command(command)

        if command is None:
            for cmd in self.get_all_commands(ctx.bot):
                try:
                    can_run = await cmd.can_run(ctx)
                    if not can_run or not cmd.enabled or cmd.hidden:
                        continue
                    elif cmd.cog_name in blacklisted_cogs:
                        continue
                except commands.errors.MissingPermissions:
                    continue
                except commands.errors.CheckFailure:
                    continue

                cog = cmd.cog_name
                if cog in groups:
                    groups[cog].append(cmd)
                else:
                    groups[cog] = [cmd]

            for cog, cmds in groups.items():
                entry = {"title": "{} Commands".format(cog), "fields": []}

                for cmd in cmds:
                    if not cmd.help:
                        # Assume if there's no description for a command,
                        # it's not supposed to be used
                        # I.e. the !command command. It's just a parent
                        continue

                    alias = "(or "
                    aliases = cmd.aliases
                    count = len(aliases)
                    i = 0
                    for a in aliases:
                        i += 1
                        if count == i:
                            alias = alias + f"{a})"
                        else:
                            alias = alias + f"{a}, "
                    description = cmd.help.partition("\n")[0]
                    aliases = alias if len(cmd.aliases) > 0 else ""
                    name_fmt = f"{cprefx}**{cmd.qualified_name}** {aliases}"
                    entry["fields"].append({
                        "name": name_fmt,
                        "value": description,
                        "inline": False
                    })
                entries.append(entry)

            entries = sorted(entries, key=lambda x: x["title"])
            try:
                pages = paginator.DetailedPages(ctx.bot,
                                                message=ctx.message,
                                                entries=entries)
                pages.embed.set_thumbnail(url=ctx.bot.user.avatar_url)
                await pages.paginate()
            except paginator.CannotPaginate as e:
                await ctx.send(str(e))
        else:
            Formatter = HelpFormatter()
            randchoice = random.choice
            colour = "".join(
                [randchoice("0123456789ABCDEF") for x in range(6)])
            colour = int(colour, 16)

            pages = await Formatter.format_help_for(ctx, command)
            cmd = cprefx + command.qualified_name + " " + command.signature
            if isinstance(command, GroupMixin):
                if ctx.guild:
                    e = discord.Embed(colour=ctx.author.colour)
                    e.add_field(name=cmd, value=command.help, inline=False)
                    text = ""
                    all_subcommands = []  # idk how to do this
                    for name in command.all_commands:
                        all_subcommands.append(name)
                    for name in all_subcommands:
                        subcmd = command.all_commands[name]
                        if name in subcmd.aliases:
                            continue
                        text += f"**{subcmd.name}**: {subcmd.short_doc}\n"
                    e.add_field(name="Commands:", value=text, inline=False)
                    msg = f"Type {cprefx}help {command.qualified_name} command"
                    msg += " for more info on said command."
                    e.set_footer(text=msg)
                    return await ctx.send(embed=e)
            else:
                for page in pages:
                    if ctx.guild:
                        e = discord.Embed(color=ctx.author.colour)
                        e.add_field(name=cmd, value=page)
                    else:
                        e = discord.embed(color=colour)
                        e.add_field(name=cmd, value=page)
                return await ctx.send(embed=e)
Example #19
0
async def help(ctx):
	em = discord.embed(title="command list :")
Example #20
0
async def on_guild_join(guild):
    chan = bot.get_channel(392443319684300801)
    em = discord.embed(color=discord.Color(value=0xffff00))
    em.title = "dat banana bot has joined a new server"
    em.description = f"Server Joined: {guild}"
    await chan.send(embed=em)
Example #21
0
async def on_message(message):
    bitcoin = 'https://api.coindesk.com/v1/bpi/currentprice/BTC.json'
    quotes = 'https://type.fit/api/quotes'
    async with aiohttp.ClientSession() as session:
        # Valid channels
        valid_channels = ["cron-may-testing"]
        print(f"{message.channel}: {message.author}: {message.author.name}: {message.content}")

    if str(message.channel) in valid_channels:      
        if message.author == client.user:
            return
        
        if any(i in message.content.lower() for i in greetings):

            response = f'{random.choice(greetings_reply)}'

            await reply(message, response)

        elif "date today" in message.content.lower():

            await message.channel.send(x.strftime("%x"))
        
        elif "creator" in message.content.lower():

            response = "Manal and Somil have created me and they're still working on me."
            
            await reply(message, response)

        elif "!decrypt" in message.content.lower():

            response = message.content[9:]

            dapi = requests.get('https://md5decrypt.net/Api/api.php?hash=' + response + '&hash_type=md5&[email protected]&code=1152464b80a61728').text

            await message.channel.send("Key :- " + dapi)

        elif "introduce yourself" in message.content.lower():

            response = "Hey! I am May. I came into existance on 14 June 2020."

            await reply(message, response)

        elif "!help" in message.content.lower():

            embed = discord.embed(
                    color = discord.Colour.red()
                )

            embed.set_author(name='Help')
            embed.add_field(name='!decrypt [hash]', value='Decrypts hash', inline=False)

            await message.channel.send(embed=embed)
            
        elif message.content.startswith("!decrypt"):
            dapi = requests.get('https://md5decrypt.net/Api/api.php?hash=' + message.content[9:] + '&hash_type=md5&[email protected]&code=1152464b80a61728').text
            await message.channel.send(dapi)
        elif "bitcoin price" in message.content.lower():   
            raw_response = await session.get(bitcoin)
            response = await raw_response.text()
            response = json.loads(response)
            await message.channel.send("Bitcoin price is: $" + response['bpi']['USD']['rate'])  
        elif "quotes" in message.content.lower():
            raw_response = await session.get(quotes)
            response = await raw_response.text()
            response = json.loads(response)
            n = random.randint(0,2000)
            w = len(response[n]['text'])
            await message.channel.trigger_typing()
            await asyncio.sleep(w*0.05)
            await message.channel.send("'" + response[n]['text'] + "', by " + response[n]['author'] + ".")        
Example #22
0
async def gstart(ctx):
  await ctx.send("Let's start with this giveaway! Answer these questions within 15 seconds!")

  questions = ["Which channel should it be hosted in?", "What should be the duration of the giveaway? (s|m|h|d)", "What is the prize of the giveaway?"]

  answers = []

  def check(m):
    return m.author == ctx.author and m.channel == ctx.channel

  for i in questions:
    await ctx.send(i)

    try:
      msg = await client.wait_for('messsage', timeout=15.0, check=check)
    except asyncio.TimeoutError:
      await ctx.send('You didn\'t answer in time, please be quicker next time!')
      return
    else: 
      answers.append(msg.content)

  try:
    c_id = int(answers[0][2:-1])
  except:
    await ctx.send(f"You didn't mention a channel properly. Do it like this {ctx.channel.mention} next time.")
    return

  channel = client.get_channel(c_id)

  time = convert(answers[1])
  if time == -1:
    await ctx.send(f"You didn't answer with a proper unit. Use (s|m|h|d) next time!")
    return
  elif time == -2:
    await ctx.send(f"The time just be an integer. Please enter an integer next time.")
    return
  
  prize = answers[2]

  await ctx.send(f"The giveaway will be in {channel.mention} and will last {answers[1]} seconds!")

  embed = discord.embed(title = "Giveaway!", description = f"{prize}", color = ctx.author.color)

  embed.add_field(name = "Hosted by:", value = ctx.author.mention)

  embed.set_footer(text = f"Ends {answers[1]} from now!")

  my_msg = await channel.send(embed = embed)

  await my_msg.add_reaction("🎉")

  await asyncio.sleep(time)

  new_msg = await channel.fetch_message(my_msg.id)

  users = await new_msg.reactions[0].users().flatten()
  users.pop(users.index(client.user))

  winner = random.choice(users)

  await channel.send(f"Congratulations! {winner.mention} won the prize: {prize}!")
Example #23
0
    async def help(self, ctx, *cog):
        if not cog:
            culorz = [0x9750C7, 0x000066, 0xA200FF, 0x0008FF]
            embed = discord.Embed(color=random.choice(culorz),
                                  timestamp=ctx.message.created_at)
            cugz_desc = ''
            for x in self.bot.cogs:
                cugz_desc += f"**{x}** - {self.bot.cogs[x].__doc__}\n"
            embed.set_author(name=f"Help! - {ctx.author}",
                             icon_url=self.bot.user.avatar_url)

            embed.set_thumbnail(url=ctx.author.avatar_url)

            embed.add_field(name=f'PhysixsFun Commands!',
                            value=cugz_desc[0:len(cugz_desc) - 1],
                            inline=True)

            await ctx.message.author.send(embed=embed)
        else:
            if len(cog) > 1:
                embed = discord.embed(title='Error',
                                      description='Too Many Cogs!')
                await ctx.message.author.send('', embed=embed)
            else:
                found = False
                for x in self.bot.cogs:
                    for y in cog:
                        if x == y:
                            culorz = [0x9750C7, 0x000066, 0xA200FF, 0x0008FF]
                            embed = discord.Embed(
                                color=random.choice(culorz),
                                timestamp=ctx.message.created_at)
                            embed.set_author(name=f"Help! - {ctx.author}",
                                             icon_url=self.bot.user.avatar_url)

                            embed.set_thumbnail(url=ctx.author.avatar_url)
                            scog_info = ''
                            for c in self.bot.get_cog(y).get_commands():
                                if not c.hidden:
                                    scog_info += f'**{c.name}** - {c.help}\n'
                            embed.add_field(
                                name=
                                f'{cog[0]} - {self.bot.cogs[cog[0]].__doc__}',
                                value=scog_info)
                            found = True
            if not found:
                for x in self.bot.cogs:
                    for c in self.bot.get_cog(x).get_commands():
                        if c.name == cog[0]:
                            culorz = [0x9750C7, 0x000066, 0xA200FF, 0x0008FF]
                            embed = discord.Embed(
                                color=random.choice(culorz),
                                timestamp=ctx.message.created_at)
                            embed.set_author(name=f"Help! - {ctx.author}",
                                             icon_url=self.bot.user.avatar_url)

                            embed.set_thumbnail(url=ctx.author.avatar_url)
                            embed.add_field(
                                name=f'{c.name} - {c.help}',
                                value=
                                f"Proper Syntax:\n`{c.qualified_name} {c.signature}`"
                            )
                    found = True
                if not found:
                    culorz = [0x9750C7, 0x000066, 0xA200FF, 0x0008FF]
                    embed = discord.Embed(color=random.choice(culorz),
                                          timestamp=ctx.message.created_at)
                    embed.set_author(name=f"Help! - {ctx.author}",
                                     icon_url=self.bot.user.avatar_url)

                    embed.set_thumbnail(url=ctx.author.avatar_url)

                    embed.add_field(name='Error', value='`Thats not a cog!`')
                    await ctx.message.author.send(embed=embed)
            await ctx.message.author.send(embed=embed)
Example #24
0
async def get_menu():
    r = await fetch("https://menus.calpolycorporation.org/805kitchen/")
    soup = BeautifulSoup(r, 'html.parser')
    embed = discord.Embed(title='805 Kitchen Menu')
    lst = []
    fname = ''
    fval = ''
    current_embed_empty = True
    for s in soup.find_all('h3'):
        if s.get_text() != 'Legend':
            embed.description = s.get_text()
    lst.append(embed)
    embed = discord.Embed(title='')
    embed_length = 0
    num_fields = 0
    for s in soup.find_all(['h2', 'h4', 'p']):
        premsg = s.get_text()
        premsg = premsg.replace('\t', '')
        premsg = re.sub('\n+', '', premsg)
        premsg = premsg.strip()
        if s.name == 'h2':
            if len(embed.title) > 0:
                if not current_embed_empty:
                    lst.append(embed)
                embed_length = 0
                embed = discord.Embed(title='')
                current_embed_empty = True
            embed.title = '**' + premsg + '**'
            embed_length += len(premsg) + 4
        elif s.name == 'h4':
            if len(fname) > 0:
                if len(fval) == 0:
                    fval += '[empty]'
                else:
                    current_embed_empty = False
                embed_length += len(fname) + len(fval)
                embed.add_field(name=fname, value=fval, inline=False)
                fval = ''
            fname = premsg
        elif s.name == 'p':
            if (len(fval) + len(premsg) + 64 > 1024):
                embed.add_field(name=fname, value=fval, inline=False)
                fval = ''
                fname = '--'
            for img in s.find_all('img'):
                if img['alt'] == 'Vegetarian':
                    premsg += ' <:vegetarian:499693084117041153>'
                if img['alt'] == 'Vegan':
                    premsg += ' <:vegan:499693108825554945>'
            fval += premsg + '\n'
        if embed_length + len(fname) + len(fval) > 5500 or len(embed.fields) > 23:
            # Add current embed to list and start a new one
            if not current_embed_empty:
                lst.append(embed)
            embed = discord.embed(title='')
            embed_length = 0
            current_embed_empty = True
    if len(fname) > 0:
        if len(fval) == 0:
            fval += '[empty]'
        embed.add_field(name=fname, value=fval, inline=False)
    if not current_embed_empty:
        lst.append(embed)
    return lst
Example #25
0
    async def MakePoll(ctx):
        if ctx.message.author.server_permissions.kick_member:
            await botAdmin.send_message(
                ctx.message.channel,
                "Did you really think I'd let you do that? You're not high enough in the server to use this. 😑"
            )
            return (0)

        channelTarget = getPollChannel(ctx.message.server.id)

        if channelTarget == 0:
            await botPolls.send_message(
                ctx.message.channel,
                "```POLL CHANNEL NOT INITIALIZED. USE ?help setPollChannel```")
            return 0

        if channelTarget == -1:
            await botPolls.send_message(
                ctx.message.channel,
                "```BOT NOT INITIALIZED. USE ?help authBot```")
            return 0

        await botPolls.send_message(
            ctx.message.channel,
            "```TYPE (1/2) FOR (\"Y/N\" OR \"OPTIONS\")```")
        typePollsMsg = await botPolls.wait_for_message(
            author=ctx.message.author, channel=ctx.message.channel)

        try:
            typePoll = int(typePollMsg.content)
        except:
            await botPolls.send_message(ctx.message.channel, "```ABORTED```")
            return (0)

        if (typePoll != 1) and (typePoll != 2):
            await botPolls.send_message(ctx.message.channel,
                                        "```ENTER EITHER 1 OR 2. ABORTED```")
            return (0)

        pollQuestion = []

        if (typePoll == 1):
            await botPolls.send_message(ctx.message.channel,
                                        "```ENTER THE POLL QUESTION:```")
            pollQuestionMsg = await botPolls.wait_for_message(
                author=ctx.message.author, channel=ctx.message.channel)
            pollQuestion.append(pollQuestionMsg.content)

            if (pollQuestionMsg.content.lower() == "exitblue"):
                await botPolls.send_message(ctx.message.channel,
                                            "```ABORTED```")
                return (0)

        if (typePoll == 2):
            await botPolls.send_message(ctx.message.channel,
                                        "```ENTER THE POLL QUESTION:```")
            pollQuestionMsg = await botPolls.wait_for_message(
                author=ctx.message.author, channel=ctx.message.channel)
            pollQuestionappend(pollQuestionMsg.content)
            Options = []

            if (pollQuestionMsg.content.lower() == "exitblue"):
                await botPolls.send_message(ctx.message.channe,
                                            "```ABORTED```")
                return (0)

            await botPolls.send_message(
                ctx.message.channel, "OPTIONS (IF DONE, TYPE completedPoll):")

            optionsMsg = await botPolls.wait_for_message(
                author=ctx.message.author, channel=ctx.message.channel)

            if (optionsMsg.content.lower() == "exitblue"):
                await botPolls.send_message(ctx.message.channel,
                                            "```ABORTED```")
                return (0)

            count = 1
            while (optionsMsg.content.lower() != "completedpoll"):
                if (count > 9):
                    break
                Options.append(optionsMsg.content)

                optionsMsg = await botPolls.wait_for_message(
                    author=ctx.message.author, channel=ctx.message.channel)

                if (optionsMsg.content.lower() == "exitblue"):
                    await botPolls.send_message(ctx.message.channel,
                                                "```ABORTED```")
                    return (0)

                count += 1

            await botPolls.send_message(ctx.message.channel, "```COMPLETED```")

            #Create Embed
            pollEmbedTitle = str(ctx.message.author) + "'s Poll"
            pollEmbedColour = discord.Colour.blue()
            pollEmbedQuestion = ''.join(pollQuestion)
            pollEmbedThumbnail = "https://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Question_mark_white-transparent.svg/2000px-Question_mark_white-transparent.svg.png"

            sendPollEmbed = discord.embed(title=pollEmbedTitle,
                                          description=pollEmbedQuestion,
                                          colour=pollEmbedColour)
            sendPollEmbed.set_thumbnail(url=pollEmbedThumbnail)

            #START POLL CREATIONS
            if (typePoll == 1):
                """#👎👍#"""

                sendPollEmbed.add_field(name="To agree, react with", value="👍")
                sendPollEmbed.add_field(name="To disagree, react with",
                                        value="👎")

                addReactToMsg = await botPolls.send_message(
                    destination=channelTarget, embed=pollEmbedQuestion)

                await botPolls.add_reaction(addReactToMsg, '👍')
                await botPolls.add_reaction(addReactToMsg, '👎')

            if (typePoll == 2):
                """1\u20e3 to 9\u20e3"""
                unicodeNum = "\u20e3"

                for i in range(0, len(Options), 1):
                    sendPollEmbed.add_field(name=str(i + 1) + unicodeNum,
                                            value=Options[i])

                addReactToMsg = await botPolls.send_message(
                    destination=channelTarget, embed=pollEmbedQuestion)

                for i in range(0, len(Options), 1):
                    await addReactToMsg.add_reaction(addReactToMsg.id,
                                                     str(i + 1) + unicodeNum)