本文整理汇总了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)
}
}