Module: MixinBot::API::Me

Included in:
MixinBot::API
Defined in:
lib/mixin_bot/api/me.rb

Instance Method Summary collapse

Instance Method Details

#friends(access_token: nil) ⇒ Object



24
25
26
27
# File 'lib/mixin_bot/api/me.rb', line 24

def friends(access_token: nil)
  path = '/friends'
  client.get path, access_token:
end

#me(access_token: nil) ⇒ Object



6
7
8
9
# File 'lib/mixin_bot/api/me.rb', line 6

def me(access_token: nil)
  path = '/me'
  client.get path, access_token:
end

#safe_me(access_token: nil) ⇒ Object



29
30
31
32
# File 'lib/mixin_bot/api/me.rb', line 29

def safe_me(access_token: nil)
  path = '/safe/me'
  client.get path, access_token:
end

#update_me(**kwargs) ⇒ Object

avatar_base64:

String: Base64 of image, supports format png, jpeg and gif, base64 image size > 1024.


13
14
15
16
17
18
19
20
21
# File 'lib/mixin_bot/api/me.rb', line 13

def update_me(**kwargs)
  path = '/me'
  payload = {
    full_name: kwargs[:full_name],
    avatar_base64: kwargs[:avatar_base64],
    access_token: kwargs[:access_token]
  }
  client.post path, **payload
end