Skip to content

Commit

Permalink
细节优化
Browse files Browse the repository at this point in the history
  • Loading branch information
TimeRainStarSky committed Feb 2, 2024
1 parent aef0598 commit 367b841
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions Model/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ const configSave = config => fs.writeFileSync(configFile, YAML.stringify({ ...co
const config = {
tips: "",
permission: "master",
toMarkdown: false,
toButton: false,
toCallback: true,
markdown: {
global: false,
button: true,
callback: true,
},
bot: {},
token: []
}
Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const adapter = new class ICQQAdapter {
data: button.link,
...button.ICQQ?.action,
}
else if (config.toCallback && (button.input || button.callback))
else if (config.markdown.callback && (button.input || button.callback))
for (const i of Bot.uin)
if (Bot[i].adapter?.id == "QQBot" && Bot[i].sdk?.config?.appid && Bot[i].callback) {
msg.action = {
Expand Down Expand Up @@ -204,7 +204,7 @@ const adapter = new class ICQQAdapter {
async makeMsg(id, pick, msg) {
if (!Array.isArray(msg))
msg = [msg]
if (config.toMarkdown)
if (config.markdown.global)
return this.makeMarkdownMsg(id, pick, msg)

const msgs = []
Expand All @@ -214,8 +214,8 @@ const adapter = new class ICQQAdapter {
msgs.push(...(await this.makeMarkdownMsg(id, pick, msg)))
continue
case "button":
if (config.toButton) {
if (config.toButton == "direct")
if (config.markdown.button) {
if (config.markdown.button == "direct")
msgs.push({ type: "button", content: { rows: this.makeButtons(i.data) }})
else
return this.makeMarkdownMsg(id, pick, msg)
Expand Down

0 comments on commit 367b841

Please sign in to comment.