mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-18 20:50:12 +08:00
fix(dish): 修复客官名显示为菜名的问题 (#1000)
* fix(dish): 修复客官名显示为菜名的问题 去除了多余的换行 * optimize(dish): 去除不必要的 fmt.Sprintf
This commit is contained in:
parent
410dd05600
commit
b777b34126
@ -62,7 +62,7 @@ func init() {
|
||||
return
|
||||
}
|
||||
|
||||
name := ctx.NickName()
|
||||
name := ctx.CardOrNickName(ctx.Event.UserID)
|
||||
dishName := ctx.State["args"].(string)
|
||||
|
||||
if dishName == "" {
|
||||
@ -82,12 +82,10 @@ func init() {
|
||||
return
|
||||
}
|
||||
|
||||
ctx.SendChain(message.Text(fmt.Sprintf(
|
||||
"已为客官%s找到%s的做法辣!\n"+
|
||||
"原材料:%s\n"+
|
||||
"步骤:\n"+
|
||||
"%s",
|
||||
name, d.Name, d.Materials, d.Steps),
|
||||
ctx.SendChain(message.Text(
|
||||
"已为客官", name, "找到", d.Name, "的做法辣!\n",
|
||||
"原材料:", d.Materials, "\n",
|
||||
"步骤:", d.Steps,
|
||||
))
|
||||
})
|
||||
|
||||
@ -105,12 +103,10 @@ func init() {
|
||||
return
|
||||
}
|
||||
|
||||
ctx.SendChain(message.Text(fmt.Sprintf(
|
||||
"已为客官%s送上%s的做法:\n"+
|
||||
"原材料:%s\n"+
|
||||
"步骤:\n"+
|
||||
"%s",
|
||||
name, d.Name, d.Materials, d.Steps),
|
||||
ctx.SendChain(message.Text(
|
||||
"已为客官", name, "送上", d.Name, "的做法:\n",
|
||||
"原材料:", d.Materials, "\n",
|
||||
"步骤:", d.Steps,
|
||||
))
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user