mirror of
https://github.com/bradganley/bsky-user-activity-bot.git
synced 2025-02-13 19:56:32 +00:00
Added variables to disable/enable event types. Updated examples
Some checks failed
Create and publish the bot container / build-and-push-image (push) Has been cancelled
Some checks failed
Create and publish the bot container / build-and-push-image (push) Has been cancelled
This commit is contained in:
parent
92c366b724
commit
7effbdc970
11
.env.example
11
.env.example
@ -1,10 +1,13 @@
|
||||
TRACKER_BSKY_HANDLE=
|
||||
TRACKER_BSKY_PASSWORD=
|
||||
JETSTREAM_URL='wss://jetstream1.us-west.bsky.network/subscribe'
|
||||
DEBUG_LOG_ACTIVE=true
|
||||
DEBUG_LOG_LEVEL=info
|
||||
|
||||
JETSTREAM_URL='wss://jetstream1.us-west.bsky.network/subscribe'
|
||||
POST_EVENT=true
|
||||
LIKE_EVENT=true
|
||||
BLOCK_EVENT=true
|
||||
REPOST_EVENT=true
|
||||
|
||||
SESSION_DATA_PATH='/sessionData'
|
||||
|
||||
USER_DID=
|
||||
NAME=
|
||||
USER_DID=
|
@ -6,8 +6,12 @@ services:
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- NAME=TEST
|
||||
- USER_DID=did:plc:example
|
||||
#- NAME=TEST
|
||||
#- USER_DID=did:plc:example
|
||||
#- POST_EVENT=true
|
||||
#- LIKE_EVENT=true
|
||||
#- BLOCK_EVENT=true
|
||||
#- REPOST_EVENT=true
|
||||
#- TRACKER_BSKY_HANDLE=
|
||||
#- TRACKER_BSKY_PASSWORD=
|
||||
#- DEBUG_LOG_ACTIVE=true
|
||||
|
16
src/index.ts
16
src/index.ts
@ -25,7 +25,7 @@ let jetstreamSubscription: JetstreamSubscription;
|
||||
|
||||
let handlers = {
|
||||
post: {
|
||||
c: [
|
||||
c: (Bun.env.POST_EVENT !== "false" ? [
|
||||
new MessageHandler(
|
||||
// @ts-ignore
|
||||
[ActionTakenByUserValidator.make(<string>Bun.env.USER_DID)],
|
||||
@ -52,9 +52,11 @@ let handlers = {
|
||||
testAgent
|
||||
)
|
||||
]
|
||||
: []
|
||||
)
|
||||
},
|
||||
like: {
|
||||
c: [
|
||||
c: (Bun.env.LIKE_EVENT !== "false" ? [
|
||||
new MessageHandler(
|
||||
// @ts-ignore
|
||||
[ActionTakenByUserValidator.make(<string>Bun.env.USER_DID)],
|
||||
@ -67,9 +69,11 @@ let handlers = {
|
||||
testAgent
|
||||
)
|
||||
]
|
||||
: []
|
||||
)
|
||||
},
|
||||
repost: {
|
||||
c: [
|
||||
c: (Bun.env.REPOST_EVENT !== "false" ? [
|
||||
new MessageHandler(
|
||||
// @ts-ignore
|
||||
[ActionTakenByUserValidator.make(<string>Bun.env.USER_DID)],
|
||||
@ -82,9 +86,11 @@ let handlers = {
|
||||
testAgent
|
||||
)
|
||||
]
|
||||
: []
|
||||
)
|
||||
},
|
||||
block: {
|
||||
c: [
|
||||
c: (Bun.env.BLOCK_EVENT !== "false" ? [
|
||||
new MessageHandler(
|
||||
// @ts-ignore
|
||||
[
|
||||
@ -100,6 +106,8 @@ let handlers = {
|
||||
testAgent
|
||||
)
|
||||
]
|
||||
: []
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user