Skip to content

Commit

Permalink
removed beta necessity for sending to nerimity
Browse files Browse the repository at this point in the history
  • Loading branch information
Deutscher775 committed Oct 31, 2024
1 parent d44443b commit d2d556a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/astroidapi/sending_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ async def send_to_guilded(cls, updated_json, endpoint, attachments: list = None)
async def send_to_nerimity(cls, updated_json, endpoint, attachments: list = None):
try:
read_nerimity = await read_handler.ReadHandler.check_read(endpoint, "nerimity")
if read_nerimity is False and updated_json["config"]["isbeta"] is True:
if read_nerimity is False:
async with aiohttp.ClientSession() as session:
response_json = updated_json
sender_channel = response_json["meta"]["sender-channel"]
Expand All @@ -198,9 +198,14 @@ async def send_to_nerimity(cls, updated_json, endpoint, attachments: list = None
raise errors.SendingError.ChannelNotFound(f'The channel {sender_channel} ({updated_json["meta"]["sender"]}) does not seem to be a registered channel on other platforms.')
message_author_name = response_json["meta"]["message"]["author"]["name"]
message_content = response_json["meta"]["message"]["content"]
headers = {
"Authorization": f"{config.NERIMITY_TOKEN}",
}
if updated_json["config"]["isbeta"] is True:
headers = {
"Authorization": f"{config.BETA_NERIMITY_TOKEN}",
}
else:
headers = {
"Authorization": f"{config.NERIMITY_TOKEN}",
}
print(channel_id)
payload = {
"content": f"**{message_author_name}**: {message_content}",
Expand Down

0 comments on commit d2d556a

Please sign in to comment.