import { ueuse } from "types/types";
import config from "../../config.js";
import { Reply } from "./main.js";

export default async function UnFollow(data: ueuse) {
  const unfollowReq = await fetch(`${config.uwuzu.host}/api/users/unfollow`, {
    method: "POST",
    body: JSON.stringify({
      token: config.uwuzu.apiToken,
      userid: data.account.userid,
    }),
    cache: "no-store",
  });

  const unfollowRes = await unfollowReq.json();

  console.log("フォロー解除: ", unfollowRes);


  const notice = await Reply(`
  ${data.account.username}さんをフォロー解除しました
  `, data.uniqid);

  console.log("フォロー解除通知: ", notice);
}
