3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 08:45:03 +00:00

perf(arrays): Improved array looping

This commit is contained in:
unknown 2021-05-02 02:53:18 -04:00
parent edd78fc9c6
commit f9520ab434
No known key found for this signature in database
GPG key ID: 5D70E03C78E749BA
12 changed files with 45 additions and 37 deletions

View file

@ -29,11 +29,12 @@ export const ChannelLeaveAlertsEvt = locateUserEvt({
const triggeredAlerts = await meta.pluginData.state.alerts.getAlertsByUserId(meta.args.member.id);
const voiceChannel = meta.args.oldChannel as VoiceChannel;
triggeredAlerts.forEach(alert => {
for (let i = 0; i < triggeredAlerts.length; ++i) {
const alert = triggeredAlerts[i];
const txtChannel = meta.pluginData.client.getChannel(alert.channel_id) as TextableChannel;
txtChannel.createMessage(
`🔴 <@!${alert.requestor_id}> the user <@!${alert.user_id}> disconnected out of \`${voiceChannel.name}\``,
);
});
}
},
});