Safety
Blocks, mutes and filters, under client.safety.
Blocked and muted accounts
safety.blocked(opts?)
List the accounts you block. Takes { count?, cursor? }. Uses the GraphQL blockedAccountsQuery.
safety.importedBlocked(opts?)
List the accounts you blocked through an imported block list. Uses the GraphQL importedBlockedAccountsQuery.
safety.muted(opts?)
List the accounts you mute. Uses the GraphQL mutedAccountsQuery.
const { users, nextCursor } = await client.safety.blocked({ count: 50 });Replies
safety.toxicReplyFilter()
Get whether the toxic reply filter is on. Uses the GraphQL repliesQuery.
safety.setToxicReplyFilter(enabled)
Turn the toxic reply filter on or off. Uses the GraphQL repliesMutation.
Muted words and conversations
safety.muteKeyword(keyword, opts?)
Mute a word, phrase or hashtag. Uses the v1.1 mutes/keywords/create endpoint. List, update and delete mutes with the account muted keyword methods.
| Option | Type | Description |
|---|---|---|
duration | string | number | Mute length. Leave it out to mute forever. |
muteOptions | string | string[] | "exclude_following_accounts" keeps notifications from people you follow |
muteSurfaces | string | string[] | Default "notifications,home_timeline,tweet_replies" |
await client.safety.muteKeyword("spoilers", { muteSurfaces: ["home_timeline"] });safety.discouragedKeywords()
List the words X advises against muting because they are too common.
safety.muteConversation(tweetId)
Stop notifications from a conversation.
safety.unmuteConversation(tweetId)
Turn notifications from a conversation back on.
Other
safety.feedback(encodedFeedbackRequest, opts?)
Send timeline feedback such as "not interested" with an entry's encoded_feedback_request. Pass { undo: true } to revert it. Uses the GraphQL feedbackContextApplyMutation.
safety.untagMedia(tweetId, mediaIds, userIds?)
Remove a photo tag from a post. Removes you when userIds is left out.
safety.searchSafety(userId?)
Get whether search hides sensitive content (optInFiltering) and accounts you block or mute (optInBlocking).
safety.setSearchSafety({ optInFiltering?, optInBlocking? })
Change the search safety settings.