Skip to content

Commit bf6ec95

Browse files
authored
Merge branch 'master' into branding-manager
2 parents 91b2055 + 8b1276a commit bf6ec95

File tree

11 files changed

+40
-736
lines changed

11 files changed

+40
-736
lines changed

Pipfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ beautifulsoup4 = "~=4.9"
1414
colorama = {version = "~=0.4.3",sys_platform = "== 'win32'"}
1515
coloredlogs = "~=14.0"
1616
deepdiff = "~=4.0"
17-
"discord.py" = {git = "https://github.com/Rapptz/discord.py.git", ref = "94f76e63947b102e5de6dae9a2cd687b308033"}
17+
"discord.py" = "~=1.6.0"
1818
feedparser = "~=5.2"
1919
fuzzywuzzy = "~=0.17"
2020
lxml = "~=4.4"

Pipfile.lock

+22-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bot/constants.py

-13
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,6 @@ class Channels(metaclass=YAMLGetter):
439439
talent_pool: int
440440
user_event_announcements: int
441441
user_log: int
442-
verification: int
443442
voice_chat: int
444443
voice_gate: int
445444
voice_log: int
@@ -476,8 +475,6 @@ class Roles(metaclass=YAMLGetter):
476475
python_community: int
477476
sprinters: int
478477
team_leaders: int
479-
unverified: int
480-
verified: int # This is the Developers role on PyDis, here named verified for readability reasons.
481478
voice_verified: int
482479

483480

@@ -599,16 +596,6 @@ class PythonNews(metaclass=YAMLGetter):
599596
webhook: int
600597

601598

602-
class Verification(metaclass=YAMLGetter):
603-
section = "verification"
604-
605-
unverified_after: int
606-
kicked_after: int
607-
reminder_frequency: int
608-
bot_message_delete_delay: int
609-
kick_confirmation_threshold: float
610-
611-
612599
class VoiceGate(metaclass=YAMLGetter):
613600
section = "voice_gate"
614601

bot/exts/backend/error_handler.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from bot.api import ResponseCodeError
1111
from bot.bot import Bot
12-
from bot.constants import Channels, Colours, ERROR_REPLIES
12+
from bot.constants import Colours, ERROR_REPLIES
1313
from bot.converters import TagNameConverter
1414
from bot.errors import LockedResourceError
1515
from bot.exts.backend.branding._errors import BrandingError
@@ -49,7 +49,6 @@ async def on_command_error(self, ctx: Context, e: errors.CommandError) -> None:
4949
* If CommandNotFound is raised when invoking the tag (determined by the presence of the
5050
`invoked_from_error_handler` attribute), this error is treated as being unexpected
5151
and therefore sends an error message
52-
* Commands in the verification channel are ignored
5352
2. UserInputError: see `handle_user_input_error`
5453
3. CheckFailure: see `handle_check_failure`
5554
4. CommandOnCooldown: send an error message in the invoking context
@@ -65,10 +64,9 @@ async def on_command_error(self, ctx: Context, e: errors.CommandError) -> None:
6564
if isinstance(e, errors.CommandNotFound) and not hasattr(ctx, "invoked_from_error_handler"):
6665
if await self.try_silence(ctx):
6766
return
68-
if ctx.channel.id != Channels.verification:
69-
# Try to look for a tag with the command's name
70-
await self.try_get_tag(ctx)
71-
return # Exit early to avoid logging.
67+
# Try to look for a tag with the command's name
68+
await self.try_get_tag(ctx)
69+
return # Exit early to avoid logging.
7270
elif isinstance(e, errors.UserInputError):
7371
await self.handle_user_input_error(ctx, e)
7472
elif isinstance(e, errors.CheckFailure):

bot/exts/info/tags.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def get_tags() -> dict:
4646
"embed": {
4747
"description": file.read_text(encoding="utf8"),
4848
},
49-
"restricted_to": "developers",
49+
"restricted_to": None,
5050
"location": f"/bot/{file}"
5151
}
5252

@@ -63,7 +63,7 @@ def get_tags() -> dict:
6363
@staticmethod
6464
def check_accessibility(user: Member, tag: dict) -> bool:
6565
"""Check if user can access a tag."""
66-
return tag["restricted_to"].lower() in [role.name.lower() for role in user.roles]
66+
return not tag["restricted_to"] or tag["restricted_to"].lower() in [role.name.lower() for role in user.roles]
6767

6868
@staticmethod
6969
def _fuzzy_search(search: str, target: str) -> float:

bot/exts/moderation/silence.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async def _notifier(self) -> None:
7272

7373

7474
class Silence(commands.Cog):
75-
"""Commands for stopping channel messages for `verified` role in a channel."""
75+
"""Commands for stopping channel messages for `everyone` role in a channel."""
7676

7777
# Maps muted channel IDs to their previous overwrites for send_message and add_reactions.
7878
# Overwrites are stored as JSON.

0 commit comments

Comments
 (0)