Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.

Commit

Permalink
[slashtags] fixes a bug related to the "st" dev env value (#158)
Browse files Browse the repository at this point in the history
* oops typo

* [SlashTags] remove dev env on unload

* [SlashTags] wraps `Red.remove_dev_env_value` in a try except.

* [SlashTags] fix styling

* [SlashTags] try except adding dev env value
  • Loading branch information
japandotorg committed May 9, 2023
1 parent d60b66c commit c1fd3a6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion slashtags/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ def __init__(self, bot: Red) -> None:

self.load_task = self.create_task(self.initialize_task())
self.session = aiohttp.ClientSession()
bot.add_dev_env_value("st", lambda ctx: self)

try:
bot.add_dev_env_value("st", lambda ctx: self)
except Exception:
log.exception("Failed to add `slashtags` in the dev environment", exc_info=True)

super().__init__()

Expand All @@ -128,6 +132,7 @@ def cog_unload(self):

def __unload(self):
self.bot.remove_dev_env_value("st")

if self.testing_enabled:
self.remove_test_cog()
self.load_task.cancel()
Expand Down

0 comments on commit c1fd3a6

Please sign in to comment.