Skip to content

Commit

Permalink
fix: update twitter query (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
b00f authored Feb 15, 2024
1 parent 521e574 commit da01208
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions twitter_api/twitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (c *Client) RetweetSearch(ctx context.Context, discordID string, twitterNam
UserFields: []twitter.UserField{twitter.UserFieldName},
TweetFields: []twitter.TweetField{twitter.TweetFieldCreatedAt},
}
query := fmt.Sprintf("%v #Pactus from:%v is:quote", discordID, twitterName)
query := fmt.Sprintf("%v (#Pactus pr #PactusBoosterProgram) from:%v is:quote", discordID, twitterName)
logger.Debug("search query", "query", query)

res, err := c.client.TweetRecentSearch(ctx, query, opts)
Expand All @@ -107,11 +107,14 @@ func (c *Client) RetweetSearch(ctx context.Context, discordID string, twitterNam
}

if len(res.Raw.Tweets) == 0 {
return nil, fmt.Errorf("no quote tweet with the hashtag '#Pactus' found. "+
return nil, fmt.Errorf("no eligible quote tweet found. "+
"Please select a tweet from https://x.com/PactusChain and retweet it. "+
"Don't forget to add '#Pactus' and your Discord ID '%v'. "+
"For example you can tweet: \n"+
"`#Pactus Blockchain is running a Twitter campaign to add more validators. Don't miss out!\n%v`", discordID, discordID)
"Don't forget to add '#PactusBoosterProgram' and your Discord ID '%v'. "+
"For example you can tweet: \n\n"+
"```"+
"#Pactus Blockchain just started the Validator Booster Program on Twitter Campaign. Don't miss out! https://discord.com/invite/H5vZkNnXCu\n"+
"#PactusBoosterProgram %v"+
"```", discordID, discordID)
}

quoteTweet := res.Raw.Tweets[0]
Expand Down

0 comments on commit da01208

Please sign in to comment.