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:
parent
edd78fc9c6
commit
f9520ab434
12 changed files with 45 additions and 37 deletions
|
@ -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}\``,
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue