diff options
-rw-r--r-- | bot/exts/pride/pride_leader.py | 117 | ||||
-rw-r--r-- | bot/resources/pride/prideleader.json | 100 |
2 files changed, 217 insertions, 0 deletions
diff --git a/bot/exts/pride/pride_leader.py b/bot/exts/pride/pride_leader.py new file mode 100644 index 00000000..c3426ad1 --- /dev/null +++ b/bot/exts/pride/pride_leader.py @@ -0,0 +1,117 @@ +import json +import logging +import random +from pathlib import Path +from typing import Optional + +import discord +from discord.ext import commands +from fuzzywuzzy import fuzz + +from bot import bot +from bot import constants + +log = logging.getLogger(__name__) + +PRIDE_RESOURCE = json.loads(Path("bot/resources/pride/prideleader.json").read_text("utf8")) +MINIMUM_FUZZ_RATIO = 40 + + +class PrideLeader(commands.Cog): + """Gives information about Pride Leaders.""" + + def __init__(self, bot: bot.Bot): + self.bot = bot + + def invalid_embed_generate(self, pride_leader: str) -> discord.Embed: + """ + Generates Invalid Embed. + + The invalid embed contains a list of closely matched names of the invalid pride + leader the user gave. If no closely matched names are found it would list all + the available pride leader names. + + Wikipedia is a useful place to learn about pride leaders and we don't have all + the pride leaders, so the bot would add a field containing the wikipedia + command to execute. + """ + embed = discord.Embed( + color=constants.Colours.soft_red + ) + valid_names = [] + pride_leader = pride_leader.title() + for name in PRIDE_RESOURCE: + if fuzz.ratio(pride_leader, name) >= MINIMUM_FUZZ_RATIO: + valid_names.append(name) + + if not valid_names: + valid_names = ", ".join(PRIDE_RESOURCE) + error_msg = "Sorry your input didn't match any stored names, here is a list of available names:" + else: + valid_names = "\n".join(valid_names) + error_msg = "Did you mean?" + + embed.description = f"{error_msg}\n```{valid_names}```" + embed.set_footer(text="To add more pride leaders, feel free to open a pull request!") + + return embed + + def embed_builder(self, pride_leader: dict) -> discord.Embed: + """Generate an Embed with information about a pride leader.""" + name = [name for name, info in PRIDE_RESOURCE.items() if info == pride_leader][0] + + embed = discord.Embed( + title=name, + description=pride_leader["About"], + color=constants.Colours.blue + ) + embed.add_field( + name="Known for", + value=pride_leader["Known for"], + inline=False + ) + embed.add_field( + name="D.O.B and Birth place", + value=pride_leader["Born"], + inline=False + ) + embed.add_field( + name="Awards and honors", + value=pride_leader["Awards"], + inline=False + ) + embed.add_field( + name="For More Information", + value=f"Do `{constants.Client.prefix}wiki {name}`" + f" in <#{constants.Channels.community_bot_commands}>", + inline=False + ) + embed.set_thumbnail(url=pride_leader["url"]) + return embed + + @commands.command(aliases=("pl", "prideleader")) + async def pride_leader(self, ctx: commands.Context, *, pride_leader_name: Optional[str]) -> None: + """ + Information about a Pride Leader. + + Returns information about the specified pride leader + and if there is no pride leader given, return a random pride leader. + """ + if not pride_leader_name: + leader = random.choice(list(PRIDE_RESOURCE.values())) + else: + leader = PRIDE_RESOURCE.get(pride_leader_name.title()) + if not leader: + log.trace(f"Got a Invalid pride leader: {pride_leader_name}") + + embed = self.invalid_embed_generate(pride_leader_name) + await ctx.send(embed=embed) + return + + embed = self.embed_builder(leader) + await ctx.send(embed=embed) + + +def setup(bot: bot.Bot) -> None: + """Load the Pride Leader Cog.""" + bot.add_cog(PrideLeader(bot)) diff --git a/bot/resources/pride/prideleader.json b/bot/resources/pride/prideleader.json new file mode 100644 index 00000000..30e84bdc --- /dev/null +++ b/bot/resources/pride/prideleader.json @@ -0,0 +1,100 @@ +{ + "Tim Cook": { + "Known for": "CEO of Apple", + "About": "**Timothy Donald Cook** popularly known as Tim Cook. Despite being a notably private person, Tim Cook became the first CEO of a 500 fortune company, coming out as gay in 2014. He revealed his sexual orientation through an open letter published in Bloomberg BusinessWeek. He strongly believes that business leaders need to do their part to make the world a better place. An excerpt from his open letter is as follows: “Part of social progress is understanding that a person is not defined only by one's sexuality, race, or gender.", + "url": "https://image.cnbcfm.com/api/v1/image/105608434-1543945658496rts28qzc.jpg?v=1554921416&w=1400&h=950", + "Born": "In November 1, 1960 at Mobile, Alabama, U.S.", + "Awards": "• Financial Times Person of the Year (2014)\n• Ripple of Change Award (2015)\n• Fortune Magazine's: World's Greatest Leader. (2015)\n• Alabama Academy of Honor: Inductee. (2015)\n• Human Rights Campaign's Visibility Award (2015)\n• Honorary Doctor of Science from University of Glasgow in Glasgow, Scotland (2017)\n• Courage Against Hate award from Anti-Defamation League (2018)" + }, + "Alan Joyce": { + "Known for": "CEO of Qantas Airlines", + "About": "**Alan Joseph Joyce, AC** popularly known as Alan Joyce. Alan Joyce has been named as one of the world’s most influential business executives. He has always been very open about his orientation and has been in a committed gay relationship for over 20 years now. He supports same-sex marriage and believes that it is critical to make people recognize that they know LGBT people\n\nAlan likes to frequently talk about equality at the workplace and said, “It has become more important for leaders who are LGBT to be open about their sexuality. I am passionate about it. There should be more people like Apple’s Tim Cook and Paul Zahra, the former CEO of Australia’s David Jones [store chain].”", + "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Alan_Joyce_%28cropped%29.jpg/220px-Alan_Joyce_%28cropped%29.jpg", + "Born": "On 30 June, 1966 at Tallaght, Dublin, Republic of Ireland", + "Awards": "• The Australian named Joyce the most influential business leader in 2011\n• Joyce is an Ambassador of the Australian Indigenous Education Foundation\n• Joyce named a Companion of the Order of Australia, Australia's highest civil honour, in the 2017 Queen's birthday honours list" + }, + "Peter Thiel": { + "Known for": "Co-Founder and Former CEO of paypal", + "About": "**Peter Andreas Thiel** popularly known as Peter Thiel. Peter Thiel served as the CEO of PayPal from its inception to its sale to eBay in October 2002. Thiel’s sexuality came out in 2007 when Gawker Media outed him in a blog post. He became the first openly gay speaker at Republican National Convention and delivered a speech on sexuality.\n\n“Of course every American has a unique identity,” he said. “I am proud to be gay. I am proud to be a Republican. But most of all I am proud to be an American.”", + "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Peter_Thiel_2014_by_Heisenberg_Media.jpg/220px-Peter_Thiel_2014_by_Heisenberg_Media.jpg", + "Born": "On 11 October, 1967 at Frankfurt, West Germany", + "Awards": "• Thiel received a co-producer credit for Thank You for Smoking, a 2005 feature film based on Christopher Buckley's 1994 novel of the same name\n• In 2006, Thiel won the Herman Lay Award for Entrepreneurship\n• In 2007, he was honored as a Young Global leader by the World Economic Forum as one of the 250 most distinguished leaders age 40 and under\n• On 7 November 2009, Thiel was awarded an honorary degree from Universidad Francisco Marroquin\n• In 2012, Students For Liberty, an organization dedicated to spreading libertarian ideals on college campuses, awarded Thiel its “Alumnus of the Year” award\n• In February 2013, Thiel received a TechCrunch Crunchie Award for Venture Capitalist of the Year.\n• Insurance Executive of the Year: St Joseph’s University’s Academy of Risk Management and Insurance in Philadelphia" + }, + "Martine Rothblatt": { + "Known for": "CEO of United Therapeutics", + "About": "**Martine Aliana Rothblatt** popularly known as Martine Rothblatt. Martine co-founded Sirius XM Satellite Radio in 1990 and 1996 founded United Therapeutics, making her the highest-earning CEO in the biopharmaceutical industry. She came out as a transgender in 1994 and has been vocal about the trans community ever since.\n\nIn 2014 in an interview, Martine said, “I took a journey from male to female, so if I hide that, I’m, like just replicating the closet of my past with another closet of the future. That made no sense and that is why I am open.” She has authored a book called “The apartheid of Sex”.", + "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Martine-Rothblatt2-5773.jpg/220px-Martine-Rothblatt2-5773.jpg", + "Born": "On October 10, 1954 at Chicago, Illinois, U.S.", + "Awards": "• In January 2018 Rothblatt was presented the UCLA Medal, the university's highest award, in recognition of her creation of Sirius XM satellite radio, advancing organ transplant technology, and having “expanded the way we understand fundamental concepts ranging from communication to gender to the nature of consciousness and mortality.”" + }, + "Peter Arvai": { + "Known for": "Co-Founder and CEO of Prezi", + "About": "Peter Arvai is the 11th most influential LGBT leader in the world. His goal has always been to create an open environment that fosters diversity. He has co-founded an NGO with Google and espell called ‘We Are Open’ to promote openness at the workplace. Peter regularly talks about his gay background in every on-boarding session at his company.\n\nWhen Prezi was featured on the cover of Forbes, Peter used the opportunity by coming out and sharing his story to start a conversation on this topic that most people seem to avoid. If you want to create a more inclusive workplace, you need to be willing to be vulnerable yourself, he says. “To spark honest discussions about inclusivity and openness, your personal experience of inclusion is a key resource and you need to create a safe environment so people find the courage to have uncomfortable conversations.”", + "url": "https://cached.imagescaler.hbpl.co.uk/resize/scaleWidth/880/cached.offlinehbpl.hbpl.co.uk/news/OTM/Peterarvai-20191218101617863.jpg", + "Born": "On October 26, 1979 at Karlskoga, Sweden", + "Awards": "• 2014: European Tech Startups Award for Best Startup Co-Founders.\n• 2014: European Web Entrepreneur of the Year.\n• 2015: Executive of the Year – Business Services: Bronze Stevie Winner.\n• 2016: Number 11 on the 2016 OUTstanding & Financial Times Leading LGBT Executives List of 100" + }, + "Inga Beale": { + "Known for": "CEO of Lloyd's of London", + "About": "Inga became the first female CEO of Lloyd’s of London in 2013 and in 2017 was named a Dame Commander of the Order of the British Empire for her contribution towards the British economy.\n\nShe came out first as a bisexual, in an interview in 2008 and since then has made efforts to bring diversity and inclusion at the forefront in her company. “It’s not about me. It’s about what you do for other people. For me, it’s so important because you need these role models.”\n\nSpeaking between meetings at the World Economic Forum in Davos, she says her position at the top of the LGBT table is important for its impact on others: “It’s about giving people confidence,” she says.", + "url": "https://cdn-res.keymedia.com/cms/images/us/018/0248_637072371134927741.jpeg", + "Born": "On May 15, 1963 at Great Britain", + "Awards": "• Trailblazer of the Year: The Insurance Industry Charitable Foundation (IICF)(2019)\n• Free Enterprise Award: Insurance Federation of New York (IFNY)(2018)\n• Market People - Outstanding Contribution Award: The London Market Forums(2018)\n• Outstanding Achievement Award: Insurance Day | Informa(2018)\n• Barclay's Lifetime Achievement Award: Variety Children's Charity - Catherine Awards(2017)\n• Insurance Woman of the Year Award: Association of Professional Insurance Women (APIW)(2017)\n• Dame Commander of the Order of the British Empire - DBE: HM The Queen(2017)\n• Insurance Personality of the Year: British Insurance Awards\n• Insurance Executive of the Year: St Joseph’s University’s Academy of Risk Management and Insurance in Philadelphia(2015)" + }, + "David Geffen": { + "Known for": "Founder of Dreamworks", + "About": "**David Lawrence Geffen** popularly known as David Geffen. Founder of film studio Dream Works as well as record labels Asylum Records, Geffen Records and DGC Records, David Geffen came out in 1992 at a fund raiser announcing, “As a Gay man, I have come a long way to be here tonight.” He was already among the strongest pillars of the gay rights movement by then.\n\n“If I am going to be a role model, I want to be one that I can be proud of,” Geffen said in an interview back in 1992.”\n\nGeffen contributed significantly towards society through the David Geffen Foundation that worked relentlessly towards healthcare, people affected by HIV/AIDS, civil liberties, issues of concern to the Jewish community, and arts. Interestingly, the song ‘Free man in Paris’ by Joni Mitchell is based on Geffen’s time in Paris during a trip they took together along with Canadian musician Robbie Robertson and his wife.", + "url": "https://i.insider.com/5b733a2be199f31d138b4bec?width=1100&format=jpeg&auto=webp", + "Born": "On February 21, 1943 at New York City, U.S.", + "Awards": "• Tony Award for Best Musical(1983)\n• Tony Award for Best Play(1988)\n• Daytime Emmy Award for Outstanding Children's Animated Program(1990)" + }, + "Joel Simkhai": { + "Known for": "Founder and former CEO of Grindr and Blendr", + "About": "Joel Simkhai founded Grindr, a dating app for men in the LGBTQ+ community in 2009. He says he launched the app with a “selfish desire’ to meet more gay men. Today, Grindr has over 4 million users and has become the world's largest social networking platform for men from the LGBTQ+ community to interact.\n\nIn an interview Joel shared, “ As a kid I was teased, teased for being feminine, I guess for being gay. So a lot of my early life was just in denial about it with myself and others. But by 16 and as I started getting older, I realized that I like guys”. “My story is the story of every gay man. We are seen as a minority in some ways and the services out there weren’t that great. I am an introvert so I don’t really do well at being who I am right away but online seemed like my comfort zone”. It all begins with meeting someone, he adds.", + "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/Joel_Simkhai_2012_%28cropped%29.jpg/220px-Joel_Simkhai_2012_%28cropped%29.jpg", + "Born": "On 1976 at Tel Aviv, Israel", + "Awards": "• Simkhai’s company has been mentioned in pop culture icons like The Office, Saturday Night Live, Judge Judy and Top Gear and won a number of industry awards including “Best Mobile Dating App” in 2011 and 2012 and “Best New Technology” in 2012 from the iDate Awards and “Best Location Application” at the TechCrunch Awards in 2011." + }, + "Megan Smith": { + "Known for": "Former CTO of United States", + "About": "Megan Smith the former CTO of the United States has always been vocal about the need to push inclusion. Most central to her message, however, is the key insight that is most often lost: not only is inclusivity a part of technology’s future, it was also a seminal part of its past. Ada Lovelace, for example, an English woman born in 1812, was the first computer programmer; Katherine G. Johnson, an African-American woman featured in the Oscar-nominated film Hidden Figures, helped put NASA astronauts on the moon.\n\nIn 2003, in an interview Megan said, “When you are gay, you come out everyday because everyone assumes you are straight. But you have to be yourself.” Smith also hopes to open up the tech industry to more women and encourage girls to pursue a career in it.", + "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f0/Megan_Smith_official_portrait.jpg/220px-Megan_Smith_official_portrait.jpg", + "Born": "On October 21, 1964 at Buffalo, New York, and Fort Erie, Ontario.", + "Awards": "• World Economic Forum Technology Pioneer 2001, 2002\n• Listed by Out magazine in 2012 and 2013, as one of the 50 most powerful LGBT people in the United States\n• Reuters Digital Vision Program Fellow at Stanford, 2003-2004\n• Top 25 Women on the Web, 2000\n• Upside Magazine 100 Digital Elite, 1999 and 2000\n• Advertising Age i.20, 1999\n• GLAAD Interactive Media Award for Internet Leadership, 1999\n• Charging Buffalo Award, 2015\n• Business Insider 23 Most Powerful LGBTQ+ People in Tech, 2019" + }, + "David Bohnett": { + "Known for": "Founder of Geocities", + "About": "**David C. Bohnett** popularly known as David Bohnett. A tech entrepreneur, with his LA-based venture firm Baroda Ventures, founded in 1998, David Bohnett is also the Founder of Geocities, which remains the first largest internet venture built on user-generated content, founded in 1998 and acquired by Yahoo in 1999. Geocities was cited #2 by TechRadar in its list of ‘20 websites that changed the world’ back in 2008.\n\nBohnett came out to his family post his graduation and worked extensively towards equal rights for gays and lesbians, and towards legalizing same-sex marriage. He founded the David Bohnett Foundation, dedicated to community-building and social activism addressing concerns across a broad spectrum of arts, educational, and civic programs. The first openly bisexual US congressperson Krysten Sinema and the first openly gay mayor of a major US city (Houston), Annise Parker, are both alumnis of the LGBT Leadership Fellows run by his foundation that trains LGBT leaders for local and state governments.", + "url": "https://upload.wikimedia.org/wikipedia/commons/c/cb/David_Bohnett.jpg", + "Born": "On April 2, 1956 at Chicago, Illinois", + "Awards": "• Number 16 on Time's Top 50 Cyber Elite (1998)\n• Upside magazine's Elite 100 (1998)\n• Newsweek's “100 People to Watch in the Next Millennium”\n• Ernst & Young Entrepreneur of the Year Award for Southern California (1999)\n• Los Angeles Gay and Lesbian Center's Rand Schrader Award (1999)\n• Los Angeles Business Journal's Technology Leader of the Year (2000)\n• ACLU Citizen Advocate Award (2002)\n• amfAR Award of Courage (2006)\n• Los Angeles City of Angels Award (2008)\n• GLSEN's Lifetime Achievement Award (2009)\n• Honorary doctorate of Humane Letters from Whittier College (2012)\n• American Jewish Committee Los Angeles' Ira E. Yellin Community Leadership Award (2014)\n• Brady Bear Award from the Brady Center to Prevent Gun Violence (2016)\n• Los Angeles Business Journal's LA 500: The Most Influential People in Los Angeles (2017)" + }, + "Jennifer Pritzker": { + "Known for": "Founder and CEO of Tawani Enterprises", + "About": "**Jennifer Natalya Pritzker** popularly known as Jennifer Pritzker. A retired Lieutenant Colonel of the US Army, and Founder and CEO of private wealth management firm Tawani Enterprises, Jennifer Natalya Pritzker, is an American investor, philanthropist, member of the Pritzker family, and the world’s first transgender billionaire. Having retired from the US Army in 2001, Jennifer was promoted to the honorary rank of Colonel in the Illinois Army National Guard.\n\nFormerly known as James Nicholas Pritzker, she legally changed her official name to Jennifer Natalya Pritzker in 2013, identifying herself as a woman for all business and personal undertakings, as per an announcement shared with employees of the Pritzker Military Library and Tawani Enterprises.\n\nPritzker in 1995 founded the Tawani Foundation aiming “to enhance the awareness and understanding of the importance of the Citizen Soldier; to preserve unique sites of significance to American and military history; to foster health and wellness projects for improved quality of life; and to honor the service of military personnel, past, present and future.”", + "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/62/Jennifer_Pritzker.jpg/220px-Jennifer_Pritzker.jpg", + "Born": "On August 13, 1950 at Chicago, Illinois.", + "Awards": "• First transgender billionaire\n• Founder of Tawani Foundation and Pritzker Military Library" + }, + "Claudia Brind-Woody": { + "Known for": "VP and managing director of intellectual property IBM", + "About": "**Claudia Lavergne Brind-Woody** popularly known as Claudia Brind-Woody. Global Co-Chair for the LGBT Executive Task-force at IBM, Claudia Brind-Woody is a force of nature to reckon with. In 2019, she was named among the most powerful LGBTQ+ people in tech, in addition to being in Financial Times Top 50 Outstanding list in 2013, 2014 and 2015, The Guardian’s 100 most influential LGBT people of the year in 2012, and winning the Out & Equal Trailblazer award in 2011, among other accolades.\n\nShe came out as a lesbian in the early years of her career and strives to work towards equality at the workplace. In an interview back in 2016 she shared, “What the LGBT+ community wants is to just want it to be ordinary [to be LGBT+] so that you are just seen to be valued on merit and what you bring to the business without someone thinking twice about you being LGBT+....When our employees don't have to think twice about struggling for the same benefits, recognition, or are afraid of being safe, then productivity goes up.”", + "url": "https://image.insider.com/580e9350dd089551098b47ff?width=750&format=jpeg&auto=webp", + "Born": "On January 30, 1955 at Virginia, U.S.", + "Awards": "• Out & Equal Trailblazer Award (2011)\n• GO Magazine's 100 Women We Love (2011)\n• The Guardian's World Pride Power List Top 100 (2012)\n• The Financial Times' Top 50 Outstanding list (2013, 2014, 2015)\n• The Daily Telegraph's Top 50 list of LGBT executives (2015)\n• The Financial Times' Hall of Fame (2016)\n• Diva power list (2016)\n• Business Insider The 23 Most Influential LGBTQ+ People in Tech" + }, + "Laxmi Narayan Tripathi": { + "Known for": "Humans rights activist and founder, Astitva trust", + "About": "The first transgender individual to represent APAC in the UN task meeting in 2008, representative of APAC yet again at the 20th International AIDS Conference in Melbourne and recipient of the ‘Indian of the Year’ award in 2017, Lakshmi Narayan Tripathi is a transgender activist, and part of the team that led the charge to getting transgender recognized as a third gender in India by the Supreme Court in 2014.\n\nLakshmi was appointed as the President of the NGO DAI Welfare Society in 2002, the first registered and working organization for eunuchs in South Asia. By 2007 she founded her own organization, Astitiva that works towards the welfare, support and development of sexual minorities.\n\nWith the background of an abusive childhood and being bullied for being feminine, she stated in an interview, “I chose not to remember the prejudice,” adding, “Rather I think (about) the good things that have happened to me, and be a flamboyant rainbow.”", + "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Laxmi_Narayan_Tripathi_at_JLF_Melbourne_presented_by_Melbourne_Writers_Festival%2C_Federation_Square%2C_Melbourne_2017.jpg/220px-Laxmi_Narayan_Tripathi_at_JLF_Melbourne_presented_by_Melbourne_Writers_Festival%2C_Federation_Square%2C_Melbourne_2017.jpg", + "Born": "On 13th Dec 1978 at Thane", + "Awards": "• Awarded 'Indian of the Year 2017" + }, + "Tim Gill": { + "Known for": "Founder of Quark", + "About": "Tim Gill founded Quark Inc in 1981 and sold his stakes in Quark in 1999 in order to focus more on his interests in LGBT+ activism and philanthropy. He founded the pro-LGBT Gill Foundation in 1994, and since its inception it has invested more than $357 Mn in programs and non-profits around the country, substantially contributing towards many victories for LGBT community.\n\nGill married Scott Miller in 2009 and continues to be the largest donor for LGBT initiatives in America.\n\n“The LGBTQ movement has no Martin Luther King. We never have. And we probably never will,” Gill said. “So it’s not going to be grandiose gestures and big speeches and things like that that secure us equal opportunity. It will be the hard work of thousands and thousands of people over many, many years.”", + "url": "https://gillfoundation.org/wp-content/uploads/2014/09/tim-gill-20151.jpg", + "Born": "On October 18, 1953 at Hobart, Indiana", + "Awards": "• Gill was awarded the NOGLSTP GLBT Engineer of the Year Award in 2007." + } +} |