Skip to content

Commit d5dc0a2

Browse files
committed
fix type errors re rebase
1 parent cbcc92f commit d5dc0a2

File tree

4 files changed

+26
-21
lines changed

4 files changed

+26
-21
lines changed

src/modules/helpchan.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ export class HelpChanModule extends Module {
285285
aliases: ['helpers'],
286286
})
287287
async helper(msg: Message) {
288-
if (msg.channel.type !== 'text') return;
289-
if (msg.channel.parentID !== categories.ongoing) {
288+
if (msg.channel.type !== 'GUILD_TEXT') return;
289+
if (msg.channel.parentId !== categories.ongoing) {
290290
return msg.channel.send(
291291
':warning: You may only ping helpers from a help channel',
292292
);

src/modules/playground.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ export class PlaygroundModule extends Module {
102102
if (msg.author.bot || !this.editedLongLink.has(msg.id) || exec) return;
103103
const botMsg = this.editedLongLink.get(msg.id);
104104
// Edit the message to only have the embed and not the "please edit your message" message
105-
await botMsg?.edit('', {
106-
embed: botMsg.embeds[0],
105+
await botMsg?.edit({
106+
content: '',
107+
embeds: [botMsg.embeds[0]],
107108
});
108109
this.editedLongLink.delete(msg.id);
109110
}

src/modules/rep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export class RepModule extends Module {
126126
description: "Reputation: View a user's reputation history",
127127
})
128128
async getrep(msg: Message, @optional user?: User) {
129-
if (!msg.member || msg.channel.type !== 'text') {
129+
if (!msg.member) {
130130
return;
131131
}
132132
if (!user) user = msg.author;

src/util/sendPaginatedMessage.ts

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
GuildMember,
33
MessageEmbed,
44
MessageReaction,
5-
TextChannel,
5+
TextBasedChannels,
66
User,
77
} from 'discord.js';
88

@@ -18,15 +18,17 @@ export async function sendPaginatedMessage(
1818
embed: MessageEmbed,
1919
pages: string[],
2020
member: GuildMember,
21-
channel: TextChannel,
21+
channel: TextBasedChannels,
2222
timeout: number = 100000,
2323
) {
2424
let curPage = 0;
25-
const message = await channel.send(
26-
embed
27-
.setDescription(pages[curPage])
28-
.setFooter(`Page ${curPage + 1} of ${pages.length}`),
29-
);
25+
const message = await channel.send({
26+
embeds: [
27+
embed
28+
.setDescription(pages[curPage])
29+
.setFooter(`Page ${curPage + 1} of ${pages.length}`),
30+
],
31+
});
3032
if (pages.length === 1) return;
3133

3234
await message.react(emojis.first);
@@ -35,11 +37,11 @@ export async function sendPaginatedMessage(
3537
await message.react(emojis.next);
3638
await message.react(emojis.last);
3739

38-
const collector = message.createReactionCollector(
39-
(reaction, user) =>
40+
const collector = message.createReactionCollector({
41+
filter: (reaction, user) =>
4042
user.id === member.id && user.id !== message.author.id,
41-
{ time: timeout },
42-
);
43+
time: timeout,
44+
});
4345

4446
collector.on('collect', async (reaction: MessageReaction, user: User) => {
4547
await reaction.users.remove(user);
@@ -64,11 +66,13 @@ export async function sendPaginatedMessage(
6466
break;
6567
}
6668

67-
await message.edit(
68-
embed
69-
.setDescription(pages[curPage])
70-
.setFooter(`Page ${curPage + 1} of ${pages.length}`),
71-
);
69+
await message.edit({
70+
embeds: [
71+
embed
72+
.setDescription(pages[curPage])
73+
.setFooter(`Page ${curPage + 1} of ${pages.length}`),
74+
],
75+
});
7276
});
7377

7478
collector.on('end', () => {

0 commit comments

Comments
 (0)