def waifu(ctx, gender=None, search_for=None, is_otp=False): if ctx.command == "waifu" or gender == "waifu": list_name = "Waifu" end_tag = ["1girl", "solo"] else: list_name = "Husbando" end_tag = ["-1girl", "-female", "1boy", "solo"] result = () path = os.path.join(ctx.bot.config_path, '{} List.yaml'.format(list_name)) char_list = yaml_to_list(path, list_name.lower()) # This is used so they can't get aroun dbeing limited with x cmd # Plus to the odd series to make people actually use other cmds 😠. ignore = ["high-school-dxd", "love-live", "aoki-hagane-no-arpeggio", "kantai-collection", "aikatsu", "akb0048", "idolmaster", "idolmaster-cinderella-girls"] matched = [] if search_for is None: search_for = ctx.args if len(search_for) >= 5 and slugify(search_for) not in ignore: result = filter_per_series(char_list, search_for, 4) if not result: result = random.choice(char_list) name = re.sub("[\(\[].*?[\)\]]", "", result[0]).strip() # Remove () and [] series = result[1].get('series', None) otp_image = result[1].get('otp image', None) if is_otp: return name, series, otp_image start_path = settings.get('image_location', os.path.join(os.path.realpath(__file__), 'images')) path_name = os.path.join(start_path, list_name, slugify(result[0])) end_tag.append(name.replace(" ", "_")) reply_text = "Your {} is {} ({})".format(list_name, name, series) media_args = {'tags': end_tag} reply_media = get_media(path=path_name, ctx=ctx, media_args=media_args) return reply_text, reply_media
def waifu(ctx, gender=None, search_for=None, is_otp=False): """Get a random {OPTION}""" if ctx.command == "waifu" or gender == "waifu": list_name = "Waifu" end_tag = ["1girl", "solo"] else: list_name = "Husbando" end_tag = ["-1girl", "-genderbend", "1boy", "solo"] result = () path = os.path.join(ctx.bot.config_path, '{} List.yaml'.format(list_name)) if "video game" in ctx.args.lower() and list_name == "Waifu": char_list = yaml_to_list(path, "video game") else: char_list = yaml_to_list(path, list_name.lower()) # This is used so they can't get aroun dbeing limited with x cmd # Plus to the odd series to make people actually use other cmds 😠. ignore = ["high-school-dxd", "love-live", "love-live-sunshine" "aoki-hagane-no-arpeggio", "kantai-collection", "aikatsu", "akb0048", "idolmaster", "idolmaster-cinderella-girls"] matched = [] if search_for is None: search_for = ctx.args if len(search_for) >= 5 and slugify(search_for) not in ignore: result = filter_per_series(char_list, search_for, 4) if not result: result = random.choice(char_list) name = re.sub("[\(\[].*?[\)\]]", "", result[0]).strip() # Remove () and [] series = result[1].get('series') otp_image = result[1].get('otp image') if is_otp: return name, series, otp_image start_path = settings.get('image_location', os.path.join(os.path.realpath(__file__), 'images')) path_name = os.path.join(start_path, list_name, slugify(result[0])) end_tag.append(result[0].replace(" ", "_")) reply_text = "Your {} is {} ({})".format(list_name, name, series) media_args = {'tags': end_tag} reply_media = get_media(path=path_name, ctx=ctx, media_args=media_args) return reply_text, reply_media
def fate_servant_cmd(ctx): # NOTE: Still not finished on the list side. start_path = settings.get('image_location', os.path.join(os.path.realpath(__file__), 'images')) team = [] for x in range(0, 3): picked = False while True: rand = random.randint(0, 100) if rand <= 50: picked = random.choice(["Saber", "Archer", "Lancer"]) elif 51 <= rand <= 70: picked = random.choice(["Rider", "Caster", "Assassin"]) elif 71 <= rand <= 90: picked = random.choice(["Berserker", "Alter Ego", "Shielder"]) elif 91 <= rand <= 100: picked = random.choice(["Ruler", "Avenger", "Moon Cancer"]) if picked in team: continue team.append(picked) break final_entries = [] final_images = [] had_false = False for member in team: list_name = "Waifu" # temp no male if member in ["Saber", "Archer", "Lancer", "Rider", "Caster", "Assassin"] and random.randint(0, 100) > 195: list_name = "Husbando" path = os.path.join(ctx.bot.config_path, '{} List.yaml'.format(list_name)) char_list = yaml_to_list(path, "fate/servant/{}".format(member.lower().replace(" ", "_"))) char = random.choice(char_list) path_name = os.path.join(start_path, list_name, slugify(char[0])) image = get_media(path=path_name, media_args={}) if not image: had_false = True final_entries.append(char) final_images.append(image) reply_media = False if not had_false: reply_media = create_otp_image(otp_results=final_images, width_size=0, height_size=1000, is_otp=False) reply_text = "Your Fate/Grand Order Team is:\n{} ({})\n{} ({})\n{} ({})".format( re.sub("[\(\[].*?[\)\]]", "", final_entries[0][0]).strip(), team[0], re.sub("[\(\[].*?[\)\]]", "", final_entries[1][0]).strip(), team[1], re.sub("[\(\[].*?[\)\]]", "", final_entries[2][0]).strip(), team[2]) return reply_text, reply_media
def random_list(ctx): # Male only lists. male_lists = ["shota", "onii"] # Both female and male can be under these. special_male_lists = ["idol", "sensei", "senpai", "kouhai", "yandere", "tsundere"] # Simple way to make sure to not load male list if one of these are used. possible_search = ["love", "idolmaster", "cinderella", "akb0048", "wake", "aikatsu"] # List of lists that don't need to show the series. ignore_series_lists = ["shipgirl", "touhou", "witchgirl", "tankgirl", "vocaloid"] list_name = "Waifu" end_tag = ["1girl", "solo"] args = ctx.message.lower() result = () search_for = "" show_series = False if ctx.command in ignore_series_lists else True support_otp = False # Special per list stuff if ctx.command == "shipgirl": # Default shipgirl to kantai collection only search_for = "Kantai Collection" support_otp = True if "all" in args: search_for = "" elif "aoki" in args: search_for = "Aoki Hagane no Arpeggio" elif ctx.command == "idol": args = args.replace("!", "").replace("@", "a") if "love live sunshine" in args: search_for = "Love Live! Sunshine!!" elif "love live" in args: search_for = "Love Live!" support_otp = True elif "idolmaster" in args: search_for = "Idolmaster" elif "cinderella" in args: search_for = "Idolmaster Cinderella Girls" elif "akb0048" in args: search_for = "AKB0048" elif "wake up" in args: search_for = "Wake Up Girls!" elif "aikatsu" in args: search_for = "Aikatsu!" if (ctx.command in special_male_lists and "male" in args and not "female" in args and not search_for)\ or ctx.command in male_lists: list_name = "Husbando" end_tag = ["-1girl", "-female", "1boy"] elif (ctx.command in special_male_lists and not "female" in args and not search_for): random_gender = random.randint(0, 10) if random_gender > 8: list_name = "Husbando" end_tag = ["-1girl", "-female", "1boy"] if ctx.command in male_lists: list_name = "Husbando" end_tag = ["-1girl", "-female", "1boy"] if support_otp and "otp" in args: list_name = "OTP" if ctx.command == "onee" or ctx.command == "onii": ctx.command = ctx.command + "-chan" path = os.path.join(ctx.bot.config_path, '{} List.yaml'.format(list_name)) char_list = yaml_to_list(path, ctx.command.lower()) if search_for: result = filter_per_series(char_list, search_for, 4) if not result: result = random.choice(char_list) series = result[1].get('series', None) otp_image = result[1].get('otp image', None) start_path = settings.get('image_location', os.path.join(os.path.realpath(__file__), 'images')) if list_name == "OTP": name_one, name_two = result[0].split("(x)") end_tag = ["2girls", "yuri", name_one.replace(" ", "_"), name_two.replace(" ", "_")] list_title = ctx.command.title() + " OTP" name = "{} x {}".format(re.sub("[\(\[].*?[\)\]]", "", name_one).strip(), re.sub("[\(\[].*?[\)\]]", "", name_two).strip()) path_name = os.path.join(start_path, list_name, slugify(name)) else: list_title = ctx.command.title() name = re.sub("[\(\[].*?[\)\]]", "", result[0]).strip() # Remove () and [] end_tag.append(result[0].replace(" ", "_")) path_name = os.path.join(start_path, list_name, slugify(result[0])) if ctx.command == "granblue": reply_text = "{} has joined your party!".format(name) else: reply_text = "Your {} is {}{}".format( list_title.replace("-C", "-c"), # w/e name, "" if not show_series else " ({})".format(series)) media_args = {'tags': end_tag} reply_media = get_media(path=path_name, ctx=ctx, media_args=media_args) return reply_text, reply_media
def random_list(ctx): male_only_lists = ["shota", "onii"] # Both female and male can be under these. both_gender_lists = ["idol", "sensei", "senpai", "kouhai", "yandere", "tsundere"] # Simple way to make sure to not load male list if one of these are used. possible_search = ["love", "idolmaster", "cinderella", "akb0048", "wake", "aikatsu"] # List of lists that don't need to show the series. ignore_series_lists = ["shipgirl", "touhou", "witchgirl", "tankgirl", "vocaloid", "unwrap"] list_name = "Waifu" end_tag = ["1girl", "solo"] args = ctx.message.lower() result = () search_for = "" show_series = False if ctx.command in ignore_series_lists else True support_otp = False skip_online = False # Special per list stuff if ctx.command == "shipgirl": # Default shipgirl to kantai collection only search_for = "Kantai Collection" support_otp = True if "all" in args: search_for = "" elif "aoki" in args: search_for = "Aoki Hagane no Arpeggio" elif ctx.command == "idol": args = args.replace("!", "").replace("@", "a") if "love live sunshine" in args: search_for = "Love Live! Sunshine!!" elif "love live" in args: search_for = "Love Live!" support_otp = True elif "idolmaster" in args: search_for = "Idolmaster" elif "cinderella" in args: search_for = "Idolmaster Cinderella Girls" elif "akb0048" in args: search_for = "AKB0048" elif "wake up" in args: search_for = "Wake Up Girls!" elif "aikatsu" in args: search_for = "Aikatsu!" elif ctx.command == "unwrap": show_series = True end_tag.append("santa_costume") if (ctx.command in both_gender_lists and "male" in args and not "female" in args and not search_for)\ or ctx.command in male_only_lists: list_name = "Husbando" end_tag = ["-1girl", "-female", "1boy"] elif (ctx.command in both_gender_lists and not "female" in args and not search_for): random_gender = random.randint(0, 10) if random_gender > 8: list_name = "Husbando" end_tag = ["-1girl", "-female", "1boy"] if ctx.command in male_only_lists: list_name = "Husbando" end_tag = ["-1girl", "-female", "1boy"] if support_otp and "otp" in args: list_name = "OTP" if ctx.command == "onee" or ctx.command == "onii": ctx.command = ctx.command + "-chan" if ctx.command == "okaa": ctx.command = ctx.command + "-san" path = os.path.join(ctx.bot.config_path, '{} List.yaml'.format(list_name)) char_list = yaml_to_list(path, ctx.command.lower()) if search_for: result = filter_per_series(char_list, search_for, 4) if not result: result = random.choice(char_list) series = result[1].get('series') otp_image = result[1].get('otp image') start_path = settings.get('image_location', os.path.join(os.path.realpath(__file__), 'images')) if list_name == "OTP": name_one, name_two = result[0].split("(x)") end_tag = ["2girls", "yuri", name_one.replace(" ", "_"), name_two.replace(" ", "_")] list_title = ctx.command.title() + " OTP" name = "{} x {}".format(re.sub("[\(\[].*?[\)\]]", "", name_one).strip(), re.sub("[\(\[].*?[\)\]]", "", name_two).strip()) path_name = os.path.join(start_path, list_name, slugify(name)) else: list_title = ctx.command.title() name = re.sub("[\(\[].*?[\)\]]", "", result[0]).strip() # Remove () and [] end_tag.append(result[0].replace(" ", "_")) path_name = os.path.join(start_path, list_name, slugify(result[0])) if ctx.command == "unwrap": path_name = os.path.join(path_name, "christmas") if ctx.command == "granblue": reply_text = "{} has joined your party!".format(name) elif ctx.command == "unwrap": merry_ran_end = ["Merry Christmas!", "Happy Holidays!", "Season's Greetings!", "Merii Kurisumasu!"] reply_text = "{} was in your present ({}). {}".format(name, series, random.choice(merry_ran_end)) else: reply_text = "Your {} is {}{}".format( list_title.replace("-C", "-c").replace("-S", "-s"), # w/e name, "" if not show_series else " ({})".format(series)) media_args = {'tags': end_tag, 'skip_online': skip_online} reply_media = get_media(path=path_name, ctx=ctx, media_args=media_args) return reply_text, reply_media
def random_list(ctx): male_only_lists = ["shota", "onii"] # Both female and male can be under these. both_gender_lists = ["idol", "sensei", "senpai", "kouhai", "yandere", "tsundere", "fate/servant"] # Simple way to make sure to not load male list if one of these are used. possible_search = ["love", "idolmaster", "cinderella", "akb0048", "wake", "aikatsu"] # List of lists that don't need to show the series. ignore_series_lists = ["shipgirl", "touhou", "witchgirl", "tankgirl", "vocaloid", "unwrap"] list_name = "Waifu" end_tag = ["1girl", "solo"] args = ctx.message.lower() result = () search_for = "" show_series = False if ctx.command in ignore_series_lists else True support_otp = False skip_online = False # Special per list stuff if ctx.command == "shipgirl": # Default shipgirl to kantai collection only search_for = "Kantai Collection" support_otp = True if "all" in args: search_for = "" elif "aoki" in args: search_for = "Aoki Hagane no Arpeggio" elif ctx.command == "idol": args = args.replace("!", "").replace("@", "a") if "love live sunshine" in args: search_for = "Love Live! Sunshine!!" elif "love live" in args: search_for = "Love Live!" support_otp = True elif "idolmaster" in args: search_for = "Idolmaster" elif "cinderella" in args: search_for = "Idolmaster Cinderella Girls" elif "akb0048" in args: search_for = "AKB0048" elif "wake up" in args: search_for = "Wake Up Girls!" elif "aikatsu" in args: search_for = "Aikatsu!" elif ctx.command == "unwrap": show_series = True end_tag.append("santa_costume") elif ctx.command == "fate/servant": skip_online = True if (ctx.command in both_gender_lists and "male" in args and not "female" in args and not search_for)\ or ctx.command in male_only_lists: list_name = "Husbando" end_tag = ["-1girl", "-female", "1boy"] elif (ctx.command in both_gender_lists and not "female" in args and not search_for): random_gender = random.randint(0, 10) if random_gender > 8: list_name = "Husbando" end_tag = ["-1girl", "-female", "1boy"] if ctx.command in male_only_lists: list_name = "Husbando" end_tag = ["-1girl", "-female", "1boy"] if support_otp and "otp" in args: list_name = "OTP" if ctx.command == "onee" or ctx.command == "onii": ctx.command = ctx.command + "-chan" if ctx.command == "okaa": ctx.command = ctx.command + "-san" path = os.path.join(ctx.bot.config_path, '{} List.yaml'.format(list_name)) char_list = yaml_to_list(path, ctx.command.lower()) if search_for: result = filter_per_series(char_list, search_for, 4) if not result: if ctx.command == "fate/servant": rng = random.randint(1, 1000) if rng <= 700: card_rank = range(1, 4) elif 701 <= rng <= 900: card_rank = range(4, 5) elif rng >= 901: card_rank = range(5, 6) break_count = 0 print("CARD RANK") print(card_rank) while True: if break_count == 10: break result = random.choice(char_list) if result[1].get('get_rate', 1) in card_rank: break break_count += 1 else: result = random.choice(char_list) print(result) series = result[1].get('series') otp_image = result[1].get('otp image') start_path = settings.get('image_location', os.path.join(os.path.realpath(__file__), 'images')) if list_name == "OTP": name_one, name_two = result[0].split("(x)") end_tag = ["2girls", "yuri", name_one.replace(" ", "_"), name_two.replace(" ", "_")] list_title = ctx.command.title() + " OTP" name = "{} x {}".format(re.sub("[\(\[].*?[\)\]]", "", name_one).strip(), re.sub("[\(\[].*?[\)\]]", "", name_two).strip()) path_name = os.path.join(start_path, list_name, slugify(name)) else: list_title = ctx.command.title() name = re.sub("[\(\[].*?[\)\]]", "", result[0]).strip() # Remove () and [] end_tag.append(result[0].replace(" ", "_")) path_name = os.path.join(start_path, list_name, slugify(result[0])) if ctx.command == "unwrap": path_name = os.path.join(path_name, "christmas") if ctx.command == "granblue": reply_text = "{} has joined your party!".format(name) elif ctx.command == "unwrap": merry_ran_end = ["Merry Christmas!", "Happy Holidays!", "Season's Greetings!", "Merii Kurisumasu!"] reply_text = "{} was in your present ({}). {}".format(name, series, random.choice(merry_ran_end)) elif ctx.command == "fate/servant": reply_text = "Your {} is {} {}".format(list_title, name, "") else: reply_text = "Your {} is {}{}".format( list_title.replace("-C", "-c").replace("-S", "-s"), # w/e name, "" if not show_series else " ({})".format(series)) media_args = {'tags': end_tag, 'skip_online': skip_online} reply_media = get_media(path=path_name, ctx=ctx, media_args=media_args) return reply_text, reply_media