File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
wechaty/src/main/kotlin/io/github/wechaty/user Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,13 @@ class Friendship (wechaty: Wechaty):Accessory(wechaty){
3333 return contact
3434 }
3535
36+ fun hello (): String {
37+ if (this .payload == null ) {
38+ throw Exception (" no payload" )
39+ }
3640
41+ return this .payload!! .hello ? : " "
42+ }
3743 fun add (contact : Contact , hello : String ){
3844 log.debug(" add contact: {} hello: {}" ,contact,hello)
3945 wechaty.getPuppet().friendshipAdd(contact.id!! ,hello).get()
@@ -78,7 +84,15 @@ class Friendship (wechaty: Wechaty):Accessory(wechaty){
7884
7985 }
8086
81-
87+ fun type (): FriendshipType ? {
88+ val result = if (this .payload != null ) {
89+ this .payload!! .type
90+ }
91+ else {
92+ FriendshipType .Unknown
93+ }
94+ return result
95+ }
8296 companion object {
8397 private val log = LoggerFactory .getLogger(Friendship ::class .java)
8498 }
You can’t perform that action at this time.
0 commit comments