diff options
| author | 2019-06-17 20:04:29 -0400 | |
|---|---|---|
| committer | 2019-06-17 20:04:29 -0400 | |
| commit | 9864f61b92dc0e1d2ac8b035edcaeb06503e20c9 (patch) | |
| tree | b62e95bbdf0ddd208c533d89a603b7f3328f8810 /bot | |
| parent | Initial commit, added pride anthems (diff) | |
Wrote initial code for running the bot command.
Diffstat (limited to 'bot')
| -rw-r--r-- | bot/resources/pride/anthems.json | 61 | ||||
| -rw-r--r-- | bot/seasons/pride/pride_anthem.py | 46 | 
2 files changed, 48 insertions, 59 deletions
| diff --git a/bot/resources/pride/anthems.json b/bot/resources/pride/anthems.json index fd998632..d2894515 100644 --- a/bot/resources/pride/anthems.json +++ b/bot/resources/pride/anthems.json @@ -2,386 +2,329 @@    {      "title": "Girls Like Girls",      "artist": "Hayley Kiyoko", -    "vido": "https://www.youtube.com/watch?v=I0MT8SwNa_U", -    "year": 2015, +    "video": "https://www.youtube.com/watch?v=I0MT8SwNa_U",      "genre": ["Pop", "Electropop"]    },    {      "title": "I don't do boys",      "artist": "Elektra",      "video": "https://www.youtube.com/watch?v=MxAvsYrHOmI", -    "year": 2010,      "genre": ["Rock", "Pop"]    },    {      "title": "Girls/Girls/Boys",      "artist": "Panic! at the Disco",      "video": "https://www.youtube.com/watch?v=Yk8jV7r6VMk", -    "year": 2013,      "genre": ["Alt", "Alternative", "Indie", "New wave", "Electropop", "Pop", "Rock"]    },    {      "title": "I Will Survive",      "artist": "Gloria Gaynor",      "video": "https://www.youtube.com/watch?v=gYkACVDFmeg", -    "year": 1978,      "genre": ["Jazz", "Disco", "RnB", "R&B", "Rhythm and Blues", "Soul", "Dance", "Electronic", "Pop"]    },    {      "title": "Born This Way",      "artist": "Lady Gaga",      "video": "https://www.youtube.com/watch?v=wV1FrqwZyKw", -    "year": 2011,      "genre": ["Pop", "Electropop"]    },    {      "title": "Raise Your Glass",      "artist": "P!nk",      "video": "https://www.youtube.com/watch?v=XjVNlG5cZyQ", -    "year": 2010,      "genre": ["Pop", "Rock", "Pop-rock"]    },    {      "title": "We R Who We R",      "artist": "Ke$ha",      "video": "https://www.youtube.com/watch?v=mXvmSaE0JXA", -    "year": 2010,      "genre": ["Pop", "Dance-pop"]    },    {      "title": "I'm Coming Out",      "artist": "Diana Ross",      "video": "https://www.youtube.com/watch?v=zbYcte4ZEgQ", -    "year": 1980,      "genre": ["Disco", "Funk", "Soul"]    },    {      "title": "She Keeps Me Warm",      "artist": "Mary Lambert",      "video": "https://www.youtube.com/watch?v=NhqH-r7Xj0E", -    "year": 2014,      "genre": ["Pop"]    },    {      "title": "June",      "artist": "Florence + The Machine",      "video": "https://www.youtube.com/watch?v=Sosmd6RjeA0", -    "year": 2018,      "genre": ["Alt", "Indie", "Alternative"]    },    {      "title": "Do I Wanna Know",      "artist": "MS MR",      "video": "https://youtu.be/0DCDf1O4e1Q", -    "year": 2013,      "genre": ["Indie", "Indie-pop"]    },    {      "title": "Delilah",      "artist": "Florence + The Machine",      "video": "https://www.youtube.com/watch?v=zZr5Tid3Qw4", -    "year": 2015,      "genre": ["Alt", "Alternative", "Indie"]    },    {      "title": "Pynk",      "artist": "Janelle Monae",      "video": "https://www.youtube.com/watch?v=PaYvlVR_BEc", -    "year": 2018,      "genre": ["RnB", "Rhythm and Blues", "R&B", "Soul"]    },    {      "title": "Queen",      "artist": "Janelle Monae",      "video": "https://www.youtube.com/watch?v=tEddixS-UoU", -    "year": 2013,      "genre": ["Neo-soul"]    },    {      "title": "Aesthetic",      "artist": "Hi, I'm Case",      "video": "https://www.youtube.com/watch?v=cgq-XaSC1aY", -    "year": 2018,      "genre": ["Pop", "Pop-rock"]    },    {      "title": "Break Free",      "artist": "Queen",      "video": "https://www.youtube.com/watch?v=f4Mc-NYPHaQ", -    "year": 1984,      "genre": ["Rock", "Synth-pop"]    },    {      "title": "LGBT",      "artist": "CupcakKe",      "video": "https://www.youtube.com/watch?v=U_OArkw5yeQ", -    "year": 2016,      "genre": ["Hip-Hop", "Rap"]    },    {      "title": "Rainbow Connections",      "artist": "Garfunkel and Oates",      "video": "https://www.youtube.com/watch?v=MneRtx7x2vs", -    "year": 2015,      "genre": ["Folk"]    },    {      "title": "Proud",      "artist": "Heather Small",      "video": "https://www.youtube.com/watch?v=LEoxGJ79PMs", -    "year": 2001,      "genre": ["Dance-pop", "R&B", "Rhythm and Blues", "RnB"]    },    {      "title": "LGBT",      "artist": "Lowell",      "video": "https://www.youtube.com/watch?v=QgE6nZmTGLw", -    "year": 2014,      "genre": ["Alternative", "Indie", "Alt", "Pop"]    },    {      "title": "Kiss the Boy",      "artist": "Keiynan Lonsdale",      "video": "https://www.youtube.com/watch?v=bXzLZ7QQnpQ", -    "year": 2018,      "genre": ["Pop"]    },    {      "title": "Boys Aside",      "artist": "Sofya Wang",      "video": "https://www.youtube.com/watch?v=NlAW7l6dmeA", -    "year": 2017,      "genre": ["Pop"]    },    {      "title": "Everyone is Gay",      "artist": "A Great Big World",      "video": "https://www.youtube.com/watch?v=0VG1bj4Lj1Q", -    "year": 2014,      "genre": ["Pop"]    },    {      "title": "The Queer Gospel",      "artist": "Erin McKeown",      "video": "https://www.youtube.com/watch?v=2vvOEoT-q_o", -    "year": 2016,      "genre": ["Christian", "Gospel"]    },    {      "title": "Girls",      "artist": "Girl in Red",      "video": "https://www.youtube.com/watch?v=_BMBDY01kPk", -    "year": 2018,      "genre": ["Alternative", "Indie", "Alt"]    },    {      "title": "Crazy World",      "artist": "MNEK",      "video": "https://www.youtube.com/watch?v=YBwzTgNL-zw", -    "year": 2018,      "genre": ["Pop"]    },    {      "title": "It Girl",      "artist": "Mister Wallace",      "video": "https://www.youtube.com/watch?v=NEnmporrBuo", -    "year": 2016,      "genre": ["Dance", "Electronic"]    },    {      "title": "Gay Sex",      "artist": "Be Steadwell",      "video": "https://www.youtube.com/watch?v=XnbQu_pzf8o", -    "year": 2018,      "genre": ["Pop"]    },    {      "title": "Bisexual Anthem",      "artist": "Domo Wilson",      "video": "https://www.youtube.com/watch?v=RBX4IwvGjm8", -    "year": 2019,      "genre": ["Hip-Hop", "Rap"]    },    {      "title": "Pride",      "artist": "Grace Petrie",      "video": "https://www.youtube.com/watch?v=y5rMrPJzFGs", -    "year": 2018,      "genre": ["Alt", "Alternative", "Indie"]    },    {      "title": "Good Guys",      "artist": "MIKA",      "video": "https://www.youtube.com/watch?v=VZQ_9eebry0", -    "year": 2015,      "genre": ["Pop"]    },    {      "title": "Gender is Boring",      "artist": "She/Her/Hers",      "video": "https://www.youtube.com/watch?v=glJW2vlBAQg", -    "year": 2018,      "genre": ["Punk"]    },    {      "title": "I Like Boys",      "artist": "Todrick Hall",      "video": "https://www.youtube.com/watch?v=RIbGksV3YBY", -    "year": 2019,      "genre": ["Dance", "Electronic"]    },    {      "title": "Girls",      "artist": "Beatrice Eli",      "video": "https://www.youtube.com/watch?v=Orffm0v0mS0", -    "year": 2014,      "genre": ["Pop"]    },    {      "title": "GUY.exe",      "artist": "Superfruit",      "video": "https://www.youtube.com/watch?v=r2Kh_XMIDPU", -    "year": 2017,      "genre": ["Pop"]    },    {      "title": "That's So Gay",      "artist": "Pansy Division",      "video": "https://www.youtube.com/watch?v=xlpcyeadaTk", -    "year": 2009,      "genre": ["Rock"]    },    {      "title": "Queer Kidz",      "artist": "Ashby and the Oceanns",      "video": "https://www.youtube.com/watch?v=tSdCciMIlO8", -    "year": 2017,      "genre": ["Folk"]    },    {      "title": "Butch in the Streets",      "artist": "Tribe 8",      "video": "https://www.youtube.com/watch?v=HWxFym7h8LQ", -    "year": 1995,      "genre": ["Rock"]    },    {      "title": "Strangers",      "artist": "Halsey",      "video": "https://www.youtube.com/watch?v=RVd_71ZdRd4", -    "year": 2017,      "genre": ["Pop", "Alt", "Alternative", "Indie", "Electropop"]    },    {      "title": "LGBTQIA",      "artist": "Matt Fishel",      "video": "https://www.youtube.com/watch?v=KQq9f5hNOxE", -    "year": 2018,      "genre": ["Rock"]    },    {      "title": "Tell Me a Story",      "artist": "Skylar Kergil",      "video": "https://www.youtube.com/watch?v=nbQDTE2s3dI", -    "year": 2015,      "genre": ["Folk"]    },    {      "title": "Bi",      "artist": "Alicia Champion",      "video": "https://www.youtube.com/watch?v=HekhW9STg58", -    "year": 2016,      "genre": ["Pop"]    },    {      "title": "Trans Is Love",      "artist": "Marissa Kay",      "video": "https://www.youtube.com/watch?v=-5f_1H0RD1I", -    "year": 2017,      "genre": ["Alt", "Alternative", "Indie", "Alt-country", "Alt-folk", "Indie-rock", "New-southern-rock"]    },    {      "title": "You Can't Tell Me",      "artist": "Jake Edwards",      "video": "https://www.youtube.com/watch?v=CwqDG5269Ak", -    "year": 2018,      "genre": ["Pop"]    },    {      "title": "Closet Femme",      "artist": "Kate Reid",      "video": "https://www.youtube.com/watch?v=va-nqcNxP_k", -    "year": 2011,      "genre": ["Folk"]    },    {      "title": "Make Me Feel",      "artist": "Janelle Monae",      "video": "https://www.youtube.com/watch?v=tGRzz0oqgUE", -    "year": 2018,      "genre": ["Rhythm and Blues", "RnB", "R&B", "Soul"]    },    {      "title": "Let's Have a Kiki",      "artist": "Scissor Sisters",      "video": "https://www.youtube.com/watch?v=eGCD4xb-Tr8", -    "year": 2012,      "genre":["Electropop", "Pop"]    },    {      "title": "Gimme Gimme Gimme",      "artist": "ABBA",      "video": "https://www.youtube.com/watch?v=JWay7CDEyAI", -    "year": 1986,      "genre": ["Disco"]    },    {      "title": "Dancing Queen",      "artist": "ABBA",      "video": "https://www.youtube.com/watch?v=xFrGuyw1V8s", -    "year": 1976,      "genre": ["Disco", "Europop", "Euero-disco"]    },    {      "title": "City Grrl",      "artist": "CSS",      "video": "https://www.youtube.com/watch?v=duOA3FgpZqY", -    "year": 2011,      "genre": ["Electropop"]    },    {      "title": "Blame it on the Girls",      "artist": "MIKA",      "video": "https://www.youtube.com/watch?v=iF_w7oaBHNo", -    "year": 2009,      "genre": ["Pop", "Pop-rock"]    },    {      "title": "Bye Bye Bye",      "artist": "*NSYNC",      "video": "https://www.youtube.com/watch?v=Eo-KmOd3i7s", -    "year": 2000,      "genre": ["Pop", "Europop"]    },    {      "title": "Gettin Bi",      "artist": "Crazy Ex-Girlfriend", -    "video": "", -    "year": 2016, +    "video": "https://www.youtube.com/watch?v=5e7844P77Is",      "genre": ["Pop"]    },    {      "title": "Heterosexuality is a Construct",      "artist": "One Night Stand in North Dakota",      "video": "https://www.youtube.com/watch?v=linQQ_XIVjI", -    "year": 2010,      "genre": ["Punk"]    },    {      "title": "Love You So Bad",      "artist": "Ezra Furman", -    "video": "https://www.youtube.com/watch?v=QX8CiG4aRLo", -    "year": 2018, -    "genre": ["Alt", "Alternative", "Indie"]    }  ]
\ No newline at end of file diff --git a/bot/seasons/pride/pride_anthem.py b/bot/seasons/pride/pride_anthem.py new file mode 100644 index 00000000..1b8ad6cc --- /dev/null +++ b/bot/seasons/pride/pride_anthem.py @@ -0,0 +1,46 @@ +import logging +from pathlib import Path +from json import load +from random import choice + +from discord.ext import commands + + +log = logging.getLogger(__name__) + + +OPTIONS = { + +} + + +class PrideAnthem(commands.Cog): +    """Embed a random youtube video for a gay anthem!""" + +    def __init__(self, bot): +        self.bot = bot +        self.anthems = self.load_vids() + +    def get_video(self, genre=None): +        if not genre: +            return choice(self.anthems) +        else: +            songs = [song for song in self.anthems if genre in song.genre] +            return choice(songs) + +    @staticmethod +    def load_vids(): +        with open(Path('bot', 'resources', 'pride', 'anthems.json').absolute(), 'r') as f: +            anthems = load(f) +        return anthems + +    @commands.command(name='prideanthem') +    async def send_anthem(self, ctx, genre=None): +        video = self.get_video(genre) +        await ctx.send(f'Here\'s a pride anthem for you! {video.url}') + + +def setup(bot): +    """Cog loader for pride anthem""" +    bot.add_cog(PrideAnthem(bot)) +    log.info('Pride anthems cog loaded!') | 
