mirror of
https://github.com/syuilo/ai.git
synced 2025-03-25 21:12:56 +00:00
commit
66846f435f
4 changed files with 81 additions and 0 deletions
|
@ -34,6 +34,7 @@ import SleepReportModule from './modules/sleep-report';
|
|||
import NotingModule from './modules/noting';
|
||||
import PollModule from './modules/poll';
|
||||
import ReminderModule from './modules/reminder';
|
||||
import RecommendMusicModule from './modules/recommend-music';
|
||||
|
||||
console.log(' __ ____ _____ ___ ');
|
||||
console.log(' /__\\ (_ _)( _ )/ __)');
|
||||
|
@ -88,6 +89,7 @@ promiseRetry(retry => {
|
|||
new NotingModule(),
|
||||
new PollModule(),
|
||||
new ReminderModule(),
|
||||
new RecommendMusicModule(),
|
||||
]);
|
||||
}).catch(e => {
|
||||
log(chalk.red('Failed to fetch the account'));
|
||||
|
|
68
src/modules/recommend-music/index.ts
Normal file
68
src/modules/recommend-music/index.ts
Normal file
|
@ -0,0 +1,68 @@
|
|||
import autobind from 'autobind-decorator';
|
||||
import Module from '@/module';
|
||||
import Message from '@/message';
|
||||
import serifs from '@/serifs';
|
||||
|
||||
const musicUrls = [
|
||||
'https://www.nicovideo.jp/watch/sm31677384',
|
||||
'https://www.nicovideo.jp/watch/sm19042393',
|
||||
'https://www.nicovideo.jp/watch/sm24892241',
|
||||
'https://www.nicovideo.jp/watch/sm20503793',
|
||||
'https://www.nicovideo.jp/watch/sm23393078',
|
||||
'https://www.nicovideo.jp/watch/sm24485755',
|
||||
'https://www.nicovideo.jp/watch/sm25808292',
|
||||
'https://www.nicovideo.jp/watch/sm20433229',
|
||||
'https://www.nicovideo.jp/watch/sm8541371',
|
||||
'https://www.nicovideo.jp/watch/sm34509853',
|
||||
'https://www.nicovideo.jp/watch/sm26661454',
|
||||
'https://www.nicovideo.jp/watch/sm9797269',
|
||||
'https://www.nicovideo.jp/watch/sm42536675',
|
||||
'https://www.nicovideo.jp/watch/sm10244728',
|
||||
'https://www.nicovideo.jp/watch/sm24626484',
|
||||
'https://www.nicovideo.jp/watch/sm39875801',
|
||||
'https://www.nicovideo.jp/watch/sm31472648',
|
||||
'https://www.nicovideo.jp/watch/sm22608740',
|
||||
'https://www.nicovideo.jp/watch/sm30519579',
|
||||
'https://www.nicovideo.jp/watch/sm28406516',
|
||||
'https://www.nicovideo.jp/watch/sm21652882',
|
||||
'https://www.nicovideo.jp/watch/sm32626095',
|
||||
'https://www.nicovideo.jp/watch/sm32748202',
|
||||
'https://www.nicovideo.jp/watch/sm19870840',
|
||||
'https://www.nicovideo.jp/watch/sm13471002',
|
||||
'https://www.nicovideo.jp/watch/sm13173001',
|
||||
'https://www.nicovideo.jp/watch/sm12195657',
|
||||
'https://www.nicovideo.jp/watch/sm38824626',
|
||||
'https://www.nicovideo.jp/watch/sm27057005',
|
||||
'https://www.nicovideo.jp/watch/sm21036288',
|
||||
'https://www.nicovideo.jp/watch/sm23762151',
|
||||
'https://www.nicovideo.jp/watch/nm14629738',
|
||||
'https://www.nicovideo.jp/watch/sm6529016',
|
||||
'https://www.nicovideo.jp/watch/sm19625630',
|
||||
'https://www.nicovideo.jp/watch/sm11224129',
|
||||
'https://www.nicovideo.jp/watch/sm11834233',
|
||||
'https://www.nicovideo.jp/watch/sm30519579',
|
||||
'https://www.nicovideo.jp/watch/sm32537029',
|
||||
'https://www.nicovideo.jp/watch/sm38708262'
|
||||
]
|
||||
|
||||
export default class extends Module {
|
||||
public readonly name = 'recommendMusic';
|
||||
|
||||
@autobind
|
||||
public install() {
|
||||
return {
|
||||
mentionHook: this.mentionHook
|
||||
};
|
||||
}
|
||||
|
||||
@autobind
|
||||
private async mentionHook(msg: Message) {
|
||||
if (msg.includes(['音楽', '曲'])) {
|
||||
const music = musicUrls[Math.floor(Math.random() * musicUrls.length)];
|
||||
msg.reply(serifs.recommendMusic.suggestMusic(music));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -313,6 +313,13 @@ export default {
|
|||
suggest: emoji => `こんなのはどうですか?→${emoji}`,
|
||||
},
|
||||
|
||||
/**
|
||||
* 音楽おすすめ
|
||||
*/
|
||||
recommendMusic: {
|
||||
suggestMusic: musicUrl => `こんなのはどうでしょう?\n${musicUrl}`
|
||||
},
|
||||
|
||||
/**
|
||||
* 占い
|
||||
*/
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
## プロフィール
|
||||
[こちら](https://xn--931a.moe/)
|
||||
|
||||
## 独自機能
|
||||
### 曲紹介
|
||||
「曲」「音楽」などと話しかけると、リストにある中からランダムで曲をおすすめしてくれます。(現在40曲程度)
|
||||
|
||||
## 藍の主な機能
|
||||
### 挨拶
|
||||
「おはよう」「おやすみ」などと話しかけると反応してくれます。
|
||||
|
|
Loading…
Reference in a new issue