Skip to content

Commit 220590c

Browse files
kwzrdShivansh-007jb3
committed
Branding: apply documentation improvements after review
No code changes in this commit. Co-authored-by: Shivansh-007 <[email protected]> Co-authored-by: Joe Banks <[email protected]>
1 parent a14dd82 commit 220590c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

bot/exts/backend/branding/_cog.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ async def apply_asset(self, asset_type: AssetType, download_url: str) -> bool:
144144

145145
timeout = 10 # Seconds.
146146
try:
147-
with async_timeout.timeout(timeout):
147+
with async_timeout.timeout(timeout): # Raise after `timeout` seconds.
148148
await pydis.edit(**{asset_type.value: file})
149149
except discord.HTTPException:
150150
log.exception("Asset upload to Discord failed.")
@@ -160,7 +160,7 @@ async def apply_banner(self, banner: RemoteObject) -> bool:
160160
"""
161161
Apply `banner` to the guild and cache its hash if successful.
162162
163-
Banners should always be applied via this method in order to ensure that the last hash is cached.
163+
Banners should always be applied via this method to ensure that the last hash is cached.
164164
165165
Return a boolean indicating whether the application was successful.
166166
"""
@@ -217,9 +217,9 @@ async def maybe_rotate_icons(self) -> None:
217217
"""
218218
Call `rotate_icons` if the configured amount of time has passed since last rotation.
219219
220-
We offset the calculated time difference into the future in order to avoid off-by-a-little-bit errors.
221-
Because there is work to be done before the timestamp is read and written, the next read will likely
222-
commence slightly under 24 hours after the last write.
220+
We offset the calculated time difference into the future to avoid off-by-a-little-bit errors. Because there
221+
is work to be done before the timestamp is read and written, the next read will likely commence slightly
222+
under 24 hours after the last write.
223223
"""
224224
log.debug("Checking whether it's time for icons to rotate.")
225225

@@ -298,7 +298,7 @@ async def enter_event(self, event: Event) -> t.Tuple[bool, bool]:
298298
299299
We cache `event` information to ensure that we:
300300
* Remember which event we're currently in across restarts
301-
* Provide an on-demand information embed without re-querying the branding repository
301+
* Provide an on-demand informational embed without re-querying the branding repository
302302
303303
An event change should always be handled via this function, as it ensures that the cache is populated.
304304
@@ -487,7 +487,7 @@ async def daemon_before(self) -> None:
487487
log.trace("Daemon before: calculating time to sleep before loop begins.")
488488
now = datetime.utcnow()
489489

490-
# The actual midnight moment is offset into the future in order to prevent issues with imprecise sleep.
490+
# The actual midnight moment is offset into the future to prevent issues with imprecise sleep.
491491
tomorrow = now + timedelta(days=1)
492492
midnight = datetime.combine(tomorrow, time(minute=1))
493493

bot/exts/backend/branding/_repository.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
HEADERS["Authorization"] = f"token {Keys.github}"
2020

2121
# Since event periods are year-agnostic, we parse them into `datetime` objects with a manually inserted year.
22-
# Please note that this is intentionally a leap year in order to allow Feb 29 to be valid.
22+
# Please note that this is intentionally a leap year to allow Feb 29 to be valid.
2323
ARBITRARY_YEAR = 2020
2424

2525
# Format used to parse date strings after we inject `ARBITRARY_YEAR` at the end.

0 commit comments

Comments
 (0)