Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add contest bot webhook #10529

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Add contest bot webhook #10529

wants to merge 11 commits into from

Conversation

rbennettcw
Copy link
Contributor

@rbennettcw rbennettcw commented Jan 8, 2025

Link to Issue

Closes: #10375
Closes: #10628

Description of Changes

  • Implements contest bot to launch contests via farcaster post

Test Plan

  • Using the private key account, create a new community w/ namespace
  • In neynar dashboard, create new webhook called ContestBotMentioned (YourName)
    • Set target to <your ngrok domain>/api/integration/farcaster/CastUpvoteAction
    • Filter on Cast Created + mentioned FIDs and enter 948630

Set envs:

  • NEYNAR_BOT_UUID (from Neynar, CW Local app)

  • NEYNAR_CONTEST_BOT_MENTIONED_WEBHOOK_SECRET (from Neynar, CW Local app)

  • CONTEST_BOT_NAMESPACE (namespace must be created by bot wallet)

  • CONTEST_BOT_PRIVATE_KEY (same as the PRIVATE_KEY)

  • On warpcast, post cast to commondemo bot: hey @commondemo create a contest with the token 0x429ae85883f82203D736e8fc203A455990745ca1 with 25% of prize amount allocated to voters and a third to each of three winners. The contest title is “new contest 123”. Use the following image https://placehold.co/600x400/EEE/31343C

  • Wait a few second for a reply– confirm that it's a contest frame posted by the bot

Deployment Plan

Set envs:

  • NEYNAR_BOT_UUID
  • NEYNAR_CONTEST_BOT_MENTIONED_WEBHOOK_SECRET
  • CONTEST_BOT_NAMESPACE
  • CONTEST_BOT_PRIVATE_KEY

Other Considerations

N/A

@rbennettcw rbennettcw marked this pull request as draft January 8, 2025 22:16
@rbennettcw rbennettcw requested a review from Rotorsoft January 9, 2025 22:26

// This webhook processes the "cast.created" event
// triggered when the contest bot is mentioned on farcaster
export function FarcasterContestBotMentionedWebhook(): Command<
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commands should be using imperative names describing the action, for consistency. In this case we are relaying Neynar events to the Outbox... so, we should probably start a convention here like RelayFarcasterContestBotMentioned or something similar that's easy to find when looking for all relays

@dillchen dillchen self-requested a review January 13, 2025 18:57
@rbennettcw rbennettcw marked this pull request as ready for review January 17, 2025 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve contest bot prompting Contest Bot: Implement Webhook
2 participants