本文整理匯總了Golang中github.com/justinkim/yullibot/irc.Message.Subsubcommand方法的典型用法代碼示例。如果您正苦於以下問題:Golang Message.Subsubcommand方法的具體用法?Golang Message.Subsubcommand怎麽用?Golang Message.Subsubcommand使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/justinkim/yullibot/irc.Message
的用法示例。
在下文中一共展示了Message.Subsubcommand方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: DoDisable
func (avalon *AvalonCommand) DoDisable(bot *models.Bot, msg *irc.Message) {
err := avalon.IssuedByLobbyLeaderInGameChannel(msg)
if err != nil {
bot.Connection.RespondTo(msg, err.Error())
return
}
option := msg.Subsubcommand()
if option == "" {
bot.Connection.RespondTo(msg, availableOptionsString)
return
}
err = avalon.game.DisableOption(option)
if err != nil {
bot.Connection.RespondTo(msg, err.Error())
}
resp := fmt.Sprintf(configOptionsEnabledFormatString, avalon.game.ConfigStatus())
bot.Connection.RespondTo(msg, resp)
}
示例2: DoInfo
func (avalon *AvalonCommand) DoInfo(bot *models.Bot, msg *irc.Message) {
if avalon.game == nil {
bot.Connection.RespondTo(msg, noActiveGameString)
return
}
subsub := msg.Subsubcommand()
switch subsub {
case "":
bot.Connection.RespondTo(msg, infoHelpString)
case "game":
resp := fmt.Sprintf(infoGameFormatString, avalon.lobbyLeader, avalon.channel)
bot.Connection.RespondTo(msg, resp)
case "players":
plural := ""
if avalon.game.NumPlayers() > 1 {
plural = "s"
}
resp := fmt.Sprintf(infoPlayersFormatString, avalon.game.NumPlayers(), plural, avalon.game.ListPlayers())
bot.Connection.RespondTo(msg, resp)
}
}