onyxcord 4.0.0.beta.3 → 4.0.0.beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/onyxcord/core/version.rb +1 -1
- data/lib/onyxcord/events/message/base.rb +21 -12
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '09cf48fcdfd2d25191929696baf6977189f2e2ea76a906c27891369cc4437515'
|
|
4
|
+
data.tar.gz: a3b9167db09891f24ae25d2739d2fc4e5780d4a859051d1aabd4ea73ef1dfe44
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a2ac0e0364748300fda1f19e0a89814d24a155e73d7f46be7492c313659d30af60b98d7cccda8c95c8c690138df5c52c20ace1b6d9751205ba9aae8ecbde6220
|
|
7
|
+
data.tar.gz: ab9d1ae9701a7adb1dc8d5e7820e12c0aba4edc28368a0c859b233cc84509e7b4521eba2bf0d1483bee90ed155f5494a4db67fb894e595ffe552f46401077f6c
|
|
@@ -9,19 +9,28 @@ module OnyxCord::Events
|
|
|
9
9
|
# @return [Channel] the channel in which this event occurred
|
|
10
10
|
attr_reader :channel
|
|
11
11
|
|
|
12
|
-
# Sends a message to the channel this message was sent in, right now.
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
# @param components [View, Array<Hash>, nil] A collection of components to attach to the message.
|
|
21
|
-
# @param flags [Integer] Flags for this message. Currently only SUPPRESS_EMBEDS (1 << 2), SUPPRESS_NOTIFICATIONS (1 << 12), and IS_COMPONENTS_V2 (1 << 15) can be set.
|
|
12
|
+
# Sends a message to the channel this message was sent in, right now.
|
|
13
|
+
# Supports both positional and keyword arguments:
|
|
14
|
+
#
|
|
15
|
+
# event.send_message('Hello')
|
|
16
|
+
# event.send_message('Hello', false, { title: 'Hi' })
|
|
17
|
+
# event.send_message('Hello', embed: { title: 'Hi' })
|
|
18
|
+
# event.send_message(embed: { title: 'Hi' })
|
|
19
|
+
#
|
|
22
20
|
# @return [OnyxCord::Message] the message that was sent
|
|
23
|
-
def send_message(content, tts = false, embed = nil, attachments = nil,
|
|
24
|
-
|
|
21
|
+
def send_message(content = nil, tts = false, embed = nil, attachments = nil,
|
|
22
|
+
allowed_mentions = nil, message_reference = nil,
|
|
23
|
+
components = nil, flags = 0,
|
|
24
|
+
embeds: nil, **_kwargs)
|
|
25
|
+
# Support keyword args: event.send_message('text', embed: { ... })
|
|
26
|
+
embeds = Array(embed) if embed && !embeds
|
|
27
|
+
embeds ||= []
|
|
28
|
+
|
|
29
|
+
# Use first embed for backward-compatible positional API
|
|
30
|
+
first_embed = embeds.first
|
|
31
|
+
|
|
32
|
+
channel.send_message(content || '', tts, first_embed, attachments,
|
|
33
|
+
allowed_mentions, message_reference, components, flags)
|
|
25
34
|
end
|
|
26
35
|
|
|
27
36
|
# The same as {#send_message}, but yields a {Webhooks::Embed} for easy building of embedded content inside a block.
|