Bot now connects, lint fixes

This commit is contained in:
Dark 2021-06-02 19:35:44 +02:00
parent d0a1beb809
commit edcfd2333f
No known key found for this signature in database
GPG key ID: 384C4B4F5B1E25A8
16 changed files with 29 additions and 24 deletions

View file

@ -26,12 +26,13 @@ export const SetSlowmodeAction = automodAction({
continue;
}
let channelsToSlowmode: TextChannel[] = [];
const channelsToSlowmode: TextChannel[] = [];
if (channel.type === ChannelTypeStrings.CATEGORY) {
// Find all text channels within the category
for (const ch of pluginData.guild.channels.cache.values()) {
if (ch.parentID === channel.id && ch.type === ChannelTypeStrings.TEXT)
if (ch.parentID === channel.id && ch.type === ChannelTypeStrings.TEXT) {
channelsToSlowmode.push(ch as TextChannel);
}
}
} else {
channelsToSlowmode.push(channel as TextChannel);

View file

@ -21,7 +21,7 @@ export async function postToCaseLogChannel(
let result;
try {
if (file != undefined) {
if (file != null) {
content.files = file;
}
result = await caseLogChannel.send({ ...content, split: false });

View file

@ -14,8 +14,8 @@ export async function censorMessage(
pluginData.state.serverLogs.ignoreLog(LogType.MESSAGE_DELETE, savedMessage.id);
try {
const channel = pluginData.guild.channels.resolve(savedMessage.channel_id) as TextChannel;
await channel.messages.delete(savedMessage.id);
const resolvedChannel = pluginData.guild.channels.resolve(savedMessage.channel_id) as TextChannel;
await resolvedChannel.messages.delete(savedMessage.id);
} catch {
return;
}

View file

@ -29,7 +29,7 @@ function updateGuildInfo(pluginData: GuildPluginData<GuildInfoSaverPluginType>)
pluginData.state.allowedGuilds.updateInfo(
pluginData.guild.id,
pluginData.guild.name,
pluginData.guild.iconURL,
pluginData.guild.iconURL(),
pluginData.guild.ownerID,
);
}

View file

@ -61,7 +61,7 @@ export const UnmuteCmd = modActionsCmd({
} else {
// Ask the mod if we should upgrade to a forceunmute as the user is not on the server
const notOnServerMsg = await msg.channel.send("User not found on the server, forceunmute instead?");
const reply = false; //await waitForReaction(pluginData.client, notOnServerMsg, ["✅", "❌"], msg.author.id); FIXME waiting on waitForButton
const reply = false; // await waitForReaction(pluginData.client, notOnServerMsg, ["✅", "❌"], msg.author.id); FIXME waiting on waitForButton
notOnServerMsg.delete().catch(noop);
if (!reply /*|| reply.name === "❌"*/) {

View file

@ -73,7 +73,7 @@ export const WarnCmd = modActionsCmd({
config.warn_notify_message.replace("{priorWarnings}", `${priorWarnAmount}`),
);
const reply = false; //await waitForReaction(pluginData.client, tooManyWarningsMsg, ["✅", "❌"], msg.author.id); FIXME waiting on waitForButton
const reply = false; // await waitForReaction(pluginData.client, tooManyWarningsMsg, ["✅", "❌"], msg.author.id); FIXME waiting on waitForButton
tooManyWarningsMsg.delete();
if (!reply /*|| reply.name === "❌"*/) {
msg.channel.send(errorMessage("Warn cancelled by moderator"));

View file

@ -46,7 +46,7 @@ export async function warnMember(
const failedMsg = await warnOptions.retryPromptChannel.send(
"Failed to message the user. Log the warning anyway?",
);
const reply = false; //await waitForReaction(pluginData.client, failedMsg, ["✅", "❌"]); FIXME waiting on waitForButton
const reply = false; // await waitForReaction(pluginData.client, failedMsg, ["✅", "❌"]); FIXME waiting on waitForButton
failedMsg.delete();
if (!reply /*|| reply.name === "❌"*/) {
return {

View file

@ -27,7 +27,7 @@ export const LoadDataEvt = persistEvt({
return;
}
let toRestore: GuildMemberEditData = {};
const toRestore: GuildMemberEditData = {};
const config = await pluginData.config.getForMember(member);
const restoredData: string[] = [];

View file

@ -41,7 +41,7 @@ export const AboutCmd = utilityCmd({
version = "?";
}
//const shard = pluginData.client.shards.get(pluginData.client.guildShardMap[pluginData.guild.id])!; FIXME Sharding stuff
// const shard = pluginData.client.shards.get(pluginData.client.guildShardMap[pluginData.guild.id])!; FIXME Sharding stuff
const lastReload = humanizeDuration(Date.now() - pluginData.state.lastReload, {
largest: 2,

View file

@ -309,7 +309,7 @@ async function performMemberSearch(
const execRegExp = getOptimizedRegExpRunner(pluginData, isSafeRegex);
/** FIXME if we ever get the intent for this again
/* FIXME if we ever get the intent for this again
if (args["status-search"]) {
matchingMembers = await asyncFilter(matchingMembers, async member => {
if (member.game) {