How to unfollow? #1245
-
Maybe using |
Beta Was this translation helpful? Give feedback.
Answered by
myConsciousness
Feb 14, 2024
Replies: 1 comment 1 reply
-
Hi @aoisensi This is very easy, basically you can see from the Though there are many different ways to access this property, I show you some examples: From Timelineimport 'package:bluesky/bluesky.dart';
Future<void> main() async {
final bsky = Bluesky.fromSession(
await _session, // This is your session.
);
final timeline = await bsky.feed.getTimeline();
for (final feed in timeline.data.feed) {
final postAuthor = feed.post.author;
// Check if you're following this post author.
if (postAuthor.viewer.isFollowing) {
// Unfollow.
await bsky.repo.deleteRecord(uri: postAuthor.viewer.following!);
}
}
} From Following Listimport 'package:bluesky/bluesky.dart';
Future<void> main() async {
final bsky = Bluesky.fromSession(
await _session, // This is your session.
);
// This is a someone's following list
final follows = await bsky.graph.getFollows(
actor: 'user handle like shinyakato.dev',
);
for (final follow in follows.data.follows) {
// Check if you're following this user.
if (follow.viewer.isFollowing) {
// Unfollow
await bsky.repo.deleteRecord(uri: follow.viewer.following!);
}
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
aoisensi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @aoisensi
This is very easy, basically you can see from the
ActorViewer
object whether you are being followed by a particular user or not.Though there are many different ways to access this property, I show you some examples:
From Timeline