def pollCommand(self, ctx): embed = GG.EmbedWithAuthor(ctx) embed.title = "Easily added polls for your server." embed.add_field( name="poll option 1", value= f"``{self.bot.get_server_prefix(ctx.message)}poll <text>``\nAdds 👍, 👎, 🤷 to your text, for questions that don't need specific answers.", inline=False) embed.add_field( name="poll option 2", value="``" + self.bot.get_server_prefix(ctx.message) + "poll {title} [answer1] [answer2] ... [answer20]``\nThis command can be used to create a poll with a specific title and specific answers. Note that this command supports up to 20 answers. and the {} around the title and [] around the answers are **required**", inline=False) embed.set_footer( text= 'These reactions are available for 60 seconds, afterwards it will stop responding.\n📔 Returns to ' 'the main menu.\n❌ Deletes this message from chat.') return embed
async def invite(self, ctx): em = GG.EmbedWithAuthor(ctx) em.title = 'Invite Me!' em.description = "Hi, you can easily invite me to your own server by following [this link](" \ "https://discordapp.com/oauth2/authorize?client_id=602774912595263490&scope=bot&permissions" \ "=805412928)!\n\nOf the 5 permissions asked, 4 are optional and 1 mandatory for optimal " \ "usage of the capabilities of the bot.\n\n**Mandatory:**\n__Manage Messages__ - this allows the " \ "bot to remove messages from other users.\n\n**Optional:**\n__Manage Webhooks__ - There are 2 " \ "ways for the quote command to function. One where it will use a webhook to give a reply as " \ "the person who quoted the message. Or one where it will just reply in text, but as the bot.\n\n" \ "__Attach Files__ - Some commands or replies will let the bot attach images/files, " \ "without this permission it will not be able too.\n\n" \ "__Add Reactions__ - For the Anon/Delivery the bot requires to be able to add reactions to " \ "messages that are send.\n\n" \ "__Manage Roles__ - For the Reaction Roles, the bot needs to be able to give users a role.\n\n" \ "__Read History__ - For some things to work (edit message, add reactions) the bot requires " \ "to be able to read the history of the channel. If it lacks this permission, but does have. " \ "Add Reactions, it will pelt you with 'Permission not found.'" await ctx.send(embed=em)
async def permissionCheckInChannel(self, ctx): mm = ctx.guild.me.permissions_in(ctx.channel).manage_messages mw = ctx.guild.me.permissions_in(ctx.channel).manage_webhooks af = ctx.guild.me.permissions_in(ctx.channel).attach_files ar = ctx.guild.me.permissions_in(ctx.channel).add_reactions em = GG.EmbedWithAuthor(ctx) em.title = "Permissions" if mm: em.add_field(name="Manage_Message", value=f"{mm}") else: em.add_field( name="Manage_Message", value= f"You should really give me this permission, as it's a mandatory permission. I will have noted this to my owner." ) em.add_field(name="Manage_Webhooks", value=f"{mw}") em.add_field(name="Attach_Files", value=f"{af}") em.add_field(name="Add_Reactions", value=f"{ar}") await ctx.send(embed=em)
async def dictionary(self, ctx, *, search): with requests.Session() as s: resp = s.get(DATA_SRC + search) try: result = resp.json() except: await ctx.send( f"One of the following three errors occurred (in order of most likely happening)\n" f"1. I have reached my API calls per minute, please try again in a bit.\n" f"2. Google Dictionary does not contain a definition of your search query (`{search}`)\n" f"3. You might have made a typo...\n" f"All 3 options are easily verifiable through Google itself." ) else: for i in range(len(result)): current = result[i] word = current['word'] try: phonetic = current['phonetic'] except: phonetic = "no pronunciation available." embed = GG.EmbedWithAuthor(ctx) embed.title = word.capitalize() embed.description = phonetic meaning_ = current['meaning'] for x in meaning_.keys(): await self.getExampleAndDefinition(embed, meaning_, x) if current.get('origin') is not None: embed.add_field(name="Origin", value=current['origin'].capitalize(), inline=False) embed.set_footer( text=f"Source: Google Dictionary (Unofficial API)") await ctx.send(embed=embed)
async def currencyParser(ctx, result, icon): embed = GG.EmbedWithAuthor(ctx) embed.title = f"{result['currencyTypeName']}" embed.set_thumbnail(url=f"{icon['icon']}") # embed.add_field(name="Pay", value=f"{result['chaosEquivalent']}") receive = result['receive']['value'] float(format(receive, '.2f')) pay = str(result['pay']['value']) try: pay = pay.replace('.','') paySplit = pay.split('e-') for x in range(int(paySplit[1])): pay = "0" + pay pay = pay[:1] + "." + pay[1:] pay = pay[:10] except IndexError: pay = str(result['pay']['value']) embed.add_field(name="Buying", value=f"Pay {receive} Chaos\nGet 1 {result['currencyTypeName']}") embed.add_field(name="Selling", value=f"Sell {pay} {result['currencyTypeName']}\n Get 1 Chaos") # embed.add_field(name="Exalted", value=f"{result['exalted']}") embed.add_field(name="Price change", value=f"{result['receiveSparkLine']['totalChange']}%") return embed
async def invite(self, ctx): em = GG.EmbedWithAuthor(ctx) em.title = 'Invite Me!' em.description = "Hi, you can easily invite me to your own server by following [this link](https://discordapp.com/oauth2/authorize?client_id=624228069866995712&scope=bot&permissions=536977472)!\n\n" await ctx.send(embed=em) await GG.upCommand("invite")
async def invite(self, ctx): em = GG.EmbedWithAuthor(ctx) em.title = 'Invite Me!' em.description = "Hi, you can easily invite me to your own server by following [this link]()!\n\n" await ctx.send(embed=em) await GG.upCommand("invite")