-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
898 additions
and
675 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,17 @@ | |
* @Blog: https://hotaru.icu | ||
* @Date: 2023-09-29 14:31:09 | ||
* @LastEditors: Hotaru [email protected] | ||
* @LastEditTime: 2024-08-04 12:08:31 | ||
* @LastEditTime: 2024-08-06 11:12:35 | ||
*/ | ||
import { Adapter, type AdapterConfig, type Context, MessageScope, Tsu } from 'kotori-bot' | ||
import { Adapter, type AdapterConfig, type Context, MessageScope, Tsu, type LoggerData } from 'kotori-bot' | ||
import CmdApi from './api' | ||
import CmdElements from './elements' | ||
|
||
declare module 'kotori-bot' { | ||
interface EventsMapping { | ||
console_output(data: LoggerData | { msg: string }): void | ||
} | ||
} | ||
export const config = Tsu.Object({ | ||
nickname: Tsu.String().default('Kotarou').describe("User's nickname"), | ||
'self-nickname': Tsu.String().default('KotoriO').describe("Bot's nickname"), | ||
|
@@ -79,7 +84,9 @@ export class CmdAdapter extends Adapter<CmdApi, CmdConfig, CmdElements> { | |
if (this.status.value !== 'online' || action !== 'send_private_msg' || !params) return | ||
if (typeof (params as { message: string }).message !== 'string') return | ||
if ((params as { user_id: unknown }).user_id !== this.config.master) return | ||
process.stdout.write(`${this.config['self-nickname']} > ${(params as { message: string }).message} \r\n`) | ||
const msg = `${this.config['self-nickname']} > ${(params as { message: string }).message} \r\n` | ||
process.stdout.write(msg) | ||
this.ctx.emit('console_output', { msg }) | ||
this.messageId += 1 | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ export const config = Tsu.Object({ | |
|
||
- text | ||
|
||
## Todo | ||
## TODO | ||
|
||
Support more standard api... | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"adapter_mail.descr.mail": "指定メールアドレスにメールを送信", | ||
"adapter_mail.msg.mail.input_target": "受信メールアドレスを入力してください", | ||
"adapter_mail.msg.mail.input_title": "メールの件名を入力してください", | ||
"adapter_mail.msg.mail.input_content": "メールの内容を入力してください", | ||
"adapter_mail.msg.mail.sure": "件名:{0}\n内容:{1}\n-------------\n{2}にメールを送信しますか?(「1」で送信、他のキーでキャンセル)", | ||
"adapter_mail.msg.mail.cancel": "送信をキャンセルしました", | ||
"adapter_mail.msg.mail.success": "{0}へのメール送信に成功しました", | ||
"adapter_mail.msg.mail.fail": "メール送信に失敗しました。メール設定を確認してください。詳細:{0}", | ||
"adapter_mail.msg.mail.fail.2": "送信メール{0}が見つかりません。「{0}mail --list」で利用可能なメールリストを表示できます", | ||
"adapter_mail.msg.mail.fail.3": "送信失敗。宛先メールアドレスの形式が正しくありません!", | ||
"adapter_mail.msg.mail.item": "\n<=========>\n名前:{0}\nメール:{1}", | ||
"adapter_mail.msg.mail.list": "利用可能なメールリスト:{0}", | ||
"adapter_mail.option.mail.list": "利用可能なメールリストを表示", | ||
"adapter_mail.forward": "新着メールがあります!\n差出人:{0}\n件名:{1}\n内容:{2}\n日付:{3}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"adapter_mail.descr.mail": "通过目标邮箱发送邮件", | ||
"adapter_mail.msg.mail.input_target": "请输入接收邮箱", | ||
"adapter_mail.msg.mail.input_title": "请输入邮件标题", | ||
"adapter_mail.msg.mail.input_content": "请输入邮件内容", | ||
"adapter_mail.msg.mail.sure": "标题:{0}\n内容:{1}\n-------------\n确定发送邮件至{2}?(输入\"1\"发送,其他键取消)", | ||
"adapter_mail.msg.mail.cancel": "成功取消发送", | ||
"adapter_mail.msg.mail.success": "成功发送邮件至{0}", | ||
"adapter_mail.msg.mail.fail": "发送邮件失败,请检查邮件配置,详情:{0}", | ||
"adapter_mail.msg.mail.fail.2": "找不到发送邮箱{0},您可以输入\"{0}mail --list\"查看可用邮箱列表", | ||
"adapter_mail.msg.mail.fail.3": "发送失败,目标邮箱格式错误!", | ||
"adapter_mail.msg.mail.item": "\n<=========>\n名称:{0}\n邮箱:{1}", | ||
"adapter_mail.msg.mail.list": "可用邮箱列表:{0}", | ||
"adapter_mail.option.mail.list": "查看可用邮箱列表", | ||
"adapter_mail.forward": "收到新邮件!\n来自:{0}\n标题:{1}\n内容:{2}\n日期:{3}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ export const config = Tsu.Object({ | |
- voice | ||
- video | ||
|
||
## Todo | ||
## TODO | ||
|
||
Support more standard api... | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ export const config = Tsu.Object({ | |
- video | ||
- location | ||
|
||
## Todo | ||
## TODO | ||
|
||
Support more standard api... | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* @Blog: https://hotaru.icu | ||
* @Date: 2023-07-11 14:18:27 | ||
* @LastEditors: Hotaru [email protected] | ||
* @LastEditTime: 2024-08-03 10:59:04 | ||
* @LastEditTime: 2024-08-06 11:18:36 | ||
*/ | ||
|
||
import { | ||
|
@@ -183,8 +183,14 @@ export function main(ctx: Context) { | |
.shortcut(['小鸟', '小鳥', 'ことり', 'kotori', 'Kotori']) | ||
.hide() | ||
.action((_, session) => { | ||
const { version, license } = session.api.adapter.ctx.meta | ||
return session.format('core.msg.about', { version, license, node_version: process.version }) | ||
const { version, license, coreVersion, loaderVersion } = session.api.adapter.ctx.meta | ||
return session.format('core.msg.about', { | ||
version, | ||
license, | ||
core_version: coreVersion, | ||
loader_version: loaderVersion, | ||
node_version: process.version | ||
}) | ||
}) | ||
|
||
ctx | ||
|
Oops, something went wrong.