Class: Vk::API::Board

Inherits:
Schema::Namespace show all
Defined in:
lib/vk/api/types.rb,
lib/vk/api/methods.rb,
lib/vk/api/objects.rb,
lib/vk/api/responses.rb,
lib/vk/api/board/topic.rb,
lib/vk/api/board/topic_poll.rb,
lib/vk/api/board/default_order.rb,
lib/vk/api/board/topic_comment.rb,
lib/vk/api/board/methods/add_topic.rb,
lib/vk/api/board/methods/fix_topic.rb,
lib/vk/api/board/methods/edit_topic.rb,
lib/vk/api/board/methods/get_topics.rb,
lib/vk/api/board/methods/open_topic.rb,
lib/vk/api/board/methods/close_topic.rb,
lib/vk/api/board/methods/unfix_topic.rb,
lib/vk/api/board/methods/delete_topic.rb,
lib/vk/api/board/methods/edit_comment.rb,
lib/vk/api/board/methods/get_comments.rb,
lib/vk/api/board/methods/create_comment.rb,
lib/vk/api/board/methods/delete_comment.rb,
lib/vk/api/board/methods/restore_comment.rb,
lib/vk/api/board/responses/add_topic_response.rb,
lib/vk/api/board/responses/fix_topic_response.rb,
lib/vk/api/board/responses/edit_topic_response.rb,
lib/vk/api/board/responses/get_topics_response.rb,
lib/vk/api/board/responses/open_topic_response.rb,
lib/vk/api/board/responses/close_topic_response.rb,
lib/vk/api/board/responses/unfix_topic_response.rb,
lib/vk/api/board/responses/delete_topic_response.rb,
lib/vk/api/board/responses/edit_comment_response.rb,
lib/vk/api/board/responses/get_comments_response.rb,
lib/vk/api/board/responses/create_comment_response.rb,
lib/vk/api/board/responses/delete_comment_response.rb,
lib/vk/api/board/responses/restore_comment_response.rb

Defined Under Namespace

Modules: Methods, Responses Classes: Topic, TopicComment, TopicPoll

Constant Summary collapse

DefaultOrder =

Sort type

API::Types::Coercible::Int.enum(1, 2, -1, -2)

Instance Attribute Summary

Attributes inherited from Schema::Namespace

#client

DSL collapse

Methods inherited from Schema::Namespace

#call, #initialize

Constructor Details

This class inherits a constructor from Vk::Schema::Namespace

Instance Method Details

#add_topic(arguments = {}) ⇒ Vk::API::Board::Responses::AddTopicResponse

Returns Creates a new topic on a community's discussion board.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :group_id (Integer)

    ID of the community that owns the discussion board.

  • :title (String)

    Topic title.

  • :text (String)

    Text of the topic.

  • :from_group (Boolean)

    For a community:; '1' — to post the topic as by the community; '0' — to post the topic as by the user (default)

  • :attachments (Array)

    List of media objects attached to the topic, in the following format:; ","; '' — Type of media object:; 'photo' — photo; 'video' — video; 'audio' — audio; 'doc' — document; '' — ID of the media owner. ; '' — Media ID.; ; Example:; "photo100172_166443618,photo66748_265827614"; ; "NOTE: If you try to attach more than one reference, an error will be thrown.";

Returns:

See Also:



2906
2907
2908
2909
2910
2911
2912
# File 'lib/vk/api/methods.rb', line 2906

def add_topic(arguments = {})
  require "vk/api/board/methods/add_topic"
  method = Methods::AddTopic.new(arguments)
  response = method.call(@client)
  require "vk/api/board/responses/add_topic_response"
  Responses::AddTopicResponse.new(response.deep_symbolize_keys)
end

#close_topic(arguments = {}) ⇒ Vk::API::Board::Responses::CloseTopicResponse

Returns Closes a topic on a community's discussion board so that comments cannot be posted.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :group_id (Integer)

    ID of the community that owns the discussion board.

  • :topic_id (Integer)

    Topic ID.

Returns:

See Also:



3013
3014
3015
3016
3017
3018
3019
# File 'lib/vk/api/methods.rb', line 3013

def close_topic(arguments = {})
  require "vk/api/board/methods/close_topic"
  method = Methods::CloseTopic.new(arguments)
  response = method.call(@client)
  require "vk/api/board/responses/close_topic_response"
  Responses::CloseTopicResponse.new(response.deep_symbolize_keys)
end

#create_comment(arguments = {}) ⇒ Vk::API::Board::Responses::CreateCommentResponse

Returns Adds a comment on a topic on a community's discussion board.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :group_id (Integer)

    ID of the community that owns the discussion board.

  • :topic_id (Integer)

    ID of the topic to be commented on.

  • :message (String) — default: Required if 'attachments' is not set.

    Text of the comment.

  • :attachments (Array) — default: Required if 'text' is not set.

    List of media objects attached to the comment, in the following format:; ","; '' — Type of media object:; 'photo' — photo; 'video' — video; 'audio' — audio; 'doc' — document; '' — ID of the media owner. ; '' — Media ID.

  • :from_group (Boolean)

    '1' — to post the comment as by the community; '0' — to post the comment as by the user (default)

  • :sticker_id (Integer)

    Sticker ID.

  • :guid (String)

    Unique identifier to avoid repeated comments.

