-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added first blood notifications to discord
- Loading branch information
1 parent
1671533
commit fd61ade
Showing
4 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import axios from "axios"; | ||
|
||
export const notifyForBlood = async ( | ||
{ | ||
teamName, | ||
challengeName, | ||
}: { | ||
teamName: string; | ||
challengeName: string; | ||
} | ||
) => { | ||
try { | ||
const res = await axios.post(process.env.DISCORD_BLOOD_HOOK, { | ||
content: "@here", | ||
tts: false, | ||
embeds: [ | ||
{ | ||
id: Date.now().toString(), | ||
description: "", | ||
fields: [], | ||
title: `🎉 ${teamName} owned first blood 🩸 for ${challengeName}`, | ||
color: 7_782_594, | ||
footer: { | ||
icon_url: "https://rcs.encryptedge.in/logo.png", | ||
text: "eeCTF" | ||
}, | ||
author: { | ||
name: "RCS CTF 2024" | ||
} | ||
} | ||
], | ||
components: [], | ||
actions: {}, | ||
username: "eeCTF Blood Notify" | ||
} | ||
); | ||
return res.data; | ||
} catch (error) { | ||
if(error instanceof Error) { | ||
throw new TypeError(error.message); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters