diff --git a/api/discord/feed-sync.ts b/api/discord/feed-sync.ts index 6ff46d5f..3ceccfbe 100644 --- a/api/discord/feed-sync.ts +++ b/api/discord/feed-sync.ts @@ -78,7 +78,8 @@ export default async function handler(req: any, res: any) { fields: [ { name: "Arm", - value: post.arm_affiliation.charAt(0).toUpperCase() + + value: + post.arm_affiliation.charAt(0).toUpperCase() + post.arm_affiliation.slice(1), inline: true, }, @@ -102,8 +103,7 @@ export default async function handler(req: any, res: any) { }, body: JSON.stringify({ username: "AeThex Community Feed", - avatar_url: - "https://aethex.dev/logo.png", // Update with your logo URL + avatar_url: "https://aethex.dev/logo.png", // Update with your logo URL embeds: [embed], }), }); diff --git a/api/integrations/fourthwall.ts b/api/integrations/fourthwall.ts index f69e668b..86e5a618 100644 --- a/api/integrations/fourthwall.ts +++ b/api/integrations/fourthwall.ts @@ -143,23 +143,21 @@ async function handleSyncProducts(req: any, res: any) { const syncResults = []; for (const product of products) { - const { error } = await supabase - .from("fourthwall_products") - .upsert( - { - fourthwall_id: product.id, - name: product.name, - description: product.description, - price: product.price, - currency: product.currency, - image_url: product.image_url, - category: product.category, - synced_at: new Date().toISOString(), - }, - { - onConflict: "fourthwall_id", - }, - ); + const { error } = await supabase.from("fourthwall_products").upsert( + { + fourthwall_id: product.id, + name: product.name, + description: product.description, + price: product.price, + currency: product.currency, + image_url: product.image_url, + category: product.category, + synced_at: new Date().toISOString(), + }, + { + onConflict: "fourthwall_id", + }, + ); syncResults.push({ product_id: product.id, @@ -267,16 +265,14 @@ async function handleOrderCreated(data: any) { const { order_id, customer_email, items, total_amount } = data; // Store order in database for later processing - const { error } = await supabase - .from("fourthwall_orders") - .insert({ - fourthwall_order_id: order_id, - customer_email, - items: items || [], - total_amount, - status: "pending", - created_at: new Date().toISOString(), - }); + const { error } = await supabase.from("fourthwall_orders").insert({ + fourthwall_order_id: order_id, + customer_email, + items: items || [], + total_amount, + status: "pending", + created_at: new Date().toISOString(), + }); if (error) { console.error("[Fourthwall] Failed to store order:", error); diff --git a/discord-bot/events/messageCreate.js b/discord-bot/events/messageCreate.js index 1eb0bcad..d3588261 100644 --- a/discord-bot/events/messageCreate.js +++ b/discord-bot/events/messageCreate.js @@ -16,10 +16,7 @@ module.exports = { if (message.author.bot) return; // Only listen to messages in the feed channel - if ( - FEED_CHANNEL_ID && - message.channelId !== FEED_CHANNEL_ID - ) { + if (FEED_CHANNEL_ID && message.channelId !== FEED_CHANNEL_ID) { return; } @@ -56,7 +53,10 @@ module.exports = { .single(); if (profileError || !userProfile) { - console.error("[Feed Sync] Could not fetch user profile:", profileError); + console.error( + "[Feed Sync] Could not fetch user profile:", + profileError, + ); return; } @@ -81,9 +81,9 @@ module.exports = { if (imageExtensions.some((ext) => attachmentLower.endsWith(ext))) { mediaType = "image"; - } else if (videoExtensions.some((ext) => - attachmentLower.endsWith(ext), - )) { + } else if ( + videoExtensions.some((ext) => attachmentLower.endsWith(ext)) + ) { mediaType = "video"; } } @@ -106,8 +106,7 @@ module.exports = { else if (guildNameLower.includes("corp")) armAffiliation = "corp"; else if (guildNameLower.includes("foundation")) armAffiliation = "foundation"; - else if (guildNameLower.includes("devlink")) - armAffiliation = "devlink"; + else if (guildNameLower.includes("devlink")) armAffiliation = "devlink"; else if (guildNameLower.includes("nexus")) armAffiliation = "nexus"; else if (guildNameLower.includes("staff")) armAffiliation = "staff"; } @@ -149,7 +148,10 @@ module.exports = { try { await message.react("✅"); } catch (reactionError) { - console.warn("[Feed Sync] Could not add success reaction:", reactionError); + console.warn( + "[Feed Sync] Could not add success reaction:", + reactionError, + ); } // Send confirmation DM @@ -166,7 +168,10 @@ module.exports = { try { await message.react("⚠️"); } catch (reactionError) { - console.warn("[Feed Sync] Could not add warning reaction:", reactionError); + console.warn( + "[Feed Sync] Could not add warning reaction:", + reactionError, + ); } } },