Returns:

See Also:



2923
2924
2925
2926
2927
2928
2929
# File 'lib/vk/api/methods.rb', line 2923

def create_comment(arguments = {})
  require "vk/api/board/methods/create_comment"
  method = Methods::CreateComment.new(arguments)
  response = method.call(@client)
  require "vk/api/board/responses/create_comment_response"
  Responses::CreateCommentResponse.new(response.deep_symbolize_keys)
end

#delete_comment(arguments = {}) ⇒ Vk::API::Board::Responses::DeleteCommentResponse

Returns Deletes a comment on a topic on a community's discussion board.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :group_id (Integer)

    ID of the community that owns the discussion board.

  • :topic_id (Integer)

    Topic ID.

  • :comment_id (Integer)

    Comment ID.

Returns:

See Also:



2989
2990
2991
2992
2993
2994
2995
# File 'lib/vk/api/methods.rb', line 2989

def delete_comment(arguments = {})
  require "vk/api/board/methods/delete_comment"
  method = Methods::DeleteComment.new(arguments)
  response = method.call(@client)
  require "vk/api/board/responses/delete_comment_response"
  Responses::DeleteCommentResponse.new(response.deep_symbolize_keys)
end

#delete_topic(arguments = {}) ⇒ Vk::API::Board::Responses::DeleteTopicResponse

Returns Deletes a topic from a community's discussion board.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :group_id (Integer)

    ID of the community that owns the discussion board.

  • :topic_id (Integer)

    Topic ID.

Returns:

See Also:



2935
2936
2937
2938
2939
2940
2941
# File 'lib/vk/api/methods.rb', line 2935

def delete_topic(arguments = {})
  require "vk/api/board/methods/delete_topic"
  method = Methods::DeleteTopic.new(arguments)
  response = method.call(@client)
  require "vk/api/board/responses/delete_topic_response"
  Responses::DeleteTopicResponse.new(response.deep_symbolize_keys)
end

#edit_comment(arguments = {}) ⇒ Vk::API::Board::Responses::EditCommentResponse

Returns Edits a comment on a topic on a community's discussion board.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :group_id (Integer)

    ID of the community that owns the discussion board.

  • :topic_id (Integer)

    Topic ID.

  • :comment_id (Integer)

    ID of the comment on the topic.

  • :message (String) — default: Required if 'attachments' is not set

    . New comment text.

  • :attachments (Array) — default: Required if 'message' is not set.

    List of media objects attached to the comment, in the following format:; ","; '' — Type of media object:; 'photo' — photo; 'video' — video; 'audio' — audio; 'doc' — document; '' — ID of the media owner. ; '' — Media ID.; ; Example:; "photo100172_166443618,photo66748_265827614"

Returns:

See Also:



2963
2964
2965
2966
2967
2968
2969
# File 'lib/vk/api/methods.rb', line 2963

def edit_comment(arguments = {})
  require "vk/api/board/methods/edit_comment"
  method = Methods::EditComment.new(arguments)
  response = method.call(@client)
  require "vk/api/board/responses/edit_comment_response"
  Responses::EditCommentResponse.new(response.deep_symbolize_keys)
end

#edit_topic(arguments = {}) ⇒ Vk::API::Board::Responses::EditTopicResponse

Returns Edits the title of a topic on a community's discussion board.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :group_id (Integer)

    ID of the community that owns the discussion board.

  • :topic_id (Integer)

    Topic ID.

  • :title (String)

    New title of the topic.

Returns:

See Also:



2948
2949
2950
2951
2952
2953
2954
# File 'lib/vk/api/methods.rb', line 2948

def edit_topic(arguments = {})
  require "vk/api/board/methods/edit_topic"
  method = Methods::EditTopic.new(arguments)
  response = method.call(@client)
  require "vk/api/board/responses/edit_topic_response"
  Responses::EditTopicResponse.new(response.deep_symbolize_keys)
end

#fix_topic(arguments = {}) ⇒ Vk::API::Board::Responses::FixTopicResponse

Returns Pins a topic (fixes its place) to the top of a community's discussion board.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :group_id (Integer)

    ID of the community that owns the discussion board.

  • :topic_id (Integer)

    Topic ID.

Returns:

See Also:



3025
3026
3027
3028
3029
3030
3031
# File 'lib/vk/api/methods.rb', line 3025

def fix_topic(arguments = {})
  require "vk/api/board/methods/fix_topic"
  method = Methods::FixTopic.new(arguments)
  response = method.call(@client)
  require "vk/api/board/responses/fix_topic_response"
  Responses::FixTopicResponse.new(response.deep_symbolize_keys)
end

#get_comments(arguments = {}) ⇒ Vk::API::Board::Responses::GetCommentsResponse

