Compare commits

..

2 commits

Author SHA1 Message Date
zeon-neon[bot]
f336ec37b3
enhancement(lint): Fix lint errors for hackclub-spotify-bot/src/index.js
Some checks failed
Remote SSH Command / Build (push) Has been cancelled
Co-authored-by: NeonGamerBot-QK <saahilattud@gmail.com>
Signed-off-by: zeon-neon[bot] <136533918+zeon-neon[bot]@users.noreply.github.com>
2024-10-26 21:46:11 +00:00
Saahil
f159a1a89d
update: bundle route 2024-10-26 17:46:08 -04:00

View file

@ -202,11 +202,16 @@ app.post("/spotify/submitsong", async (req, res) => {
added_at: Date.now(), added_at: Date.now(),
}); });
addSongToPlaylist(formattedURI); addSongToPlaylist(formattedURI);
fetch("https://slack.mybot.saahild.com/send-private", { fetch("https://slack.mybot.saahild.com/send-spotify", {
method: "POST", method: "POST",
body: JSON.stringify({ body: JSON.stringify({
channel: "C07RE4N7S4B", // message: {
text: `:new_spotify: New Song: ${songurl} - added by <@${req.session.info.user.id}>`, // channel: "C07RE4N7S4B",
// text: `:new_spotify: New Song: ${songurl} - added by <@${req.session.info.user.id}>`,
// },
songurl,
user: req.session.info.user.id,
noping: Boolean(process.env.TESTING),
}), }),
headers: { headers: {
Authorization: process.env.AUTH_FOR_ZEON, Authorization: process.env.AUTH_FOR_ZEON,
@ -215,32 +220,32 @@ app.post("/spotify/submitsong", async (req, res) => {
}) })
.then((r) => r.json()) .then((r) => r.json())
.then((d) => { .then((d) => {
fetch("https://slack.mybot.saahild.com/send-private", { // fetch("https://slack.mybot.saahild.com/send-private", {
method: "POST", // method: "POST",
body: JSON.stringify({ // body: JSON.stringify({
channel: "C07RE4N7S4B", // channel: "C07RE4N7S4B",
thread_ts: d.ts, // thread_ts: d.ts,
text: `:thread: Responses about new song here please!`, // text: `:thread: Responses about new song here please!`,
}), // }),
headers: { // headers: {
Authorization: process.env.AUTH_FOR_ZEON, // Authorization: process.env.AUTH_FOR_ZEON,
"Content-Type": "application/json", // "Content-Type": "application/json",
}, // },
// });
}); });
}); // if (!process.env.TESTING) {
if (!process.env.TESTING) { // fetch("https://slack.mybot.saahild.com/send-private", {
fetch("https://slack.mybot.saahild.com/send-private", { // method: "POST",
method: "POST", // body: JSON.stringify({
body: JSON.stringify({ // channel: "C07RE4N7S4B",
channel: "C07RE4N7S4B", // text: `<!subteam^S07RGTY93J8>`,
text: `<!subteam^S07RGTY93J8>`, // }),
}), // headers: {
headers: { // Authorization: process.env.AUTH_FOR_ZEON,
Authorization: process.env.AUTH_FOR_ZEON, // "Content-Type": "application/json",
"Content-Type": "application/json", // },
}, // });
}); // }
}
res.redirect("/home?s=1"); res.redirect("/home?s=1");
}); });
app.get("/spotify/link", async (req, res) => { app.get("/spotify/link", async (req, res) => {