Skip to content

Commit 4d4d113

Browse files
committed
it was an indexerror..
1 parent 8022cb9 commit 4d4d113

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/astroidapi/sending_handler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ async def send_to_discord(cls, updated_json, endpoint, attachments: list = None)
126126
webhook = updated_json["config"]["webhooks"]["discord"][updated_json["config"]["channels"]["revolt"].index(updated_json["meta"]["sender-channel"])]
127127
else:
128128
raise errors.SendingError.ChannelNotFound(f'The channel {updated_json["meta"]["sender-channel"]} ({updated_json["meta"]["sender"]}) does not seem to be a registered channel on other platforms.')
129-
except KeyError:
129+
except IndexError:
130130
return True
131131
nextcord_files = []
132132
if attachments is not None:
@@ -176,7 +176,7 @@ async def send_to_guilded(cls, updated_json, endpoint, attachments: list = None)
176176
webhook = updated_json["config"]["webhooks"]["guilded"][updated_json["config"]["channels"]["revolt"].index(updated_json["meta"]["sender-channel"])]
177177
else:
178178
raise errors.SendingError.ChannelNotFound(f'The channel {updated_json["meta"]["sender-channel"]} ({updated_json["meta"]["sender"]}) does not seem to be a registered channel on other platforms.')
179-
except KeyError:
179+
except IndexError:
180180
return True
181181
guilded_files = []
182182
if attachments is not None:
@@ -236,7 +236,7 @@ async def send_to_nerimity(cls, updated_json, endpoint, attachments: list = None
236236
channel_id = response_json["config"]["channels"]["nerimity"][response_json["config"]["channels"]["revolt"].index(sender_channel)]
237237
else:
238238
raise errors.SendingError.ChannelNotFound(f'The channel {sender_channel} ({updated_json["meta"]["sender"]}) does not seem to be a registered channel on other platforms.')
239-
except KeyError:
239+
except IndexError:
240240
return True
241241
message_author_name = response_json["meta"]["message"]["author"]["name"]
242242
message_content = response_json["meta"]["message"]["content"]
@@ -308,7 +308,7 @@ async def send_to_revolt(cls, updated_json, endpoint, attachments: list = None):
308308
channel_id = updated_json["config"]["channels"]["revolt"][updated_json["config"]["channels"]["nerimity"].index(updated_json["meta"]["sender-channel"])]
309309
else:
310310
raise errors.SendingError.ChannelNotFound(f"The channel {updated_json["meta"]["sender-channel"]} ({updated_json["meta"]["sender"]}) does not seem to be a registered channel on other platforms.")
311-
except KeyError:
311+
except IndexError:
312312
return True
313313
headers = {
314314
"X-Bot-Token": f"{config.REVOLT_TOKEN}"

0 commit comments

Comments
 (0)