mirror of
https://github.com/syuilo/ai.git
synced 2024-12-22 08:21:08 +00:00
Improve readability
This commit is contained in:
parent
140d3c324d
commit
cac1badb98
|
@ -128,7 +128,10 @@ export default class 藍 {
|
|||
private onMention(msg: MessageLike) {
|
||||
this.log(chalk.gray(`<<< An message received: ${chalk.underline(msg.id)}`));
|
||||
|
||||
const context = !msg.isMessage && msg.replyId == null ? null : this.contexts.findOne(msg.isMessage ? {
|
||||
const isNoContext = !msg.isMessage && msg.replyId == null;
|
||||
|
||||
// Look up the context
|
||||
const context = isNoContext ? null : this.contexts.findOne(msg.isMessage ? {
|
||||
isMessage: true,
|
||||
userId: msg.userId
|
||||
} : {
|
||||
|
|
Loading…
Reference in a new issue