ã¯ããã«
å½è¨äºã¯ãæ±äº¬å¤§å¦ã®è¬ç¾©ã大è¦æ¨¡ã½ããã¦ã§ã¢ãææ¢ããã®æåºç©ã¨ãã¦å·çãããã®ã§ãã
æãç¹ãç解ãä¸ååãªç¹ãå¤ãã§ãããã容赦ãã ããã
Â
ã¾ããå½ææ¥ã§ã¯ã°ã«ã¼ãã§èª²é¡ã«åãçµãã ãããåããã¼ã ããªã¯ã³ã³äººé8ãã®ãã¼ã ã¡ã¤ãã§ããharadyharaãããé¡ä¼¼ã®å 容ã®è¨äºãä¸ãã¦ããã¨æãã¾ãã®ã§ããã¡ãããã²ã覧ãã ããã
Â
Â
Â
Â
Â
Â
Â
ããã«ã¡ã¯ãtami0410ã§ãã
Â
ã¿ãªããã¯X(æ§Twittter)ã¯ä½¿ã£ã¦ãã¾ãã§ããããã
Â
代表ãå¤ãã£ã¦ä»¥éããã¾ãã¾ãªå¤æ´ãè¡ããããã®ãã³ã«ç§»ä½å ã®SNSãæ¢ãã¦ãã人ãè¦ãããããã«æãã¾ãã
ãããªæ¹ã ã«ãªã¹ã¹ã¡ã®SNSã¨ãã¦ãMisskeyãææ¡ãããã
Â
Misskeyã¨ã¯ï¼
ã»ä¸»ãªæ©è½ã¯Xã¨åããXã®"ãã¤ã¼ã"ã®è¦é ã§"ãã¹ã"ãã"ãªãã¤ã¼ã"ã®è¦é ã§"ãªãã¹ã"ãã§ããã
Â
ã»Xã®âãããã®ä»£ããã«"ãªã¢ã¯ã·ã§ã³"ãããããã¼ããã¼ã¯ã ãã§ãªãæ§ã ãªçµµæåãã¤ããããã
Â
ã»ãåæ£åSNSãã§ãããã¦ã¼ã¶ã¼ã¯è¤æ°ã®ãµã¼ãã¼ããä»»æã®ãµã¼ãã¼ã«åå ãããã¨ãã§ãããåããµã¼ãã¼å ã®ã¦ã¼ã¶ã¼ã ãã¨äº¤æµãããã¨ããä»ã®ãµã¼ãã¼ã®ã¦ã¼ã¶ã¼ã¨äº¤æµãããã¨ãã§ããã
Â
ãã®ããã«ãæ©è½ã ããè¦ãã¨Xã®ä¸ä½äºæã®ããã«ãæããã®ã§ãããä¸ã¤é大ãªæ¬ ç¹ãæ±ãã¦ãã¾ãã
Â
ããã¯ããã¦ã¼ã¶ã¼ã®æ°ã¨è³ªãã§ãã
Â
ããã§æã ã¯ããä»ã®SNSãã移ä½ããããªããããªãã¬ã¤ãªç°å¢ãä½ãã°ãæ°è¦ã¦ã¼ã¶ã¼ãã©ãã©ãå¢ããã®ã§ã¯ãªãããã¨èããã¦ã¼ã¶ã¼ã®è³ªã®æ¹åã«å½¹ç«ã¤æ©è½ã®è¿½å ãç®æãã¾ããã
Â
å®è£ ããæ©è½ã¨ãã¢ã³ã¹ãã¬ã¼ã·ã§ã³
å®éã«å®è£ ããæ©è½ã¯ãã"ç¹å®ã®èªé²"ãå«ãæ稿ããã¹ããããã¨ããã¨ç¹æ®ãªã¨ã©ã¼ã¡ãã»ã¼ã¸ã¨å¹æé³ãåçãããã¾ãã¢ã«ã¦ã³ããBANããããæ©è½ã§ãã
Â
å®éã®ãã¢åç»ã以ä¸ã«æ²è¼ãã¾ãã
https://youtu.be/L6iL3qjnlYI?si=sg3GjH7509Hp7USK
å®è£ ããæé
ï¼.ãã«ãã¨å®è¡
ãã«ãã«é¢ãã¦ã¯ã以ä¸ã®ããã°ã大ãã«åèã«ãã¾ããã
ä½åº¦ãèµ·ãã£ãåé¡ã¨ãã¦ã¯ã
docker compose up -d
ãå®è¡ããéã«ãaddress already in useã¨ããã¨ã©ã¼ãåºãä¸å ·åã§ãããããã¯misskeyãã©ã«ãå ã®.configå ã§
lsof -i :(該å½ãã¼ãçªå·)
ã§åãã¦ããããã»ã¹çªå·ãç¹å®ããkillã³ãã³ãã§çµäºããå¿ è¦ãããã¾ãã
ãã ããredisãµã¼ãã¼ã®æ¹ã¯killãã¦ãããã«åæã«æ°ããããã»ã¹çªå·ã§å¾©æ´»ãã¦ããï¼ããã ã£ãã®ã§ã
sudo kill -9 (ããã»ã¹çªå·)|sudo docker compose up -d
ã®ããã«é£ç¶ã§å®è¡ãããã¨ã§è§£æ±ºãã¾ããã
Â
ã¾ããå®è¡æã«ã¯pnpm devã®ä»£ããã«pnpm run startã¨ãã¾ããã
Â
1."ç¹å®ã®èªé²"ãæ¤åºãã
å®éã«å®è¡ãã¦ç®¡çè 権éã§ãµã¼ãã¼ã建ã¦ã¦ã¿ãã¨ãããã©ãããmisskeyã«ã¯ããã©ã«ãã§ãç¦æ¢ã¯ã¼ãæ©è½ããããããã§ãã
ãã ãããã®ãç¦æ¢ã¯ã¼ãæ©è½ãã¯ããã¾ã§ãµã¼ãã¼ç®¡çè ãè¨å®ããç¦æ¢ã¯ã¼ããå«ãæ稿ããããã¨ããã¨ã¨ã©ã¼ãåºã¦æ稿ã§ããªãã ãã§ããã以ä¸ã®ããã«ãã£ã¯ãªãããã§ããã
Â
æªè³ªãªã¦ã¼ã¶ã¼ã¯ããã«å¼ã£ããã£ã¦ãå·§å¦ã«è¨ãæãããèªç¹ãã¹ãã¼ã¹ãæãçã®ç©´ãã¤ãå½¢ã§æ稿ã試ã¿ãå¯è½æ§ãããããã®æ©è½ã ãã§æã ã®ç®æ¨ãéæãããã¨ã¯ã§ããªãã¨å¤æãã¾ããã
Â
ããããªããããããã¼ã¹ã«æ©è½ã追å ãã¦ããã°ææã®æ©è½ãå®è£ ã§ããã®ã§ã¯ãªããã¨ãããã¨ã§ãã¾ããç¦æ¢ã¯ã¼ãã®æ¤åºãè¡ãé¢æ°ããã³ã¼ãå ããæ¢ããã¨ã«ãã¾ããã
Â
æ©è½ã®è¿½å ã®ããã«ã³ã¼ããææ¢ãæ¹æ³ã«ã¤ãã¦ãWebãã©ã¦ã¶ä¸ã®ã¢ããªã¨ãããã¨ããã(èªåãç¥ã£ã¦ãããããª)ãããã°ãã¼ã«çã¯ä½¿ããªãããã§ããã
Â
ãã®ãããããã¯ã¨ã³ãå´ã§åä½ããæ©è½ã«ã¤ãã¦ã¯ããã©ã¦ã¶ã®éçºè ãã¼ã«ãéãã該å½ã®æä½ãè¡ã£ãéã®ãµã¼ãã¼ããã®ã¬ã¹ãã³ã¹ãè¦ã¦ãæªããã¯ã¼ãã§ã³ã¼ãå æ¤ç´¢ãããããã¨ããæ¹æ³ãå¤ç¨ãã¾ãããï¼ããã³ãã¨ã³ãã®å ´åã¯éçºè ãã¼ã«ããAPIURLããããã®ã§ã該å½ã®APIãã³ã¼ãå æ¤ç´¢ã§ç¢ºèªãã¾ããã)
Â
å®éã«ç¦æ¢ã¯ã¼ãæ©è½ã®æ稿ã試ã¿ãã¨ãã®ã¬ã¹ãã³ã¹ã¯æ¬¡ã®éãã
ç¦æ¢ã¯ã¼ãã¯"prohibited words"ã¨ãã¦ç®¡çããã¦ãããã ã¨ãããã¨ãåãã£ãã®ã§ã"prohibitedwords"ã§ã³ã¼ãå æ¤ç´¢ãããã¨ãããNotesCreareService.tsã¨ãããã¼ãã®ä½æã管çãã¦ããããªãã¡ã¤ã«å ã«ã以ä¸ã®"hasProhibitedWords"
const hasProhibitedWords = this.checkProhibitedWordsContain({
cw: data.cw,
text: data.text,
pollChoices: data.poll?.choices,
}, this.meta.prohibitedWords);
ã¨ã以ä¸ã®"chackProhibitedWordsContain"
public checkProhibitedWordsContain(content: Parameters<UtilityService['concatNoteContentsForKeyWordCheck']>[0], prohibitedWords?: string[]) {
if (prohibitedWords == null) {
prohibitedWords = this.meta.prohibitedWords;
}
if (
this.utilityService.isKeyWordIncluded(
this.utilityService.concatNoteContentsForKeyWordCheck(content),
prohibitedWords,
)
) {
return true;
}
return false;
}
ãçºè¦ãã¾ããã
ããã«å£ã£ã¦ã"hasINMwords"ã¨"chackINMwordsContain"ãä½æãã¾ãã
Â
ã¾ãhasINMwordsã¯ä»¥ä¸ã
const hasINMWords = this.checkINMWordsContain({
cw: data.cw,
text: data.text,
pollChoices: data.poll?.choices,
}, ["ããã¾ããã", "ããã¾ãããã"]);
ãã¼ãå ã®ããã¹ããã¼ã¿ã¨ã"ç¹å®ã®èªé²"ã®ãªã¹ã(以ä¸ãINMWordsã¨å¼ã¶)ãchackINMWordsContainã«æ¸¡ãã¦ç §åããã¾ãã
ç¦æ¢ã¯ã¼ãæ©è½ã®å ´åã¯ç¦æ¢ã¯ã¼ãããã¼ã¿ãã¼ã¹ã¨ãã¦ç®¡çãã¦ãã¾ãããããã¼ã¿ãã¼ã¹å¨ãã®ç¥èã«çããã¨ããããä¸æ¦ã¯ãªã¹ãã¨ãã¦ç®¡çãããã¨ã«ãã¾ããã
Â
ç¶ãã¦ãcheckINMWordsContainã¯ä»¥ä¸ã
public checkINMWordsContain(content: Parameters<UtilityService['concatNoteContentsForKeyWordCheck']>[0], iNMWords?: string[]) {
if (iNMWords == null) {
iNMWords = [];
}
if (
this.utilityService.isKeyWordIncluded(
this.utilityService.concatNoteContentsForKeyWordCheck(content),
iNMWords,
)
) {
return true;
}
return false;
}
ç¦æ¢ã¯ã¼ãæ¤åºã¨åãè¦é ã§ããã¹ãã®æååã¨INMWordsãisKeyWordIncludeé¢æ°ã«æ¸¡ãããã®å¤å®çµæã«å¿ãã¦çå½å¤ãreturnãã¾ãã
Â
ãã®2ã¤ã®é¢æ°ã§ãç¦æ¢ã¯ã¼ãå¤å®ã¨åæ§ã«INMWordså¤å®ãã§ããããã«ãªãã¾ãã
Â
2.ã¨ã©ã¼ã³ã¼ããã«ã¹ã¿ãã¤ãºãã
次ã«ãç¹æ®ãªã¨ã©ã¼ã¡ãã»ã¼ã¸ã表示ããæ©è½ãå®è£ ãã¾ãã
Â
ç¦æ¢ã¯ã¼ããæ稿ãããã¨ããéã®ã¬ã¹ãã³ã¹ããã¨ã©ã¼IDãåããã®ã§ãã¨ã©ã¼IDã§ã³ã¼ãå æ¤ç´¢ãã¦ã¿ãã¨ãã¨ã©ã¼ã®ä½æã¯è¤æ°ã®ç®æã«ã¾ããã£ã¦ããããã§ããã
Â
ã¾ãããã¼ãä½æé¢æ°å ã§ãç¦æ¢ã¯ã¼ãå¤å®ã®çµæãTrueãªãå é¨çãªã¨ã©ã¼ãæããé¨åã以ä¸ã(Notecreateservice.ts)
if (hasProhibitedWords) {
throw new IdentifiableError('689ee33f-f97c-479a-ac49-1b9f8140af99', 'Note contains prohibited words');
}
ã¨ã©ã¼ããã£ããããã¯ã©ã¤ã¢ã³ãã«ã¨ã©ã¼ãè¿ãAPIããªã¯ã¨ã¹ãããé¨åã以ä¸ã(create.ts)
catch(e){
if (e instanceof IdentifiableError) {
if (e.id === '689ee33f-f97c-479a-ac49-1b9f8140af99') {
throw new ApiError(meta.errors.containsProhibitedWords);
}
...
}
}
æçµçã«è¿ã£ã¦ããã¨ã©ã¼id,ã¨ã©ã¼ã¡ãã»ã¼ã¸ãæ ¼ç´ããã¦ããé¨åã以ä¸ã(create.ts)
export const meta={
...
errors: {
...
containsProhibitedWords: {
message: 'Cannot post because it contains prohibited words.',
code: 'CONTAINS_PROHIBITED_WORDS',
id: 'aa6e01d3-a85c-669d-758a-76aab43af334',
}
...
ããã«å£ã£ã¦ãINMWordsãå«ã¾ãã¦ããå ´åã«è¡¨ç¤ºãããã¨ã©ã¼ãå®è£ ãã¾ãã
Â
ã¾ãããã¼ãä½æé¢æ°å ã«å é¨çãªã¨ã©ã¼ãæããé¨åãä½æã(Notecreateservice.ts)
if (hasProhibitedWords) {
throw new IdentifiableError('114514-1919-810-364364', 'Since you seem to know about Inmu, I\'ll add it to the Inmu list.');
}
ã¯ã©ã¤ã¢ã³ãã«ã¨ã©ã¼ãè¿ãAPIããªã¯ã¨ã¹ãããé¨åã以ä¸ã®ããã«ä½æã(create.ts)
catch(e){
if (e instanceof IdentifiableError) {
...
else if (e.id === '114514-1919-810-364364'){
throw new ApiError(meta.errors.containsINMWords);
}
...
}
}
表示ãããã¨ã©ã¼ã³ã¼ããã¨ã©ã¼ã¡ãã»ã¼ã¸ã以ä¸ã®ããã«å®ç¾©ã(create.ts)
export const meta={
...
errors: {
...
containsINMWords: {
message: 'Since you seem to know about Inmu, I\'ll add it to the Inmu list.',
code: 'CONTAINS_INM_WORDS',
id: '1145141919810',
}
...
ããã«ãããINMWordsãå«ããã¹ããæ稿ãããã¨ããã¨æ¬¡ã®ãããªã¨ã©ã¼ãè¿ã£ã¦ããããã«ãªãã¾ããã
Â
3.èªåBANæ©è½ã®å®è£
ç¶ãã¦ãä¸ã®ã¨ã©ã¼ãåºãã¨åæã«ã¢ã«ã¦ã³ããåçµããæ©è½ãå®è£ ãã¾ãã
Â
ã¾ããå®éã«ã¦ã¼ã¶ã¼ãåçµãã¦ã¿ãã¨ãsuspend-userã¨ããAPIãå¼ã³åºããã¦ãããã¨ãåããã¾ããã
Â
suspendã§ã³ã¼ãå æ¤ç´¢ãã¦ã¿ãã¨ãã¦ã¼ã¶ã¼ç¶æ ã«"isSuspended"ãªãã¹ãã¼ã¿ã¹ãåå¨ããããã«ããåçµæ¸ã¿ãå¦ãã管çãã¦ãããã¨ãåããã¾ããã
Â
ã¾ãããããå®éã«åãæ¿ãã¦ã¦ã¼ã¶ã¼ã®åçµãå®ç¾ãã¦ããã¨ã¿ãããsuspendé¢æ°ã以ä¸ã®ããã«å®è£ ããã¦ãã¾ããã
public async suspend(user: MiUser, moderator: MiUser): Promise {
await this.usersRepository.update(user.id, {
isSuspended: true,
});
this.moderationLogService.log(moderator, 'suspend', {
userId: user.id,
userUsername: user.username,
userHost: user.host,
});
(async () => {
await this.postSuspend(user).catch(e => {});
await this.unFollowAll(user).catch(e => {});
})();
}
Â
ãã®é¢æ°ãhasINMWordsãTrueã®å ´åã«å¼ã³åºãã®ãæåã®å®è£ æ¹éã§ããã
Â
ããããªããããã®é¢æ°ã¯å¼æ°ã«moderatorãåã£ã¦ãããã管çè ã(ã³ã³ããã¼ã«ããã«ãã)ããã¦ã¼ã¶ã¼ãBANãããã¨ããæ¹æ³ã§ã®BANããæ³å®ãã¦ãããããBANãå®è¡ãã人ããåå¨ããªãèªåBANã«ããã¦ãã®é¢æ°ãå¼ã³åºãã®ã¯é©åã§ãªãã¨å¤æãã¾ããã
Â
æçµçãªå®è£ ã¨ãã¦ã¯ãåç´ã«hasINMWordsãTrueã§ããã°ãã¦ã¼ã¶ã¼æ å ±ãæ´æ°ããUpdateé¢æ°ãå¼ã³åºããã¨ã§ãã¹ããããã¨ããã¦ã¼ã¶ã¼ã®isSusupendedãTrueã«ãããã¨ã§èªåBANãå®è£ ãã¾ããã
if (hasINMWords) {
this.usersRepository.update(user.id, {isSuspended:true,});
throw new IdentifiableError('114514-1919-810-364364', 'Since you seem to know about Inmu, I\'ll add it to the Inmu list.');
}
Â
ããããªãããMisskeyã§å ã å®è£ ããã¦ããBANæ©è½ã¯ãã¹ã¦ãµã¼ãã¼å´ã®æ©è½ã§ããã«ãé¢ãããã¯ã©ã¤ã¢ã³ãå´ã§åæã«ç¶æ ãæ¸ãæãã¦ããããããµã¼ãã¼å´ã¨ã¯ã©ã¤ã¢ã³ãå´ã§ãã¤ç¶æ ãåæãããã®ããä¸æ確ã§ãå®éã«BANããã¦ãã¹ãã§ããªããªãã¾ã§ã«ããã¿ã¤ã ã©ã°ãããã¨ããåé¡ãæ±ãã¦ãã¾ãã
Â
ä¸åº¦ãã°ã¢ã¦ããã¦ããåãã°ã¤ã³ãããã¨ããã¨å³åº§ã«BANç¶æ ã«ãªã£ã¦ãããã¨ãåããã¾ããããã°ã¢ã¦ãããªããã°ãã°ããã®éã¯ãã¹ããå¯è½ã§ãããããããã«é¢ãã¦ã¯ä»å¾æ¹åãã¦ããå¿ è¦ãããããã§ãã
Â
4.管çè ã¯BANãããªãããã«ãã
ããã¾ã§ã®æ©è½è¿½å ã§ç¡äºãç¹å®ã®èªé²ããæ稿ãããã¨ãããã®ã¯BANãããããã«ãªããå¹³åãªSNSãèªçãããã®ããã«æãã¾ããã
Â
ãããããã®ãµã¼ãã¼ã§è²ã ã¨éãã§ããã¨ããã管çè ã¢ã«ã¦ã³ãã§ãç¹å®ã®èªé²ããçºãã¦ãã¾ãã管çè ã¢ã«ã¦ã³ããBANãããã¨ããäºæ ã«é¥ãã¾ããã
Â
Misskeyã®ãµã¼ãã¼ã¯ããã©ã«ãã§ã¯æå¾ å¶ã«ãªã£ã¦ãããã¨ã¨ç®¡çè ããæå¾ ã³ã¼ããçºè¡ã§ããªããã¨ã«ãããå®å ¨ã«èª°ãå ¥ããªãç¦è¶³å°ã«ãªã£ã¦ãã¾ã£ãã
Â
Misskeyã«ããã©ã«ãã§å®è£ ããã¦ããBANæ©è½ã¯ç®¡çè ãä»ã®ã¦ã¼ã¶ã¼ãBANããæ©è½ã ãã§ããã管çè ãBANãããã¨ããã®ã¯ããããªãç¶æ³ã§ããã®ã§ç¹ã«BANããä¿è·ããæ©è½ããBANããã¦ãã¾ã£ãå ´åã«è§£é¤ããæ¹æ³ããªãã®ã§ããã¼ã¿ãã¼ã¹ãããã以å¤ã«ãã®ç¶æ ãè±ããæ¹æ³ã¯ããã¾ããã§ããã
Â
ãããªã£ã¦ãã¾ãã¨åä»ãªã®ã§ã管çè ã¯ãç¹å®ã®èªé²ããæ稿ãããã¨ãã¦ãBANãããªãããã«ãã¾ãã
Â
ã³ã¼ãã¨ãã¦ã¯ç°¡åã§ãisSuspendedé¢æ°ã¨åæ§ã«ç®¡çè ãã©ãããå¤å®ããisModeratoré¢æ°ããããã¨ãåãã£ãã®ã§ããã®è¿ãå¤ãTrueã®å ´åã¯ã¨ã©ã¼ã®çºçã¨BANã®å®è¡ãè¡ããªãããã«ãã¾ããã
if (hasINMWords) {
if (!(await this.roleService.isModerator(user as MiUser))) {
this.usersRepository.update(user.id, {
isSuspended:true,
});
throw new IdentifiableError('114514-1919-810-364364', 'Since you seem to know about Inmu, I\'ll add it to the Inmu list.');
}
}
Â
Typescriptãåãã¦è§¦ãã®ã§ã¯ããã¯åãããªãã£ãã®ã§ãããifã®æ¡ä»¶å¼å ã§awaitã使ããªãã¨ãisModeratorããè¿ãå¤ãæ»ã£ã¦ããã®ãå¾ ããã«æ¡ä»¶å¤å®ãè¡ããã¦ãã¾ãæ£ããå¤å®ãè¡ããªããããæ¡ä»¶å¼ã®åã«awaitãã¤ããå¿ è¦ãããããã§ãã
Â
ããã«ããã管çè ã ãã¯ãç¹å®ã®èªé²ããçºãã¦ãåããããªãç¹æ¨©éç´ã¨ãããã¨ã«ãªãã¾ããã
Â
ï¼.å¹æé³ãé³´ãã
æå¾ã«ãªãã±æ©è½ã¨ãã¦ãç¹å®ã®èªé²ããã¹ããããã¨ãã¦ã¨ã©ã¼ã¡ãã»ã¼ã¸ãåºãã¨ãã«è¦åé³ãé³´ãæ©è½ã追å ãã¾ããã
Â
Misskeyã§ã¯ãªã¢ã¯ã·ã§ã³ãæ¼ããã¨ãã«å¹æé³ãé³´ã£ã¦ããããããã©ã®ããã«å®ç¾ããã¦ããã®ããæ¢ã£ã¦ããã¨ãsound.Playmisskeysfx('reactinon')ã¨å¼ã³åºããã¦ããplaymisskeysfxãªãé¢æ°ãããããããå¹æé³ãé³´ããã¦ããé¢æ°ã§ããããã§ãã
Â
playmisskeysfx()ã¯ããã³ãã¨ã³ãå´ã®ãã¡ã¤ã«å ã§ä»¥ä¸ã®ããã«å®è£ ããã¦ãããä¾ãã°reactionãå¼æ°ã«æ¸¡ãã¨defaultstoreå ã§å®ç¾©ãããsound_reactionã§æå®ãããé³æºãæå®ãããé³éã§playMisskeySfxFileinternal()ã«ãã£ã¦åçãããããã§ãã
export function playMisskeySfx(operationType: OperationType) {
const sound = defaultStore.state[`sound_${operationType}`];
playMisskeySfxFile(sound).then((succeed) => {
if (!succeed && sound.type === '_driveFile_') {
// ãã©ã¤ããã¡ã¤ã«ãåå¨ããªãå ´åã¯ããã©ã«ãã®ãµã¦ã³ããåçãã
const soundName = defaultStore.def[`sound_${operationType}`].default.type as Exclude<SoundType, '_driveFile_'>;
if (_DEV_) console.log(`Failed to play sound: ${sound.fileUrl}, so play default sound: ${soundName}`);
playMisskeySfxFileInternal({
type: soundName,
volume: sound.volume,
});
}
});
}
Â
ä»ã®é³æºã«å£ã£ã¦ãstore.tså ã®defaultstoreé³æº'sound.inmu'ã追å ãã¾ãã
sound_inmu: {
where: 'device',
default: { type: 'syuilo/dededon', volume: 11.4514 } as SoundStore,
}
Â
ãã¦ããããããã¯ã¨ã³ãã®NotesCreateService()å ã§ãhasINMWordsãtrueã®æã«å¼ã³åºãã°è¯ãã¨èããã®ã§ãããããã³ãã¨ã³ãç¨ã«å®è£ ãããé¢æ°ãããã¯ã¨ã³ãå´ã§ã¤ã³ãã¼ããã¦å¼ã³åºããã¨ããã¨ã¨ã©ã¼ãçºçããããããã®æ¹éã§ã¯å®è£ ãã§ããªãã¨ãããã¨ãåããã¾ããã
Â
ããã³ãã¨ã³ãå´ã§ãhasINMWordsã®å ´åã«ã®ã¿å¹æé³ãé³´ããã¹ãããã¼ããæ稿ããéã«å¼ã³åºãããAPIãéçºè ãã¼ã«ãã調ã¹ããã¨ã«ãã¾ããã
Â
å¼ã³åºãããAPIã¯notes/createã§ããããããããã³ãã¨ã³ãããå¼ã³åºãã¦ããã³ã¼ããMkpostformå ã«çºè¦ãã¾ããã
Â
ãã®ãã¡ã¤ã«å ã«ãããã¯ã¨ã³ãããæããããã¨ã©ã¼ããã£ãããã¦ã¨ã©ã¼ã¡ãã»ã¼ã¸ã®è¡¨ç¤ºçãè¡ã£ã¦ããã³ã¼ããè¦ã¤ãã¾ããã
Â
ããã«ã¨ã©ã¼ã³ã¼ãã1145141919810ã®ã¨ã©ã¼ããã£ããããéãPlayMisskeySfx()ã以ä¸ã®ããã«å¼ã³åºããã¨ã§ãç¡äºinmu_soundãé³´ãããã¨ã«æåãã¾ããã
misskeyApi('notes/create', postData, token).then(() => {
...
}).catch(err => {
posting.value = false;
if ((err as any).id === '1145141919810') {
sound.playMisskeySfx('inmu');
}
...
Â
Â
ä»å¾ã®å±æã¨ææ³
ãããã§ãããï¼
ä»å¾ã®å±æã¨ãã¦ã¯ã
ã»ãç¹å®ã®èªé²ããDBã§ç®¡çãããã¨
Â
ã»å±éºãªã¦ã¼ã¶ã¼ã®å¦ç½®ã«é¢ãã¦ãBANãã以å¤ã«ãæ§ã ãªãªãã·ã§ã³ãç¨æãã
ã³ã¼ãä¸ã«ãã¢ã¤ã³ã³å¤æ´ã許å¯ãããå¦ããã管çããã¹ãã¼ã¿ã¹ããã£ãã®ã§ãèªé²ãå«ããã¹ããæ¤ç¥ããã¨ãããfalseã«ããä¸ã§ããã°ã©ã ããã¢ã¤ã³ã³ãå¤æ´ãããã¨ã§ãéå»ã«èªé²ãå«ããã¹ãããããã¨ããå±éºã¦ã¼ã¶ã¼ãä¸ç®ã§è¦åãããã¨ãã§ããããã«ãããªã©...
Â
ãã¦ãææ³ã¨ãã¾ãã¦ã¯ãMIsskeyèªä½ã®ã³ã¼ããããããããªãä¸æãæ©è½ãé¢æ°ã«åå²ããã¦ããããèªã¿ãããã³ã¼ãã«ãªã£ã¦ãããããã§ãå ¨å®¹ãææ¡ãã¦ããã¨ã¯è¨ãé£ãèªåã§ãæ©è½ã追å ãããã¨ãã§ããã¾ãæ©è½ã追å ããéãã»ã¨ãã©æ¢åã®é¢æ°ãçµã¿åãããã ãã§å¯è½ã§ãã¨ã¦ããããããæãã¾ããã
Â
åæã«ããã®ããã«ãªã¼ãã³ã½ã¼ã¹ã®ã½ããã¦ã§ã¢ã§å¤ãã®äººãéçºã«é¢ãããããªå¤§è¦æ¨¡ãªãã®ã®å ´åã¯ãèªã¿ãããé©åã«æ©è½ãåå²ããã¹ãã ã¨ããã®ãããã®ã³ã¼ãã1ã¤ã®ãææ¬ã¨ãã¦æèãã¹ãã ã¨æãã¾ããã
Â
以ä¸ã«ãªãã¾ããæå¾ã¾ã§èªãã§ããã ããã ãããããã¨ããããã¾ããã
Â