Don't rely on metadata for appeals
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
export async function onRequestPost(context: RequestContext) {
|
||||
const { metadata, value } = context.data.appeal;
|
||||
const { appeal } = context.data;
|
||||
const body = new FormData();
|
||||
body.append("from", "noreply@mail.carcrushers.cc");
|
||||
body.append("to", value.email);
|
||||
body.append("to", appeal.email);
|
||||
body.append("subject", "Appeal Accepted");
|
||||
body.append("template", "appeal_accepted");
|
||||
body.append("v:note", context.data.body.feedback || "No note provided.");
|
||||
@ -31,7 +31,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
const { current_user: currentUser } = context.data;
|
||||
|
||||
await fetch(
|
||||
`https://discord.com/api/v10/guilds/242263977986359297/bans/${metadata.id}`,
|
||||
`https://discord.com/api/v10/guilds/242263977986359297/bans/${appeal.id}`,
|
||||
{
|
||||
headers: {
|
||||
authorization: `Bot ${context.env.BOT_TOKEN}`,
|
||||
@ -47,7 +47,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
{
|
||||
title: "Appeal Accepted",
|
||||
color: 0x00ff00,
|
||||
description: `Appeal from user ${metadata.tag} (${metadata.id}) was accepted.`,
|
||||
description: `Appeal from user ${appeal.username}#${appeal.discriminator} (${appeal.id}) was accepted.`,
|
||||
fields: [
|
||||
{
|
||||
name: "Moderator",
|
||||
|
Reference in New Issue
Block a user