Module: DBLista::User::Verification

Included in:
Client
Defined in:
lib/dblista/user/verification.rb

Overview

User client - verification (only for staff)

Instance Method Summary collapse

Instance Method Details

#approve(id, reason = 'Brak powodu') ⇒ Boolean

Approves specified bot

Parameters:

  • id (Integer)

    bot ID

  • reason (String) (defaults to: 'Brak powodu')

    reason for approving

Returns:

  • (Boolean)

    true if operation succeded



13
14
15
16
17
18
# File 'lib/dblista/user/verification.rb', line 13

def approve(id, reason = 'Brak powodu')
  DBLista._validate_id id

  DBLista._post("/bots/verify/#{id}/approve?reason=#{CGI.escape reason}", nil, @token)
  true
end

#reject(id, reason = 'Brak powodu') ⇒ Boolean

Rejects specified bot

Parameters:

  • id (Integer)

    bot ID

  • reason (String) (defaults to: 'Brak powodu')

    reason for rejecting

Returns:

  • (Boolean)

    true if operation succeded



25
26
27
28
29
30
# File 'lib/dblista/user/verification.rb', line 25

def reject(id, reason = 'Brak powodu')
  DBLista._validate_id id

  DBLista._post("/bots/verify/#{id}/reject?reason=#{CGI.escape reason}", nil, @token)
  true
end

#set_pending(id) ⇒ Boolean

Sets specified bot verification status to pending

Parameters:

  • id (Integer)

    bot ID

Returns:

  • (Boolean)

    true if operation succeded



36
37
38
39
40
41
# File 'lib/dblista/user/verification.rb', line 36

def set_pending(id)
  DBLista._validate_id id

  DBLista._post("/bots/#{id}/set-pending", nil, @token)
  true
end