Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/phillip/chat-skill-merge' into d…
Browse files Browse the repository at this point in the history
…elta
  • Loading branch information
SabreCat committed Jul 10, 2023
2 parents a505d2e + 2d71a90 commit 74e1a2a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions website/server/libs/spells.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,18 @@ async function castSpell (req, res, { isV3 = false }) {
});

if (party && !spell.silent) {
const lastMessages = await Chat.find({ groupId: group._id })

Check failure on line 244 in website/server/libs/spells.js

View workflow job for this annotation

GitHub Actions / lint (14.x)

'Chat' is not defined

Check failure on line 244 in website/server/libs/spells.js

View workflow job for this annotation

GitHub Actions / lint (14.x)

'group' is not defined
.limit(1)
.sort('-timestamp')
.exec();
if (lastMessages.size == 1) {

Check failure on line 248 in website/server/libs/spells.js

View workflow job for this annotation

GitHub Actions / lint (14.x)

Expected '===' and instead saw '=='
const lastMessage = lastMessages[0];
if (lastMessage.info.spell == spellId && lastMessage.info.user == user.profile.name) {

Check failure on line 250 in website/server/libs/spells.js

View workflow job for this annotation

GitHub Actions / lint (14.x)

Expected '===' and instead saw '=='

Check failure on line 250 in website/server/libs/spells.js

View workflow job for this annotation

GitHub Actions / lint (14.x)

Expected '===' and instead saw '=='
lastMessage.info.times += 1;
await lastMessage.save();
return;
}
}
if (targetType === 'user') {
const newChatMessage = party.sendChat({
message: `\`${common.i18n.t('chatCastSpellUser', { username: user.profile.name, spell: spell.text(), target: partyMembers.profile.name }, 'en')}\``,
Expand All @@ -250,6 +262,7 @@ async function castSpell (req, res, { isV3 = false }) {
class: klass,
spell: spellId,
target: partyMembers.profile.name,
times: 1

Check failure on line 265 in website/server/libs/spells.js

View workflow job for this annotation

GitHub Actions / lint (14.x)

Missing trailing comma
},
});
await newChatMessage.save();
Expand All @@ -261,6 +274,7 @@ async function castSpell (req, res, { isV3 = false }) {
user: user.profile.name,
class: klass,
spell: spellId,
times: 1

Check failure on line 277 in website/server/libs/spells.js

View workflow job for this annotation

GitHub Actions / lint (14.x)

Missing trailing comma
},
});
await newChatMessage.save();
Expand Down

0 comments on commit 74e1a2a

Please sign in to comment.