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

Commit

Permalink
docs: remove redundant todos (#651)
Browse files Browse the repository at this point in the history
If you think they shouldn't be removed, action them
  • Loading branch information
LordOfPolls authored Sep 23, 2022
1 parent 3c3127c commit 4dd840f
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion naff/api/gateway/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ async def dispatch_event(self, data, seq, event) -> None:
)
logger.info(f"Shard {self.shard[0]} has connected to gateway!")
logger.debug(f"Session ID: {self.session_id} Trace: {self._trace}")
# todo: future polls, improve guild caching here. run the debugger. you'll see why
return self.state.client.dispatch(events.WebsocketReady(data))

case "RESUMED":
Expand Down
2 changes: 1 addition & 1 deletion naff/api/http/http_requests/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ async def modify_guild(
)
payload = kwargs.copy()
for key, value in kwargs.items():
if key not in expected or value is None: # todo review
if key not in expected or value is None:
del payload[key]

# only do the request if there is something to modify
Expand Down
2 changes: 1 addition & 1 deletion naff/api/voice/encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def encrypt(self, mode: str, header: bytes, data) -> bytes:
raise RuntimeError(f"Unsupported encryption type requested: {mode}")

def xsalsa20_poly1305_lite(self, header: bytes, data) -> bytes:
# todo: hi!
# todo: redundant but might be useful for some weird edge case
...

def xsalsa20_poly1305_suffix(self, header: bytes, data) -> bytes:
Expand Down
2 changes: 1 addition & 1 deletion naff/api/voice/opus.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def set_expected_pack_loss(self, expected_packet_loss: float) -> None:
self.lib_opus.opus_encoder_ctl(self.encoder, EncoderCTL.CTL_SET_PLP, self.expected_packet_loss)

def encode(self, pcm: bytes) -> bytes:
"""todo: doc"""
"""Encode a frame of audio"""
max_data_bytes = len(pcm)
pcm = ctypes.cast(pcm, c_int16_ptr)
data = (ctypes.c_char * max_data_bytes)()
Expand Down
1 change: 0 additions & 1 deletion naff/client/mixins/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def update_from_dict(self: Type[const.T], data: Dict[str, Any]) -> const.T:
"""
data = self._process_dict(data)
for key, value in self._filter_kwargs(data, self._get_keys()).items():
# todo improve
setattr(self, key, value)

return self
Expand Down
1 change: 0 additions & 1 deletion naff/models/discord/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def from_list(cls: Type[T], datas: List[Dict[str, Any]], client: "Client") -> Li
def update_from_dict(self, data) -> T:
data = self._process_dict(data, self._client)
for key, value in self._filter_kwargs(data, self._get_keys()).items():
# todo improve
setattr(self, key, value)

return self
Expand Down
2 changes: 1 addition & 1 deletion naff/models/discord/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, color: COLOR_TYPES | None = None) -> None:
if re.match(hex_regex, color):
self.hex = color
else:
self.value = BrandColors[color].value # todo exception handling for better message
self.value = BrandColors[color].value
else:
raise TypeError

Expand Down
1 change: 0 additions & 1 deletion naff/models/discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ class Guild(BaseGuild):

@classmethod
def _process_dict(cls, data: Dict[str, Any], client: "Client") -> Dict[str, Any]:
# todo: find a away to prevent this loop from blocking the event loop
data = super()._process_dict(data, client)
guild_id = data["id"]

Expand Down
1 change: 0 additions & 1 deletion tests/test_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ async def test_channels(bot: Client, guild: Guild) -> None:
assert channel.category == guild_category

if isinstance(channel, MessageableMixin) and not isinstance(channel, GuildVoice):
# todo: remove the guild voice exception when text-in-voice releases
_m = await channel.send("test")
assert _m.channel == channel

Expand Down

0 comments on commit 4dd840f

Please sign in to comment.