32 lines
893 B
TypeScript
32 lines
893 B
TypeScript
import { ueuse } from "types/types.js";
|
|
import config from "../../config.js";
|
|
|
|
export default async function UnFollow(data: ueuse) {
|
|
const unfollowReq = await fetch(`https://${config.uwuzu.host}/api/users/unfollow/`, {
|
|
method: "POST",
|
|
body: JSON.stringify({
|
|
token: config.uwuzu.apiToken,
|
|
userid: data.account.userid,
|
|
}),
|
|
});
|
|
|
|
const unfollowRes = await unfollowReq.json();
|
|
|
|
console.log("フォロー解除: ", unfollowRes);
|
|
|
|
const noticeReq = await fetch(`https://${config.uwuzu.host}/api/ueuse/create/`, {
|
|
method: "POST",
|
|
body: JSON.stringify({
|
|
token: config.uwuzu.apiToken,
|
|
text: `
|
|
${data.account.username}さんをフォロー解除しました
|
|
`,
|
|
replyid: data.uniqid,
|
|
}),
|
|
});
|
|
|
|
const noticeRes = await noticeReq.json();
|
|
|
|
console.log("フォロー解除通知: ", noticeRes);
|
|
}
|