diff --git a/examples/webhooks.rb b/examples/webhooks.rb index fa4e5584b..dc31f5957 100644 --- a/examples/webhooks.rb +++ b/examples/webhooks.rb @@ -26,7 +26,7 @@ if event.message.content == 'EDIT_TWO' wh = event.channel.webhooks.first - wh.update(avatar: BASE64_SMALL_PICTURE, reason: 'Edition test two') + wh.update({ avatar: BASE64_SMALL_PICTURE, reason: 'Edition test two' }) puts wh.inspect wh.execute(content: '[EDIT TWO]') diff --git a/lib/discordrb/data/webhook.rb b/lib/discordrb/data/webhook.rb index 3e2bb8260..cb5693649 100644 --- a/lib/discordrb/data/webhook.rb +++ b/lib/discordrb/data/webhook.rb @@ -86,7 +86,7 @@ def update(data) data[:avatar] = avatarise(data[:avatar]) if data.key?(:avatar) data[:channel_id] = data[:channel]&.resolve_id data.delete(:channel) - update_webhook(**data) + update_webhook(data) end # Deletes the webhook. diff --git a/spec/data/webhook_spec.rb b/spec/data/webhook_spec.rb index d6c5a5a05..1f3aa6b49 100644 --- a/spec/data/webhook_spec.rb +++ b/spec/data/webhook_spec.rb @@ -101,7 +101,7 @@ describe '#update' do it 'calls update_webhook' do - expect(webhook).to receive(:update_webhook).with(avatar: avatar_string, channel_id: edited_webhook_channel_id.to_i, name: edited_webhook_name, reason: reason) + expect(webhook).to receive(:update_webhook).with(hash_including(avatar: avatar_string, channel_id: edited_webhook_channel_id.to_i, name: edited_webhook_name, reason: reason)) webhook.update(avatar: avatar_string, channel: edited_webhook_channel_id, name: edited_webhook_name, reason: reason) end end