Advertisement
xpppppppaicyber

Untitled

Aug 12th, 2024
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { farcasterHubContext } from "frames.js/middleware";
  2. import { createFrames, Button } from 'frames.js/express';
  3.  
  4. const frames = createFrames({
  5.   middleware: [
  6.     farcasterHubContext({
  7.       // remove if you aren't using @frames.js/debugger or you just don't want to use the debugger hub
  8.       ...(process.env.NODE_ENV === "production"
  9.         ? {}
  10.         : {
  11.             hubHttpUrl: "http://localhost:3010/hub",
  12.           }),
  13.     }),
  14.   ],
  15. });
  16.  
  17. export const handleRequest = frames(async ctx => {
  18.   const backgroundStyle = {
  19.     backgroundImage: "url('https://cdn.discordapp.com/attachments/1112779711488209016/1272625640520159324/image.png?ex=66bba87c&is=66ba56fc&hm=fa3c7107b06270a581ad38ab39d2e1a0ea9bad8abc826e7c57e2284910dc4d3d&')",
  20.     backgroundSize: 'cover',
  21.     backgroundRepeat: 'no-repeat',
  22.     backgroundPosition: 'center',
  23.     width: '100%',
  24.     height: '100%',
  25.     display: "flex",
  26.     flexDirection: "column",
  27.     color: "white", // Adjust text color for visibility
  28.     textShadow: "2px 2px 4px rgba(0,0,0,0.5)", // Optional: add shadow for better readability
  29.   };
  30.  
  31.   return {
  32.     image: ctx.message ? (
  33.       console.log(ctx.message),
  34.       <div style={backgroundStyle}>
  35.         {ctx.message.requesterFollowsCaster == true
  36.           ? "Thanks for the follow"
  37.           : "you didn't follow XppaiCyber"}
  38.       </div>
  39.     ) : (
  40.       <div style={backgroundStyle}>
  41.         Get Most Efficient Energy on Pixels
  42.         Just need to Follow @xppaicyber to see the data
  43.       </div>
  44.     ),
  45.     buttons: !ctx.url.searchParams.has("hehe")
  46.       ? [
  47.           <Button action="post" key="1" target={{ query: { hehe: true } }}>
  48.             Get Most Efficient Energy
  49.           </Button>,
  50.           <Button action="link" target="https://warpcast.com/xppaicyber">XppaiCyber</Button>,
  51.         ]
  52.       : [],
  53.   };
  54. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement