Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
koishi-plugin-retweet-notifier
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
3rdeye
koishi-plugin-retweet-notifier
Commits
67739fb7
Commit
67739fb7
authored
Jan 14, 2023
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuck musk ban tweet
parent
5784df90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
src/index.ts
src/index.ts
+8
-5
No files found.
src/index.ts
View file @
67739fb7
...
@@ -104,14 +104,14 @@ export default class RetweetNotifierPlugin extends SchedulePlugin(
...
@@ -104,14 +104,14 @@ export default class RetweetNotifierPlugin extends SchedulePlugin(
async
send
()
{
async
send
()
{
let
{
data
:
tweets
}
=
await
this
.
http
.
post
<
{
data
:
Tweet
[]
}
>
(
let
{
data
:
tweets
}
=
await
this
.
http
.
post
<
{
data
:
Tweet
[]
}
>
(
this
.
config
.
endpoint
+
'
/
Search
'
,
this
.
config
.
endpoint
+
'
/
Profile
'
,
{
{
Username
:
this
.
config
.
username
,
Username
:
this
.
config
.
username
,
Since
:
moment
()
Since
:
moment
()
.
subtract
(
this
.
config
.
traceDays
,
'
days
'
)
.
subtract
(
this
.
config
.
traceDays
,
'
days
'
)
.
utc
()
.
utc
()
.
format
(
'
YYYY-MM-DD HH:mm:ss
'
),
.
format
(
'
YYYY-MM-DD HH:mm:ss
'
),
Search
:
this
.
config
.
search
||
undefined
,
//
Search: this.config.search || undefined,
},
},
{
{
headers
:
{
headers
:
{
...
@@ -120,9 +120,12 @@ export default class RetweetNotifierPlugin extends SchedulePlugin(
...
@@ -120,9 +120,12 @@ export default class RetweetNotifierPlugin extends SchedulePlugin(
},
},
);
);
// tweets = tweets.filter((t) => t.retweets_count === 0); // notify non-retweets only
// tweets = tweets.filter((t) => t.retweets_count === 0); // notify non-retweets only
tweets
=
await
asyncFilter
(
tweets
,
(
tweet
)
=>
tweets
=
await
asyncFilter
(
tweets
,
(
tweet
)
=>
{
this
.
notNotified
(
tweet
.
id_str
),
if
(
tweet
.
reply_to
?.
length
||
tweet
.
tweet
.
startsWith
(
'
RT
'
))
return
false
;
// ignore replies and retweets
);
if
(
this
.
config
.
search
&&
!
tweet
.
tweet
.
includes
(
this
.
config
.
search
))
return
false
;
// ignore tweets not containing search keyword
return
this
.
notNotified
(
tweet
.
id_str
);
});
if
(
!
tweets
.
length
)
return
;
if
(
!
tweets
.
length
)
return
;
const
leastRetweet
=
_
.
minBy
(
const
leastRetweet
=
_
.
minBy
(
tweets
,
tweets
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment