Skip to content

Commit

Permalink
feat(cli): support discord init
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Mar 26, 2021
1 parent 6a47e39 commit cc8f609
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions packages/koishi/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const serverQuestions: PromptObject[] = [{
{ title: 'OneBot - HTTP', value: 'onebot:http' },
{ title: 'OneBot - WebSocket', value: 'onebot:ws' },
{ title: 'OneBot - WebSocket Reverse', value: 'onebot:ws-reverse' },
{ title: 'Discord - WebSocket', value: 'discord' },
{ title: 'Telegram - HTTP', value: 'telegram' },
{ title: 'Kaiheila - HTTP', value: 'kaiheila:http' },
{ title: 'Kaiheila - WebSocket', value: 'kaiheila:ws' },
Expand Down Expand Up @@ -50,18 +51,19 @@ const botMap: PromptDict = {
type: 'text',
message: 'Token for CQHTTP Server',
}],
'discord': [{
name: 'token',
type: 'text',
message: 'Token for Discord',
}],
'telegram': [{
name: 'token',
type: 'text',
message: 'Token for Telegram',
}],
'kaiheila': [{
name: 'selfId',
type: 'number',
message: 'Your Bot\'s Id',
}, {
name: 'token',
type: 'text',
type: () => config.type === 'kaiheila:ws' ? 'text' : null,
message: 'Token for Kaiheila',
}, {
name: 'verifyToken',
Expand Down Expand Up @@ -96,7 +98,7 @@ const adapterMap: PromptDict = {
}],
'kaiheila': [{
name: 'path',
type: () => !config['onebot'] && config.type !== 'kaiheila:ws' ? 'text' : null,
type: () => !config['kaiheila'] && config.type !== 'kaiheila:ws' ? 'text' : null,
message: 'Kaiheila Path',
}],
}
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-schedule/src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Database.extend('koishi-plugin-mysql', ({ Domain, tables }) => {
time: `TIMESTAMP NULL DEFAULT NULL`,
lastCall: `TIMESTAMP NULL DEFAULT NULL`,
interval: `BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'`,
command: `MEDIUMTEXT NOT NULL`,
command: `MEDIUMTEXT NULL`,
session: new Domain.Json(),
}
})

0 comments on commit cc8f609

Please sign in to comment.