mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-18 17:14:15 +02:00
fix(arabot): add type safety to deleting text channels
This commit is contained in:
parent
1c9f6612a3
commit
4ad35f5b57
@ -148,7 +148,7 @@ export class VerificationLeaveVCListener extends Listener {
|
|||||||
listTextChannels.forEach((c) => {
|
listTextChannels.forEach((c) => {
|
||||||
const textChannel = c as TextChannel;
|
const textChannel = c as TextChannel;
|
||||||
// Checks if the channel topic has the user's snowflake
|
// Checks if the channel topic has the user's snowflake
|
||||||
if (textChannel.topic!.includes(userSnowflake!)) {
|
if (textChannel.topic !== null && textChannel.topic.includes(userSnowflake!)) {
|
||||||
textChannel.delete();
|
textChannel.delete();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -80,7 +80,7 @@ export class VerificationReady extends Listener {
|
|||||||
const textChannel = c as TextChannel;
|
const textChannel = c as TextChannel;
|
||||||
// Checks if the channel topic has the user's snowflake
|
// Checks if the channel topic has the user's snowflake
|
||||||
emptyVC.forEach((snowflake) => {
|
emptyVC.forEach((snowflake) => {
|
||||||
if (textChannel.topic!.includes(snowflake)) {
|
if (textChannel.topic !== null && textChannel.topic.includes(snowflake)) {
|
||||||
textChannel.delete();
|
textChannel.delete();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user