diff options
| author | 2020-04-05 22:04:51 +0530 | |
|---|---|---|
| committer | 2020-04-05 22:04:51 +0530 | |
| commit | 00d22a316041a8670903eb5fd4b4a7d143993330 (patch) | |
| tree | 32ca988fc794f4add6613b6909fb6cfdd03298ee | |
| parent | Add feature to restrict tags to specific role(s) (diff) | |
Remove unnecessary variable creation and join two if statements
| -rw-r--r-- | bot/cogs/tags.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/bot/cogs/tags.py b/bot/cogs/tags.py index 9c897ad36..bb74ab1ca 100644 --- a/bot/cogs/tags.py +++ b/bot/cogs/tags.py @@ -49,8 +49,7 @@ class Tags(Cog): "restricted_to": "developers" } if len(file_path) == 5: - restricted_to = file_path[3] - tag["restricted_to"] = restricted_to + tag["restricted_to"] = file_path[3] cache[tag_title] = tag return cache @@ -127,9 +126,11 @@ class Tags(Cog): matching_tags = [] for tag in self._cache.values(): - if self.check_accessibility(user, tag): - if check(query in tag['embed']['description'].casefold() for query in keywords_processed): - matching_tags.append(tag) + if ( + self.check_accessibility(user, tag) + and check(query in tag['embed']['description'].casefold() for query in keywords_processed) + ): + matching_tags.append(tag) return matching_tags |