async def work(self, ctx): isSuccessful = random.choice([True, False, True, False, True, False]) amount = int(random.randint(15, 50) * random.uniform(0.95, 2.95)) embed = libneko.Embed( title= f"Work {'Successful <:le:808638475229986876>' if isSuccessful else 'Failed <:nogis:808638474646978560>'}" ) if isSuccessful: embed.color = random.choice( [Color.green(), Color.blue(), Color.blurple()]) embed.add_field(name="Outcome:", value=random.choice( workOutcome[isSuccessful]).format( ctx.author, amount)) await self.bot.eco.edit_money(ctx.author.id, amount, "wallet", "add") else: embed.color = random.choice( [Color.red(), Color.orange(), 0xffff00]) embed.add_field(name="Outcome:", value=random.choice( workOutcome[isSuccessful]).format(ctx.author)) embed.set_footer(icon_url=str(ctx.author.avatar_url), text=f"Invoked by {ctx.author}") try: await ctx.send(f"{ctx.author.mention}", embed=embed) except discord.errors.Forbidden: await ctx.send( f"{ctx.author.mention}, I am unable to send the requested data! Please grant the bot the \"Embed Links\" permission or ask an admin / moderator to do so." )
async def timer(self, ctx): """ Gets the Next Timer! :param ctx: :return: """ next_timer = Timer.objects.filter( corp_timer=False, eve_time__gte=datetime.datetime.utcnow().replace( tzinfo=timezone.utc)).first() time_until = pendulum.now(tz="UTC").diff_for_humans( next_timer.eve_time, absolute=True) embed = Embed(title="Next Timer") embed.description = next_timer.details if next_timer.objective == "Friendly": embed.colour = Color.blue() elif next_timer.objective == "Hostile": embed.colour = Color.red() else: embed.colour = Color.white() try: embed.set_footer(text="Added By {0}".format( next_timer.eve_character.character_name)) except Exception as e: logger.error(e) pass embed.add_field(name="Structure:", value=next_timer.structure) embed.add_field(name="Location:", value="{0} - {1}".format(next_timer.system, next_timer.planet_moon)) embed.add_field(name="Eve Time:", value=next_timer.eve_time.strftime("%Y-%m-%d %H:%M"), inline=False) return await ctx.send(embed=embed)
async def _media_search_(self, ctx, *args): print(str(args[0])) search = media_search(query=f'{args[0]}')['items'] alpha_xi = search[0] alpha_xo = search[1] alpha_bi = search[2] embed = discord.Embed( title=alpha_xi["data"][0]["title"], description=f"{ctx.author.mention}, here's what I got!", color=Color.blue()) embed.set_image(url=alpha_xi['links'][0]['href']) embed.add_field(name="Description", value=alpha_xi["data"][0]['description']) await ctx.send(embed=embed) embed = discord.Embed(title=alpha_xo["data"][0]["title"], color=Color.blue()) embed.set_image(url=alpha_xo['links'][0]['href']) embed.add_field(name="Description", value=alpha_xo["data"][0]['description']) await ctx.send(embed=embed) embed = discord.Embed(title=alpha_bi["data"][0]["title"], color=Color.blue()) embed.set_image(url=alpha_bi['links'][0]['href']) embed.add_field(name="Description", value=alpha_bi["data"][0]['description']) await ctx.send(embed=embed)
async def auth(self, ctx): """ Returns a link to the AllianceAuth Install Used by many other Bots and is a common command that users will attempt to run. """ await ctx.trigger_typing() embed = Embed(title="AllianceAuth") embed.set_thumbnail( url= "https://assets.gitlab-static.net/uploads/-/system/project/avatar/6840712/Alliance_auth.png?width=128" ) embed.colour = Color.blue() embed.description = "All Authentication functions for this Discord server are handled through our Alliance Auth install" regex = r"^(.+)\/d.+" matches = re.finditer(regex, settings.DISCORD_CALLBACK_URL, re.MULTILINE) for m in matches: url = m.groups() embed.add_field(name="Auth Link", value="[{}]({})".format(url[0], url[0]), inline=False) return await ctx.send(embed=embed)
async def list_role(self, ctx): """ list roles from a channel. """ await ctx.message.channel.trigger_typing() input_string = ctx.message.content[11:] channel_name = get(ctx.guild.channels, name=input_string) roles = {} if channel_name: for role in channel_name.overwrites: roles[role.name] = {} overides = channel_name.overwrites_for(role) for _name, _value in overides: if _value is not None: roles[role.name][_name] = _value pass embed = Embed(title=f"'{channel_name.name}' Channel Roles") embed.colour = Color.blue() message = "" for key, role in roles.items(): _msg = f"\n`{key}` Role:\n" for r, v in role.items(): _msg += f"{r}: {v}\n" message += _msg embed.description = message return await ctx.send(embed=embed)
async def kinsy(self, ctx): """ Returns the Kinsy Video """ await ctx.trigger_typing() embed = Embed(title="JUST JUMP IN!!") embed.set_thumbnail( url= "https://images.evetech.net/characters/1630472146/portrait?size=128" ) embed.colour = Color.blue() embed.description = "Just Jump In And WARP TO ME!!" url = get_site_url() embed.add_field( name="The Link", value= "https://cdn.discordapp.com/attachments/685827175626440735/949349523774398565/My_Movie.mp4" .format(url, url), inline=False) return await ctx.send(embed=embed)
async def add_role(self, ctx: Context, role: Role): if self.config.sismember(f"allowed_roles:{ctx.guild.id}", role.id): em = Embed(title="Polls Administration", description= f"{role.mention} is already allowed to conduct polls.", color=Color.red()) await ctx.send(embed=em, delete_after=5) else: self.config.sadd(f"allowed_roles:{ctx.guild.id}", role.id) em = Embed( title="Polls Administration", description=f"{role.mention} is now allowed to conduct polls.", color=Color.green()) await ctx.send(embed=em, delete_after=5)
async def reroll_all(ctx, value: int = None): if await bot.is_owner(ctx.author): desc = f"Reroll **all** totems ?\n\nType **yes** to proceed, or **no** to cancel." embed = discord.Embed(description=desc, color=Color.red()) embed.set_footer(text=f"Requested by {ctx.author}") await ctx.send(embed=embed) check = lambda m: m.author == ctx.author and m.channel == ctx.channel and utils.yes_or_no( m.content) try: reply = await bot.wait_for("message", check=check, timeout=5) except asyncio.TimeoutError: pass else: if reply.content.lower() == "yes": settings = db.get_settings() if value is not None: count = value elif settings: count = settings['global_rc'] + 1 else: count = 101 db.update_settings(global_rc=count, last_update=utils.now()) else: m = await ctx.send("**Nice try**") await asyncio.sleep(2) await ctx.channel.delete_messages((ctx.message, m))
async def list_role(self, ctx): """ list roles from a channel. """ if ctx.message.author.id not in app_settings.get_admins( ): # https://media1.tenor.com/images/1796f0fa0b4b07e51687fad26a2ce735/tenor.gif return await ctx.message.add_reaction(chr(0x1F44E)) await ctx.message.channel.trigger_typing() input_string = ctx.message.content[11:] channel_name = get(ctx.guild.channels, name=input_string) roles = {} if channel_name: for role in channel_name.overwrites: roles[role.name] = {} overides = channel_name.overwrites_for(role) for _name, _value in overides: if _value is not None: roles[role.name][_name] = _value pass embed = Embed(title=f"'{channel_name.name}' Channel Roles") embed.colour = Color.blue() message = "" for key, role in roles.items(): _msg = f"\n`{key}` Role:\n" for r, v in role.items(): _msg += f"{r}: {v}\n" message += _msg embed.description = message return await ctx.send(embed=embed)
async def sg_audit(self, ctx): """ Smart Group Audit of a user Input: [group name]|[main_character] """ if ctx.message.channel.id not in settings.ADMIN_DISCORD_BOT_CHANNELS: return await ctx.message.add_reaction(chr(0x1F44E)) input_name = ctx.message.content[10:].split("|") embed = Embed( title="{group} Audit: {character_name}".format( character_name=input_name[1], group=input_name[0]) ) try: char = EveCharacter.objects.get(character_name=input_name[1]) group = Group.objects.get(name=input_name[0]) try: main = char.character_ownership.user checks = group.smartgroup.run_check_on_user(main) embed.colour = Color.blue() for c in checks: msg = c.get("message") if not msg: msg = "Pass: {}".format(c.get("check")) embed.add_field( name="{} (Pass: {})".format(c.get("filter").filter_object.description, c.get("check")), value=msg, inline=False ) return await ctx.send(embed=embed) except ObjectDoesNotExist as e: return await ctx.send("Member or Group issues") except EveCharacter.DoesNotExist: embed.colour = Color.red() embed.description = ( "Character **{character_name}** does not exist in our Auth system" ).format(character_name=input_name[1]) return await ctx.send(embed=embed)
async def ping(ctx): random.seed(ctx.author.id) r = lambda: random.randint(0, 255) rgb = (r(), r(), r()) desc = f"Pong ! {round(bot.latency * 1000)} ms" embed = discord.Embed(description=desc, color=Color.from_rgb(*rgb)) embed.set_footer(text=f"Requested by {ctx.author}") await ctx.send(embed=embed)
async def lookup(self, ctx): """ Gets Auth data about a character Input: a Eve Character Name """ input_name = ctx.message.content[8:] char = EveCharacter.objects.get(character_name=input_name) main = char.character_ownership.user.profile.main_character state = char.character_ownership.user.profile.state.name groups = char.character_ownership.user.groups.all().values_list( 'name', flat=True) try: discord = "<@{}>".format(char.character_ownership.user.discord.uid) except: discord = "unknown" alts = char.character_ownership.user.character_ownerships.all( ).select_related('character', 'zkill').values_list( 'character__character_name', 'character__corporation_ticker', 'character__character_id', 'character__corporation_id', 'character__zkill__zk_12m', 'character__zkill__zk_3m') zk12 = 0 zk3 = 0 for alt in alts: if alt[4]: zk12 += alt[4] zk3 += alt[5] embed = Embed(title="Character Lookup") embed.colour = Color.blue() embed.description = "**{0}** is linked to **{1} [{2}]** (State: {3})".format( char, main, main.corporation_ticker, state) alt_list = [ "[{}](https://evewho.com/character/{}) *[ [{}](https://evewho.com/corporation/{}) ]*" .format(a[0], a[2], a[1], a[3]) for a in alts ] for idx, names in enumerate( [alt_list[i:i + 6] for i in range(0, len(alt_list), 6)]): if idx < 21: embed.add_field(name="Linked Characters {}".format(idx + 1), value=", ".join(names), inline=False) else: embed.add_field( name= "Linked Characters {} **( Discord Limited There are More )**" .format(idx), value=", ".join(names), inline=False) break embed.add_field(name="Groups", value=", ".join(groups), inline=False) embed.add_field(name="12m Kills", value=zk12, inline=True) embed.add_field(name="3m Kills", value=zk3, inline=True) embed.add_field(name="Discord Link", value=discord, inline=False) return await ctx.send(embed=embed)
async def get_good_q(self, ctx): data = get(url="https://zenquotes.io/api/random") q = json.loads(data.text)[0]["q"] a = json.loads(data.text)[0]["a"] embed = discord.Embed( title="Inspire yeself!", description=f"{ctx.author.mention}, time for some inspiration!", color=Color.dark_teal()) embed.add_field(name=f"Quote by {a}", value=f"{q}", inline=False) await ctx.send(embed=embed)
def __init__(self, name: str, color_code: int = 0x000000, permission: PermissionGroup = None, hoist: bool = False, mentionable: bool = False): self.name = name self.color = Color(color_code) self.permissions = permission self.hoist = hoist self.mentionable = mentionable self.id = -1
async def totem(ctx, user: discord.User = None): guild = db.find_guild(ctx.guild) if guild: lang = pokedex.Language(guild['lang']) else: lang = pokedex.Language.DEFAULT db.update_guild(ctx.guild, lang=lang.value, name=ctx.guild.name) user = user or ctx.author user_db = db.find_user(user) settings = db.get_settings() rc = user_db['reroll_count'] if user_db else 0 global_rc = settings['global_rc'] if settings else 100 random.seed(user.id + rc + global_rc) head = str(random.randint(pokedex.Pokedex.MIN_ID, pokedex.Pokedex.MAX_ID)) body = str(random.randint(pokedex.Pokedex.MIN_ID, pokedex.Pokedex.MAX_ID)) color = str(random.randint(pokedex.Pokedex.MIN_ID, pokedex.Pokedex.MAX_ID)) head_id, head = dex.resolve(head, lang) body_id, body = dex.resolve(body, lang) color_id, color = dex.resolve(color, lang) last_queries[ctx.message.channel] = head, body, color file = api.PokeFusion.get_fusion_as_file(head_id=head_id, body_id=body_id, color_id=color_id) if file: if color_id == "0": filename = f"fusion_{head_id}{head}_{body_id}{body}.png" else: filename = f"fusion_{head_id}{head}_{body_id}{body}_{color_id}{color}.png" f = discord.File(fp=file, filename=filename) c = Color.from_rgb(*utils.get_dominant_color(file)) share_url = f"http://pokefusion.japeal.com/{body_id}/{head_id}/{color_id}" embed = discord.Embed(title=f"{user.display_name}'s totem", url=share_url, color=c) embed.set_thumbnail(url=user.avatar_url) embed.add_field(name="Head", value=f"{head.title()} #{head_id}", inline=True) embed.add_field(name="Body", value=f"{body.title()} #{body_id}", inline=True) if color_id != "0": embed.add_field(name="Colors", value=f"{color.title()} #{color_id}") embed.set_image( url=f"attachment://{filename.replace('(', '').replace(')', '')}") embed.set_footer(text=f"Requested by {ctx.author}") await ctx.send(embed=embed, file=f)
async def jumpbridges(self, ctx): """ List all known Jumpbridges's """ embed = Embed(title=f"Known Jump Bridges") embed.colour = Color.blue() embed.description = "These do not auto populate. Please advise admins of ommisions/errors!\n\n" jbs = MapJumpBridge.objects.all().select_related( 'from_solar_system', 'to_solar_system', 'owner') for jb in jbs: embed.description += f"`{jb.from_solar_system.name}` > `{jb.to_solar_system}` [{jb.owner.name}]\n" return await ctx.send(embed=embed)
async def list_roles(self, ctx: Context): role_ids = sorted( self.config.smembers(f"allowed_roles:{ctx.guild.id}")) if role_ids: roles = "\n".join([ ctx.guild.get_role(int(role_id)).mention for role_id in role_ids ]) em = Embed( title="Polls Administration", description= f"The following roles are allowed to conduct polls:\n{roles}", color=Color.green()) await ctx.send(embed=em, delete_after=5) else: em = Embed( title="Polls Administration", description= "There are currently no roles allowed to conduct polls.", color=Color.red()) await ctx.send(embed=em, delete_after=5)
async def menu(ctx, bot): emoji = ["1️⃣", "2️⃣", "3️⃣", "❌", "✅"] def checkValid(reaction, user): return ( ctx.message.author == user and q.id == reaction.message.id and reaction.emoji in emoji ) embed = discord.Embed(title="GESTION PERSONAE", color=Color.dark_teal()) embed.add_field( name="1️⃣ | Création", value="Permet de débuter la création d'un Persona", inline=False, ) embed.add_field( name="2️⃣ | Édition", value="Permet d'éditer un Persona", inline=False, ) embed.add_field( name="3️⃣ | Suppression", value="Permet de supprimer un Persona", inline=False ) embed.set_footer( text="Cliquez sur la réaction pour choisir !\n ❌ Pour quitter le menu." ) q = await ctx.send(embed=embed) i = 0 while emoji[i] != "✅": await q.add_reaction(emoji[i]) i += 1 reaction, user = await bot.wait_for("reaction_add", timeout=300, check=checkValid) if reaction.emoji == "1️⃣": # Création await q.delete() await webhook_create(ctx, bot) return elif reaction.emoji == "2️⃣": # Edition await q.delete() await menu_edit(ctx, bot) return elif reaction.emoji == "3️⃣": # Deletion await q.delete() await gestion.webhook_delete(ctx, bot) return else: await ctx.send("Annulation !") return
class Colors: red = Color.red() orange = Color.orange() default = Color(0x006e7a) log_channel = Color(0x6203fc) permission = Color(0x2f9c00) error = Color(0xff0000) warning = Color(0xffd500) @staticmethod def member(member: Member): return member.color
async def embed(self, ctx: Context, *, content: str): data = content.split('#') if len(data) != 4: await ctx.send(ctx.command.usage) return author, title, message, date = data await ctx.message.delete() embed = Embed( title=title, type='rich', colour=Color.dark_green(), ) embed.set_author(name=author) embed.add_field(name='Aufgabe/Nachricht', value=message) embed.add_field(name='Datum', value=date) embed.set_footer(text=self.bot.signature) await ctx.send(embed=embed)
async def route(self, ctx): """ Find route in eve with JB's """ input_names = ctx.message.content[7:].split(":") start = MapSystem.objects.get(name=input_names[0]) end = MapSystem.objects.get(name=input_names[1]) message = routes.route(start.system_id, end.system_id) dotlan_url = "https://evemaps.dotlan.net/route/{}".format( message.get("dotlan")) embed = Embed(title=f"{start.name} to {end.name}") embed.colour = Color.blue() embed.description = "Shortest Route is: {} Jumps\n\n{}".format( message.get("length"), message.get("path_message")) embed.add_field(name="Dotlan", value=f"[Route Link]({dotlan_url})") return await ctx.send(embed=embed)
async def pokemon(ctx, pkmn="random"): guild = db.find_guild(ctx.guild) if guild: lang = pokedex.Language(guild['lang']) else: lang = pokedex.Language.DEFAULT db.update_guild(ctx.guild, lang=lang.value, name=ctx.guild.name) result = dex.resolve(pkmn, lang) if result: dex_num, pkmn = result file = api.PokeFusion.get_sprite_as_file(pkmn_id=dex_num) filename = f"sprite_{dex_num}_{pkmn}.png" f = discord.File(fp=file, filename=filename) color = Color.from_rgb(*utils.get_dominant_color(file)) embed = discord.Embed(title=f"{pkmn.title()} #{dex_num}", color=color) embed.set_image( url=f"attachment://{filename.replace('(', '').replace(')', '')}") embed.set_footer(text=f"Requested by {ctx.author}") await ctx.send(embed=embed, file=f)
async def altcorp(self, ctx): """ Gets Auth data about an altcorp Input: a Eve Character Name """ if ctx.message.channel.id not in settings.ADMIN_DISCORD_BOT_CHANNELS: return await ctx.message.add_reaction(chr(0x1F44E)) input_name = ctx.message.content[9:] chars = EveCharacter.objects.filter(corporation_name=input_name) own_ids = [settings.DISCORD_BOT_MEMBER_ALLIANCES] alts_in_corp = [] for c in chars: if c.alliance_id not in own_ids: alts_in_corp.append(c) mains = {} for a in alts_in_corp: try: main = a.character_ownership.user.profile.main_character if main.character_id not in mains: mains[main.character_id] = [main, 0] mains[main.character_id][1] += 1 alt_corp_id = a.corporation_id except Exception as e: logger.error(e) pass output = [] base_string = "[{}]({}) [ [{}]({}) ] has {} alt{}" for k, m in mains.items(): output.append( base_string.format(m[0], evewho.character_url(m[0].character_id), m[0].corporation_ticker, evewho.corporation_url(m[0].corporation_id), m[1], "s" if m[1] > 1 else "")) for strings in [output[i:i + 10] for i in range(0, len(output), 10)]: embed = Embed(title=input_name) embed.colour = Color.blue() embed.description = "\n".join(strings) await ctx.send(embed=embed)
async def about(self, ctx): """ All about the bot """ await ctx.trigger_typing() embed = Embed(title="AuthBot: The Authening") embed.set_thumbnail( url= "https://cdn.discordapp.com/icons/516758158748811264/ae3991584b0f800b181c936cfc707880.webp?size=128" ) embed.colour = Color.blue() embed.description = "This is a multi-de-functional discord bot tailored specifically for Alliance Auth Shenanigans." regex = r"^(.+)\/d.+" matches = re.finditer(regex, settings.DISCORD_CALLBACK_URL, re.MULTILINE) for m in matches: url = m.groups() embed.set_footer( text="Lovingly developed for Init.™ by AaronRin and ArielKable") embed.add_field(name="Number of Servers:", value=len(self.bot.guilds), inline=True) embed.add_field(name="Unwilling Monitorees:", value=len(self.bot.users), inline=True) embed.add_field(name="Auth Link", value="[{}]({})".format(url[0], url[0]), inline=False) embed.add_field(name="Version", value="{}@{}".format(__version__, __branch__), inline=False) # embed.add_field( # name="Creator", value="<@318309023478972417>", inline=False # ) return await ctx.send(embed=embed)
async def about(self, ctx): """ All about the bot """ await ctx.trigger_typing() embed = Embed(title="AuthBot: The Authening") embed.set_thumbnail( url= "https://cdn.discordapp.com/icons/713666554629455892/a4c362c2037b239f2c3ef4aeeda9375a.png?size=128" ) embed.colour = Color.blue() embed.description = "This is a multi-de-functional discord bot tailored specifically for miller cunts." regex = r"^(.+)\/d.+" matches = re.finditer(regex, settings.DISCORD_CALLBACK_URL, re.MULTILINE) for m in matches: url = m.groups() embed.set_footer( text="Lovingly developed for V0LTA.™ by Miller Thwots") embed.add_field(name="Number of Servers:", value=len(self.bot.guilds), inline=True) embed.add_field(name="Unwilling Monitorees:", value=len(self.bot.users), inline=True) embed.add_field(name="Auth Link", value="[{}]({})".format(url[0], url[0]), inline=False) embed.add_field(name="Version", value="{}@{}".format(__version__, __branch__), inline=False) # embed.add_field( # name="Creator", value="<@318309023478972417>", inline=False # ) return await ctx.send(embed=embed)
async def auth_slash(self, ctx): """ Returns a link to the AllianceAuth Install Used by many other Bots and is a common command that users will attempt to run. """ embed = Embed(title="AllianceAuth") embed.set_thumbnail( url= "https://assets.gitlab-static.net/uploads/-/system/project/avatar/6840712/Alliance_auth.png?width=128" ) embed.colour = Color.blue() embed.description = "All Authentication functions for this Discord server are handled through our Alliance Auth install" url = get_site_url() embed.add_field(name="Auth Link", value="[{}]({})".format(url, url), inline=False) return await ctx.respond(embed=embed)
async def jf(self, ctx, dest, volume): """ Calculates the cost by m3 for GreenSwarm Express contracts. Valid destinations at this point are: d-o, do, home, d-ojez, and jita """ priceIn = 800 priceOut = 500 minimumValue = 5000000 allowedIn = ['d-o', 'home', 'do', 'd-ojez'] allowedOut = ['jita'] if dest in allowedIn: costs = int(priceIn) * int(volume) elif dest in allowedOut: costs = int(priceOut) * int(volume) else: return await ctx.send('Please select a valid destination. For now, the only valid destnations are \'d-o\', \'home\', \'do\', \'d-ojez\', \'jita\'') if int(costs) < int(minimumValue): costs = 5000000 embed = Embed(title='Cost to transport {} m3 to {}: {:,} isk'.format(volume, dest, costs)) embed.color = Color.green() return await ctx.send(embed=embed)
async def fusion(ctx, head="?", body="?", color="0"): guild = db.find_guild(ctx.guild) if guild: lang = pokedex.Language(guild['lang']) else: lang = pokedex.Language.DEFAULT db.update_guild(ctx.guild, lang=lang.value, name=ctx.guild.name) head_result = dex.resolve(head, lang) body_result = dex.resolve(body, lang) color_result = dex.resolve(color, lang) if color != "0" else (color, "") if None in (head_result, body_result, color_result): head_guess = dex.guess(head, lang)[0] if head_result is None else head body_guess = dex.guess(body, lang)[0] if body_result is None else body color_guess = dex.guess(color, lang)[0] if color_result is None else color body_tmp = body_guess color_tmp = color_guess if color_guess != "0" else "" if body_tmp in pokedex.Pokedex.RANDOM_QUERIES and not color_tmp: body_tmp = "" cmd = utils.strict_whitespace( f"**{bot.command_prefix}f {head_guess} {body_tmp} {color_tmp}**") desc = f"Did you mean {cmd} ?\n\nType **yes** to proceed, or **no** to cancel." embed = discord.Embed(description=desc, color=Color.light_grey()) embed.set_thumbnail(url="https://i.imgur.com/Rcys72H.png") embed.set_footer(text=f"Requested by {ctx.author}") await ctx.send(embed=embed) check = lambda m: m.author == ctx.author and m.channel == ctx.channel and utils.yes_or_no( m.content) try: reply = await bot.wait_for("message", check=check, timeout=60) except asyncio.TimeoutError: pass else: if reply.content.lower() == "yes": await ctx.invoke(fusion, head=head_guess, body=body_guess, color=color_guess) else: h_id, h = head_result b_id, b = body_result c_id, c = color_result last_queries[ctx.message.channel] = h_id, b_id, c_id file = api.PokeFusion.get_fusion_as_file(head_id=h_id, body_id=b_id, color_id=c_id) if file: if c_id == "0": filename = f"fusion_{h_id}{h}_{b_id}{b}.png" else: filename = f"fusion_{h_id}{h}_{b_id}{b}_{c_id}{c}.png" f = discord.File(fp=file, filename=filename) color = Color.from_rgb(*utils.get_dominant_color(file)) share_url = f"http://pokefusion.japeal.com/{b_id}/{h_id}/{c_id}" embed = discord.Embed(title="PokéFusion", url=share_url, color=color) embed.add_field(name="Head", value=f"{h.title()} #{h_id}", inline=True) embed.add_field(name="Body", value=f"{b.title()} #{b_id}", inline=True) if c_id != "0": embed.add_field(name="Colors", value=f"{c.title()} #{c_id}") embed.set_image( url=f"attachment://{filename.replace('(', '').replace(')', '')}" ) embed.set_footer(text=f"Requested by {ctx.author}") await ctx.send(embed=embed, file=f)
bodenshit = 'bodenshits_copypasta.txt' vinnie = 'vinnie_copypasta.txt' # Set up Intents intents = discord.Intents.all() bot = Bot(command_prefix='!', intents=intents) EEMSG = 789236911364505600 CPEMSG = 789236918872703018 CSMSG = 789236932693459014 COLORMSG = 789281035657412619 SDMSG = 789241290411868170 WELCOME = 694552494172536833 Color_Emoji = { "<:invisible:789271633343807488>": ["invisible", Color.dark_theme()], "<:greyple:789271633352589352>": ["greyple", Color.greyple()], "<:white:789271633360977960>": ["white", Color.from_rgb(255, 255, 255)], "<:teal:789271633373298718>": ["teal", Color.teal()], "<:darkteal:789271633356521473>": ["darkteal", Color.dark_teal()], "<:darkgreen:789271633336205342>": ["darkgreen", Color.dark_green()], "<:blurple:789271633356783666>": ["blurple", Color.blurple()], "<:darkblue:789271633373954048>": ["darkblue", Color.dark_blue()], "<:darkpurple:789271633386405908>": ["darkpurple", Color.dark_purple()], "<:purple:789271633436737586>": ["purple", Color.purple()], "<:darkorange:789271633332142091>": ["darkorange",
class Colors: GAME = Color(0x42a5f5) GAME_LIGHT = Color(0x80d6ff) GAME_DARK = Color(0x0077c2) ERROR = Color(0xaa0000)