diff options
| author | 2019-03-25 23:51:32 +1000 | |
|---|---|---|
| committer | 2019-03-25 23:51:32 +1000 | |
| commit | 38c9cfabfce78d4473744e5d1ce0ad162e3b9db5 (patch) | |
| tree | 4118561713e4fb4fb1fe26860b564203ac82b0a3 | |
| parent | Remove attribute autodoc prefix (diff) | |
| parent | Merge pull request #148 from Suhail6inkling/save-the-date-fix (diff) | |
Merge branch 'master' into flake8-docstring
Diffstat (limited to '')
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | bot/seasons/pride/__init__.py | 17 | ||||
| -rw-r--r-- | bot/seasons/valentines/savethedate.py | 24 | 
3 files changed, 30 insertions, 12 deletions
| @@ -111,3 +111,4 @@ venv.bak/  # jetbrains  .idea/ +.DS_Store
\ No newline at end of file diff --git a/bot/seasons/pride/__init__.py b/bot/seasons/pride/__init__.py new file mode 100644 index 00000000..d8a7e34b --- /dev/null +++ b/bot/seasons/pride/__init__.py @@ -0,0 +1,17 @@ +from bot.seasons import SeasonBase + + +class Pride(SeasonBase): +    """ +    No matter your origin, identity or sexuality, we come together to celebrate each and everyone's individuality. +    Feature contributions to ProudBot is encouraged to commemorate the history and challenges of the LGBTQ+ community. +    Happy Pride Month +    """ + +    name = "pride" +    bot_name = "ProudBot" +    greeting = "Happy Pride Month!" + +    # Duration of season +    start_date = "01/06" +    end_date = "30/06" diff --git a/bot/seasons/valentines/savethedate.py b/bot/seasons/valentines/savethedate.py index d296a23e..9582dea4 100644 --- a/bot/seasons/valentines/savethedate.py +++ b/bot/seasons/valentines/savethedate.py @@ -12,6 +12,9 @@ log = logging.getLogger(__name__)  HEART_EMOJIS = [":heart:", ":gift_heart:", ":revolving_hearts:", ":sparkling_heart:", ":two_hearts:"] +with open(Path('bot', 'resources', 'valentines', 'date_ideas.json'), 'r', encoding="utf8") as f: +    VALENTINES_DATES = load(f) +  class SaveTheDate:      """A cog that gives random suggestion for a Valentine's date.""" @@ -22,18 +25,15 @@ class SaveTheDate:      @commands.command()      async def savethedate(self, ctx):          """Gives you ideas for what to do on a date with your valentine.""" - -        with open(Path('bot', 'resources', 'valentines', 'date_ideas.json'), 'r', encoding="utf8") as f: -            valentine_dates = load(f) -            random_date = random.choice(valentine_dates['ideas']) -            emoji_1 = random.choice(HEART_EMOJIS) -            emoji_2 = random.choice(HEART_EMOJIS) -            embed = discord.Embed( -                title=f"{emoji_1}{random_date['name']}{emoji_2}", -                description=f"{random_date['description']}", -                colour=Colours.pink -            ) -            await ctx.send(embed=embed) +        random_date = random.choice(VALENTINES_DATES['ideas']) +        emoji_1 = random.choice(HEART_EMOJIS) +        emoji_2 = random.choice(HEART_EMOJIS) +        embed = discord.Embed( +            title=f"{emoji_1}{random_date['name']}{emoji_2}", +            description=f"{random_date['description']}", +            colour=Colours.pink +        ) +        await ctx.send(embed=embed)  def setup(bot): | 
