Class: Vk::API::Wall::Methods::CreateComment

Inherits:
Schema::Method
  • Object
show all
Defined in:
lib/vk/api/wall/methods/create_comment.rb

Overview

Adds a comment to a post on a user wall or community wall.

Arguments collapse

Instance Method Summary collapse

Methods inherited from Schema::Method

#call, #method, #to_hash

Constructor Details

#initialize(arguments) ⇒ Wall::Methods::CreateComment

Parameters:

  • arguments (Hash)

Options Hash (arguments):

  • :owner_id (Integer)

    User ID or community ID. Use a negative value to designate a community ID.

  • :post_id (Integer)

    Post ID.

  • :from_group (Boolean)

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

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

    Text of the comment.

  • :reply_to_comment (Integer)

    ID of comment to reply.

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

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

  • :sticker_id (Integer)

    Sticker ID.

  • :guid (String)

    Unique identifier to avoid repeated comments.



# File 'lib/vk/api/wall/methods/create_comment.rb', line 15

Instance Method Details

#attachmentsArray

Returns (Required if 'message' is not set.) List of media objects attached to the comment, in the following format:; ","; '' — Type of media ojbect:; 'photo' — photo; 'video' — video; 'audio' — audio; 'doc' — document; '' — ID of the media owner.; '' — Media ID. ; ; For example:; "photo100172_166443618,photo66748_265827614".

Returns:

  • (Array)

    (Required if 'message' is not set.) List of media objects attached to the comment, in the following format:; ","; '' — Type of media ojbect:; 'photo' — photo; 'video' — video; 'audio' — audio; 'doc' — document; '' — ID of the media owner.; '' — Media ID. ; ; For example:; "photo100172_166443618,photo66748_265827614"



40
# File 'lib/vk/api/wall/methods/create_comment.rb', line 40

attribute :attachments, API::Types::Coercible::Array.member(API::Types::Coercible::String).optional.default(nil)

#from_groupBoolean

Returns '1' — to post the comment as from the community;; '0' — (default) to post the comment as from the user.

Returns:

  • (Boolean)

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



34
# File 'lib/vk/api/wall/methods/create_comment.rb', line 34

attribute :from_group, API::Types::Form::Bool.optional.default(nil)

#guidString

Returns Unique identifier to avoid repeated comments.

Returns:

  • (String)

    Unique identifier to avoid repeated comments.



44
# File 'lib/vk/api/wall/methods/create_comment.rb', line 44

attribute :guid, API::Types::Coercible::String.optional.default(nil)

#messageString

Returns (Required if 'attachments' is not set.) Text of the comment.

Returns:

  • (String)

    (Required if 'attachments' is not set.) Text of the comment.



36
# File 'lib/vk/api/wall/methods/create_comment.rb', line 36

attribute :message, API::Types::Coercible::String.optional.default(nil)

#owner_idInteger

Returns User ID or community ID. Use a negative value to designate a community ID.

Returns:

  • (Integer)

    User ID or community ID. Use a negative value to designate a community ID.



30
# File 'lib/vk/api/wall/methods/create_comment.rb', line 30

attribute :owner_id, API::Types::Coercible::Int.optional.default(nil)

#post_idInteger

Returns Post ID.

Returns:

  • (Integer)

    Post ID.



32
# File 'lib/vk/api/wall/methods/create_comment.rb', line 32

attribute :post_id, API::Types::Coercible::Int

#reply_to_commentInteger

Returns ID of comment to reply.

Returns:

  • (Integer)

    ID of comment to reply.



38
# File 'lib/vk/api/wall/methods/create_comment.rb', line 38

attribute :reply_to_comment, API::Types::Coercible::Int.optional.default(nil)

#sticker_idInteger

Returns Sticker ID.

Returns:

  • (Integer)

    Sticker ID.



42
# File 'lib/vk/api/wall/methods/create_comment.rb', line 42

attribute :sticker_id, API::Types::Coercible::Int.optional.default(nil)