From 1de078ecbaf71eafb22cde7c1e86c6673fcd26a5 Mon Sep 17 00:00:00 2001 From: Suhail Date: Tue, 19 Mar 2019 23:15:20 +0000 Subject: Moved the loading of the static JSON to the module namespace --- bot/seasons/valentines/savethedate.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'bot') diff --git a/bot/seasons/valentines/savethedate.py b/bot/seasons/valentines/savethedate.py index b9484be9..ac69acc1 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: + valentine_dates = load(f) + class SaveTheDate: """ @@ -26,17 +29,15 @@ class SaveTheDate: """ 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(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) def setup(bot): -- cgit v1.2.3 From 006154749d0376dad85cfd418f820b8264f76839 Mon Sep 17 00:00:00 2001 From: Olson Dimanche Date: Thu, 21 Mar 2019 13:16:51 -0400 Subject: set up bot directory for pride event --- .DS_Store | Bin 0 -> 6148 bytes bot/seasons/pride/__init__.py | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 .DS_Store create mode 100644 bot/seasons/pride/__init__.py (limited to 'bot') diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..c6d2dc45 Binary files /dev/null and b/.DS_Store differ diff --git a/bot/seasons/pride/__init__.py b/bot/seasons/pride/__init__.py new file mode 100644 index 00000000..a0c65753 --- /dev/null +++ b/bot/seasons/pride/__init__.py @@ -0,0 +1,16 @@ +from bot.seasons import SeasonBase + + +class Pride(SeasonBase): + """ + In support of our pride community, and in hopes of providing global cultural knowledge, + this event provides information about the LGBTQ community. + """ + + name = "pride" + bot_name = "Spookybot" + greeting = "Happy Pride Month!" + + # Duration of season + start_date = "01/06" + end_date = "30/06" -- cgit v1.2.3 From fa430043ed44c6e5d202f04ae1cfd8f7781c97ff Mon Sep 17 00:00:00 2001 From: Olson Dimanche Date: Thu, 21 Mar 2019 13:41:23 -0400 Subject: update bot name to Proud Bot --- bot/seasons/pride/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bot') diff --git a/bot/seasons/pride/__init__.py b/bot/seasons/pride/__init__.py index a0c65753..7f06ff3b 100644 --- a/bot/seasons/pride/__init__.py +++ b/bot/seasons/pride/__init__.py @@ -8,7 +8,7 @@ class Pride(SeasonBase): """ name = "pride" - bot_name = "Spookybot" + bot_name = "ProudBot" greeting = "Happy Pride Month!" # Duration of season -- cgit v1.2.3 From bcba4bd8acf4a5e3fe9fe986cb494f1c2a515948 Mon Sep 17 00:00:00 2001 From: Olson Dimanche Date: Thu, 21 Mar 2019 13:47:01 -0400 Subject: updated info on pride bot to be more inclusive --- bot/seasons/pride/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'bot') diff --git a/bot/seasons/pride/__init__.py b/bot/seasons/pride/__init__.py index 7f06ff3b..e16f9d25 100644 --- a/bot/seasons/pride/__init__.py +++ b/bot/seasons/pride/__init__.py @@ -1,9 +1,8 @@ from bot.seasons import SeasonBase - class Pride(SeasonBase): """ - In support of our pride community, and in hopes of providing global cultural knowledge, + In support of all cultures and communities, and in hopes of providing global cultural knowledge, this event provides information about the LGBTQ community. """ -- cgit v1.2.3 From c410c0efd3f42618e0659f22dcaa106ff1ade919 Mon Sep 17 00:00:00 2001 From: Olson Dimanche Date: Thu, 21 Mar 2019 13:54:08 -0400 Subject: final update on pride bot comment --- bot/seasons/pride/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bot') diff --git a/bot/seasons/pride/__init__.py b/bot/seasons/pride/__init__.py index e16f9d25..30d40a2d 100644 --- a/bot/seasons/pride/__init__.py +++ b/bot/seasons/pride/__init__.py @@ -2,8 +2,8 @@ from bot.seasons import SeasonBase class Pride(SeasonBase): """ - In support of all cultures and communities, and in hopes of providing global cultural knowledge, - this event provides information about the LGBTQ community. + No matter your origins, identity or sexuality, we hope we can come together to celebrate each and every person's individuality this Pride Month. + Features of ProudBot will be encouraged to be contributed during this event which appropriately commemorate the history and challenges of the LGBTQ+ community. """ name = "pride" -- cgit v1.2.3 From 64a41dc07022a0714c1cb2748dca71f0f856fe26 Mon Sep 17 00:00:00 2001 From: Olson Dimanche Date: Thu, 21 Mar 2019 14:12:37 -0400 Subject: Updated linting and pride bot description --- bot/seasons/pride/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bot') diff --git a/bot/seasons/pride/__init__.py b/bot/seasons/pride/__init__.py index 30d40a2d..d8a7e34b 100644 --- a/bot/seasons/pride/__init__.py +++ b/bot/seasons/pride/__init__.py @@ -1,9 +1,11 @@ from bot.seasons import SeasonBase + class Pride(SeasonBase): """ - No matter your origins, identity or sexuality, we hope we can come together to celebrate each and every person's individuality this Pride Month. - Features of ProudBot will be encouraged to be contributed during this event which appropriately commemorate the history and challenges of the LGBTQ+ community. + 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" -- cgit v1.2.3 From 2d4eb36afff8ce3701d76f295e7895b4de8259b0 Mon Sep 17 00:00:00 2001 From: Suhail Date: Sun, 24 Mar 2019 13:45:13 +0000 Subject: Save the Date - changed constant variable naming a requested change --- bot/seasons/valentines/savethedate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bot') diff --git a/bot/seasons/valentines/savethedate.py b/bot/seasons/valentines/savethedate.py index ac69acc1..f460283a 100644 --- a/bot/seasons/valentines/savethedate.py +++ b/bot/seasons/valentines/savethedate.py @@ -13,7 +13,7 @@ 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: - valentine_dates = load(f) + VALENTINES_DATES = load(f) class SaveTheDate: @@ -29,7 +29,7 @@ class SaveTheDate: """ Gives you ideas for what to do on a date with your valentine. """ - random_date = random.choice(valentine_dates['ideas']) + random_date = random.choice(VALENTINES_DATES['ideas']) emoji_1 = random.choice(HEART_EMOJIS) emoji_2 = random.choice(HEART_EMOJIS) embed = discord.Embed( -- cgit v1.2.3