diff --git a/lib/discorb/modules.rb b/lib/discorb/modules.rb index 85d55ab0..ff6e453c 100644 --- a/lib/discorb/modules.rb +++ b/lib/discorb/modules.rb @@ -18,6 +18,8 @@ module Messageable # @param [Array, Array>] components The components to send. # @param [Discorb::Attachment] attachment The attachment to send. # @param [Array] attachments The attachments to send. + # @param [Array] stickers The stickers to send. + # @param [Discorb::Sticker] sticker The sticker to send. # # @return [Async::Task] The message sent. # @@ -30,7 +32,9 @@ def post( reference: nil, components: nil, attachment: nil, - attachments: nil + attachments: nil, + stickers: nil, + sticker: nil ) Async do payload = {} @@ -60,6 +64,9 @@ def post( { id: i, filename: a.filename, description: a.description } end + stickers = [sticker.id] if stickers.nil? && !sticker.nil? + payload[:sticker_ids] = stickers.map(&:id) if stickers + _resp, data = @client .http diff --git a/sig/discorb/messageable.rbs b/sig/discorb/messageable.rbs index 021167d5..64d18ecb 100644 --- a/sig/discorb/messageable.rbs +++ b/sig/discorb/messageable.rbs @@ -22,6 +22,8 @@ module Discorb # @param [Array, Array>] components The components to send. # @param [Discorb::Attachment] attachment The attachment to send. # @param [Array] attachments The attachments to send. + # @param [Array] stickers The stickers to send. + # @param [Discorb::Sticker] sticker The sticker to send. # # @return [Async::Task] The message sent. def post: ( @@ -34,7 +36,9 @@ module Discorb ?components: (::Array[Discorb::Component] | ::Array[::Array[Discorb::Component]])?, ?attachment: Discorb::Attachment?, - ?attachments: ::Array[Discorb::Attachment]? + ?attachments: ::Array[Discorb::Attachment]?, + ?sticker: Discorb::Sticker?, + ?stickers: ::Array[Discorb::Sticker]? ) -> Async::Task[Discorb::Message] #