refactor: use proper variable names in callbacks (#9840)

* refactor: use proper variable names in callbacks

* refactor: change parameter names

* refactor: change remaining parameter names

* refactor: change remaining variable names

* refactor(GuildAuditLogsEntry): abstract reduce logic into a new function

* chore: undo unrelated changes

This undoes commit b2d93dce51 as it's unrelated

* refactor: more name changes

* chore: fix tests failing

* refactor: use option instead of opt

---------

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
Danial Raza
2023-10-09 21:49:49 +02:00
committed by GitHub
parent 2aa3250584
commit 11f6955ed9
34 changed files with 104 additions and 79 deletions

View File

@@ -364,8 +364,8 @@ client.on('messageCreate', async message => {
// https://github.com/discordjs/discord.js/issues/8545
{
// These should not throw any errors when comparing messages from any source.
channel.messages.cache.filter(m => m);
(await channel.messages.fetch()).filter(m => m.author.id === message.author.id);
channel.messages.cache.filter(message => message);
(await channel.messages.fetch()).filter(({ author }) => author.id === message.author.id);
if (channel.isDMBased()) {
expectType<DMMessageManager>(channel.messages.channel.messages);
@@ -2047,7 +2047,7 @@ collector.on('end', (collection, reason) => {
}
})();
expectType<Promise<number | null>>(shard.eval(c => c.readyTimestamp));
expectType<Promise<number | null>>(shard.eval(client => client.readyTimestamp));
// Test audit logs
expectType<Promise<GuildAuditLogs<AuditLogEvent.MemberKick>>>(guild.fetchAuditLogs({ type: AuditLogEvent.MemberKick }));