Module: X::Objects::Actions::DirectMessages
- Included in:
- X::Objects::API
- Defined in:
- x-objects/lib/x/objects/actions/direct_messages.rb
Overview
Send and delete direct messages as the authenticated user
Internal to x-objects: X::Objects::API includes it, and its methods are public API of the client that includes API, but the module is only how they are grouped, and some of them need the methods of another, so include API rather than this module alone.
Instance Method Summary collapse
-
#create_direct_message(user, text = nil, **params) ⇒ DirectMessage
(also: #create_dm)
Send a direct message to a user as the authenticated user.
-
#create_direct_message_in(conversation, text = nil, **params) ⇒ DirectMessage
(also: #create_dm_in)
Send a direct message to a conversation as the authenticated user.
-
#create_group_direct_message(users, text = nil, **params) ⇒ DirectMessage
(also: #create_group_dm)
Start a group conversation, sending its first message as the authenticated user.
-
#delete_direct_message(message) ⇒ Boolean
(also: #delete_dm)
Delete a direct message event as the authenticated user.
Instance Method Details
#create_direct_message(user, text = nil, **params) ⇒ DirectMessage Also known as: create_dm
Send a direct message to a user as the authenticated user
33 34 35 |
# File 'x-objects/lib/x/objects/actions/direct_messages.rb', line 33 def (user, text = nil, **params) # steep:ignore DifferentMethodParameterKind DirectMessage.create(user, text, client: self, **params) end |
#create_direct_message_in(conversation, text = nil, **params) ⇒ DirectMessage Also known as: create_dm_in
Send a direct message to a conversation as the authenticated user
The conversation can be one-to-one or a group.
77 78 79 |
# File 'x-objects/lib/x/objects/actions/direct_messages.rb', line 77 def (conversation, text = nil, **params) # steep:ignore DifferentMethodParameterKind DirectMessage.create_in(conversation, text, client: self, **params) end |
#create_group_direct_message(users, text = nil, **params) ⇒ DirectMessage Also known as: create_group_dm
Start a group conversation, sending its first message as the authenticated user
54 55 56 |
# File 'x-objects/lib/x/objects/actions/direct_messages.rb', line 54 def (users, text = nil, **params) # steep:ignore DifferentMethodParameterKind DirectMessage.create_group(users, text, client: self, **params) end |
#delete_direct_message(message) ⇒ Boolean Also known as: delete_dm
Delete a direct message event as the authenticated user
88 89 90 |
# File 'x-objects/lib/x/objects/actions/direct_messages.rb', line 88 def () DirectMessage.delete(, client: self) end |