getUserMuted static method
Implementation
static ChannelUserMuted getUserMuted(Event event) {
try {
if (event.kind == 44) {
String? userPubkey;
for (var tag in event.tags) {
if (tag[0] == "p") {
userPubkey = tag[1];
break;
}
}
Map content = jsonDecode(event.content);
String reason = content['reason'];
return ChannelUserMuted(
event.pubkey, userPubkey!, reason, event.createdAt);
}
throw Exception("${event.kind} is not nip28(mute user) compatible");
} catch (e) {
throw Exception(e.toString());
}
}