Documentation ¶
Index ¶
- Variables
- func GetDIDFromPLCMirror(ctx context.Context, mirror, handle string) (did string, err error)
- func GetHandleFromPLCMirror(ctx context.Context, mirror, did string) (handle string, err error)
- type ChallengeResults
- type Command
- type Consumer
- func (c *Consumer) HandleCreateRecord(ctx context.Context, repo string, path string, rec typegen.CBORMarshaler, ...) (*time.Time, error)
- func (c *Consumer) HandleRepoCommit(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Commit) error
- func (c *Consumer) HandleStreamEvent(ctx context.Context, xe *events.XRPCStreamEvent) error
- func (c *Consumer) ReadCursor(ctx context.Context) error
- func (c *Consumer) WriteCursor(ctx context.Context) error
- type Jazbot
- func (j *Jazbot) AcceptChallenge(ctx context.Context, actorDid string, parentUri string) (string, []*appbsky.RichtextFacet, error)
- func (j *Jazbot) Challenge(ctx context.Context, actorDid string, arg string) (string, []*appbsky.RichtextFacet, *int64, error)
- func (j *Jazbot) ConcludeChallenge(ctx context.Context, event *store_queries.Event) error
- func (j *Jazbot) ConcludeChallenges(ctx context.Context) []error
- func (j *Jazbot) FindFriends(ctx context.Context, actorDid string) (string, []*appbsky.RichtextFacet, error)
- func (j *Jazbot) GetLeaderboard(ctx context.Context, actorDid string) (string, []*appbsky.RichtextFacet, error)
- func (j *Jazbot) GetPDS(ctx context.Context, actorDid string) (string, error)
- func (j *Jazbot) GetPoints(ctx context.Context, actorDid string) (string, error)
- func (j *Jazbot) HandleRequest(ctx context.Context, actorDid string, rkey string, text string, ...) error
- func (j *Jazbot) SearchMyPosts(ctx context.Context, actorDid string, searchText string) (string, []*appbsky.RichtextFacet, error)
- type Progress
Constants ¶
This section is empty.
Variables ¶
View Source
var SupportedCommands = map[string]Command{ "getlikecount": { Name: "getlikecount", Desc: "Get the # of likes you have received", }, "getlikesgiven": { Name: "getlikesgiven", Desc: "Get the # of likes you have given", }, "findmeafriend": { Name: "findmeafriend", Desc: "Find users that have shared interests.\nCandidates are determined by looking at users with similar recent likes who you do not already follow.", }, "challenge": { Name: "challenge", Desc: "Challenge a user to a like battle!" + "\nA like battle is a contest to see who can give the most likes to the other person's posts in a 48 hour period." + "\nYou can only have one active challenge at a time.", Args: []string{"@{handle}"}, }, "points": { Name: "points", Desc: "Get your current points.\nPoints can be acquired by participating in challenges.", }, "search": { Name: "search", Desc: "Search your own posts.\nThe query can be a single word or a phrase that exists somewhere in any of your previous posts.\nTypos aren't supported yet, so make sure you spell everything correctly!", Args: []string{"{query}"}, }, "leaderboard": { Name: "leaderboard", Desc: "Get the top 5 coolest users ever (users with the most points)", }, "getstoveylikes": { Name: "getstoveylikes", Desc: "Get the # of likes Stovey has given you", }, "whereami": { Name: "whereami", Desc: "Get the name of your PDS", }, }
Functions ¶
func GetDIDFromPLCMirror ¶
Types ¶
type ChallengeResults ¶
type Consumer ¶
type Consumer struct { SocketURL string Progress *Progress ProgMux sync.Mutex Logger *zap.SugaredLogger RedisClient *redis.Client ProgressKey string Jazbot *Jazbot }
Consumer is the consumer of the firehose
func NewConsumer ¶
func NewConsumer( ctx context.Context, logger *zap.SugaredLogger, redisClient *redis.Client, redisPrefix string, jazbot *Jazbot, socketURL string, ) (*Consumer, error)
NewConsumer creates a new consumer
func (*Consumer) HandleCreateRecord ¶
func (c *Consumer) HandleCreateRecord( ctx context.Context, repo string, path string, rec typegen.CBORMarshaler, cid *lexutil.LexLink, ) (*time.Time, error)
HandleCreateRecord handles a create record event from the firehose
func (*Consumer) HandleRepoCommit ¶
func (c *Consumer) HandleRepoCommit(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Commit) error
HandleRepoCommit handles a repo commit event from the firehose and processes the records
func (*Consumer) HandleStreamEvent ¶
HandleStreamEvent handles a stream event from the firehose
func (*Consumer) ReadCursor ¶
ReadCursor reads the cursor from redis
type Jazbot ¶
type Jazbot struct { Store *store.Store Client *xrpc.Client Logger *zap.SugaredLogger BotDid string PLCMirror string Directory identity.Directory // contains filtered or unexported fields }
func (*Jazbot) AcceptChallenge ¶
func (*Jazbot) ConcludeChallenge ¶
func (*Jazbot) ConcludeChallenges ¶
func (*Jazbot) FindFriends ¶
func (*Jazbot) GetLeaderboard ¶
func (*Jazbot) HandleRequest ¶
Click to show internal directories.
Click to hide internal directories.