Skip to main content

Topic - Friendship Events

Description

This topic can be used to monitor changes to the friendship state of a specified user with others.

Possible friendship changes include:

  • Requested
  • Rejected
  • Accepted
  • Removed
  • and self variants (i.e. when this account itself is responsible for the change rather than the other entity)

With all undocumented topics, use at your own risk.

danger

Twitch removed the friendship (and, by extension, presence) system in May 2022. As such, this topic is no longer usable.

Method Definition

NameTypeDescription
credentialOAuth2CredentialUser Auth Token for the target user id, with the scope user_friends_read
userIdStringTarget User Id

Code-Snippets

Subscribe to friendship events for user twitch4j and register a listener that prints all messages to console

twitchClient.getPubSub().listenForFriendshipEvents(credential, "149223493");

twitchClient.getEventManager().onEvent(FriendshipEvent.class, System.out::println);