Returns a list of comments on a topic on a community's discussion board.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :group_id (Integer)

    ID of the community that owns the discussion board.

  • :topic_id (Integer)

    Topic ID.

  • :need_likes (Boolean)

    '1' — to return the 'likes' field; '0' — not to return the 'likes' field (default)

  • :start_comment_id (Integer)
  • :offset (Integer)

    Offset needed to return a specific subset of comments.

  • :count (Integer) — default: 20

    Number of comments to return.

  • :extended (Boolean)

    '1' — to return information about users who posted comments; '0' — to return no additional fields (default)

  • :sort (String)

    Sort order:; 'asc' — by creation date in chronological order; 'desc' — by creation date in reverse chronological order;

Returns:

See Also:



2891
2892
2893
2894
2895
2896
2897
# File 'lib/vk/api/methods.rb', line 2891

def get_comments(arguments = {})
  require "vk/api/board/methods/get_comments"
  method = Methods::GetComments.new(arguments)
  response = method.call(@client)
  require "vk/api/board/responses/get_comments_response"
  Responses::GetCommentsResponse.new(response.deep_symbolize_keys)
end

#get_topics(arguments = {}) ⇒ Vk::API::Board::Responses::GetTopicsResponse

Returns a list of topics on a community's discussion board.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :group_id (Integer)

    ID of the community that owns the discussion board.

  • :topic_ids (Array)

    IDs of topics to be returned (100 maximum). By default, all topics are returned.; ; If this parameter is set, the 'order', 'offset', and 'count' parameters are ignored.

  • :order (Integer)

    Sort order:; '1' — by date updated in reverse chronological order.; '2' — by date created in reverse chronological order.; '-1' — by date updated in chronological order.; '-2' — by date created in chronological order.; ; If no sort order is specified, topics are returned in the order specified by the group administrator. Pinned topics are returned first, regardless of the sorting.

  • :offset (Integer)

    Offset needed to return a specific subset of topics.

  • :count (Integer) — default: 40

    Number of topics to return.

  • :extended (Boolean)

    '1' — to return information about users who created topics or who posted there last; '0' — to return no additional fields (default)

  • :preview (Integer)

    '1' — to return the first comment in each topic;; '2' — to return the last comment in each topic;; '0' — to return no comments.; ; By default: '0'.

  • :preview_length (Integer) — default: 90

    Number of characters after which to truncate the previewed comment. To preview the full comment, specify '0'.

Returns:

See Also:



2873
2874
2875
2876
2877
2878
2879
# File 'lib/vk/api/methods.rb', line 2873

def get_topics(arguments = {})
  require "vk/api/board/methods/get_topics"
  method = Methods::GetTopics.new(arguments)
  response = method.call(@client)
  require "vk/api/board/responses/get_topics_response"
  Responses::GetTopicsResponse.new(response.deep_symbolize_keys)
end

#open_topic(arguments = {}) ⇒ Vk::API::Board::Responses::OpenTopicResponse

Returns Re-opens a previously closed topic on a community's discussion board.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :group_id (Integer)

    ID of the community that owns the discussion board.

  • :topic_id (Integer)

    Topic ID.

Returns:

See Also:



3001
3002
3003
3004
3005
3006
3007
# File 'lib/vk/api/methods.rb', line 3001

def open_topic(arguments = {})
  require "vk/api/board/methods/open_topic"
  method = Methods::OpenTopic.new(arguments)
  response = method.call(@client)
  require "vk/api/board/responses/open_topic_response"
  Responses::OpenTopicResponse.new(response.deep_symbolize_keys)
end

#restore_comment(arguments = {}) ⇒ Vk::API::Board::Responses::RestoreCommentResponse

Returns Restores a comment deleted from a topic on a community's discussion board.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :group_id (Integer)

    ID of the community that owns the discussion board.

  • :topic_id (Integer)

    Topic ID.

  • :comment_id (Integer)

    Comment ID.

Returns:

See Also:



2976
2977
2978
2979
2980
2981
2982
# File 'lib/vk/api/methods.rb', line 2976

def restore_comment(arguments = {})
  require "vk/api/board/methods/restore_comment"
  method = Methods::RestoreComment.new(arguments)
  response = method.call(@client)
  require "vk/api/board/responses/restore_comment_response"
  Responses::RestoreCommentResponse.new(response.deep_symbolize_keys)
end

#unfix_topic(arguments = {}) ⇒ Vk::API::Board::Responses::UnfixTopicResponse

Returns Unpins a pinned topic from the top of a community's discussion board.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :group_id (Integer)

    ID of the community that owns the discussion board.

  • :topic_id (Integer)

    Topic ID.

Returns:

See Also:



3037
3038
3039
3040
3041
3042
3043
# File 'lib/vk/api/methods.rb', line 3037

def unfix_topic(arguments = {})
  require "vk/api/board/methods/unfix_topic"
  method = Methods::UnfixTopic.new(arguments)
  response = method.call(@client)
  require "vk/api/board/responses/unfix_topic_response"
  Responses::UnfixTopicResponse.new(response.deep_symbolize_keys)
end