Class: Onebot::Core
- Inherits:
-
Object
- Object
- Onebot::Core
- Defined in:
- lib/Core/Core.rb
Overview
消息处理,ws连接
Example:
Onebot::Core.connect host: host, port: port {|bot| ... }
Class Method Summary collapse
Class Method Details
.connect(url:, logger: nil, protocols: nil, options: {}) {|client| ... } ⇒ WebSocket
新建连接
12 13 14 15 16 17 |
# File 'lib/Core/Core.rb', line 12 def self.connect(url:, logger: nil, protocols: nil, options: {}) client = ::Onebot::WebSocket::Client.new(url:, logger:) yield client if block_given? client.connect(protocols, ) client end |