您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

MessageBuilders.kt 1.2KB

123456789101112131415161718
  1. package com.dmdirc.ktirc.messages
  2. /** Construct a message indicating the end of capability negotiation. */
  3. internal fun capabilityEndMessage() = "CAP END"
  4. /** Construct a message requesting the specified caps are enabled. */
  5. internal fun capabilityRequestMessage(capabilities: List<String>) = "CAP REQ :${capabilities.joinToString(" ")}"
  6. /** Construct a message to join the given channel. */
  7. fun joinMessage(channel: String) = "JOIN :$channel"
  8. /** Construct a message to change to the given nickname. */
  9. fun nickMessage(nick: String) = "NICK :$nick"
  10. /** Construct a message to provide the connection password to the server. */
  11. internal fun passwordMessage(password: String) = "PASS :$password"
  12. /** Construct a message to reply to a PING event. */
  13. internal fun pongMessage(nonce: ByteArray) = "PONG :${String(nonce)}"
  14. /** Construct a message to send a private message to a user or channel. */
  15. fun privmsgMessage(target: String, message: String) = "PRIVMSG $target :$message"
  16. /** Construct a message to register a user with the server. */
  17. internal fun userMessage(userName: String, localHostName: String, serverHostName: String, realName: String) = "USER $userName $localHostName $serverHostName :$realName"