Skip to content

Commit

Permalink
add missing user-agent header for discord api (#3123)
Browse files Browse the repository at this point in the history
  • Loading branch information
notmd committed May 11, 2023
1 parent 69084f1 commit f25f74a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/oasst_backend/utils/discord.py
Expand Up @@ -36,10 +36,11 @@ def send_new_report_message(message: Message, label_text: str, user_id: UUID) ->
res = requests.post(
f"{ROOT_ENDPOINT}/channels/{settings.DISCORD_CHANNEL_ID}/messages",
headers={
"user-agent": "DiscordBot (https://open-assistant.io, 1)",
"authorization": f"Bot {settings.DISCORD_API_KEY}",
},
json={
"content": f"New flagged message https://open-assistant.io/messages/{message.id}",
"content": f"New flagged message https://open-assistant.io/admin/messages/{message.id}",
"embeds": [message_content_embed, label_text_embed],
},
)
Expand Down

0 comments on commit f25f74a

Please sign in to comment.