Merge branch 'dev' of gitlab.com:illegitimate/illegitimate-bot into dev
This commit is contained in:
@@ -10,5 +10,7 @@
|
|||||||
"botLogChannel": "1174403585149243472",
|
"botLogChannel": "1174403585149243472",
|
||||||
"guildLogChannel": "1183733282534326322",
|
"guildLogChannel": "1183733282534326322",
|
||||||
"errorLogChannel": "1192476369850994788",
|
"errorLogChannel": "1192476369850994788",
|
||||||
|
"waitingListChannel": "1145773618291298384",
|
||||||
|
"waitingListMessage": "1146027645415473193",
|
||||||
"instructionsgif": "https://cdn.discordapp.com/attachments/838716950723952640/1188211176300089384/4DMu513uNxbM.gif?ex=6599b2e4&is=65873de4&hm=e727c7a39aacbc47d6a5453f4b5f792a45679983c30d662cd258a311381b6df0&"
|
"instructionsgif": "https://cdn.discordapp.com/attachments/838716950723952640/1188211176300089384/4DMu513uNxbM.gif?ex=6599b2e4&is=65873de4&hm=e727c7a39aacbc47d6a5453f4b5f792a45679983c30d662cd258a311381b6df0&"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,21 @@
|
|||||||
import { ActionRowBuilder, ButtonStyle, ButtonBuilder } from "discord.js"
|
import {
|
||||||
import { color } from "../../../config/options.json"
|
ActionRowBuilder,
|
||||||
|
ButtonStyle,
|
||||||
|
ButtonBuilder,
|
||||||
|
GuildTextBasedChannel,
|
||||||
|
} from "discord.js"
|
||||||
|
import {
|
||||||
|
color,
|
||||||
|
waitingListChannel,
|
||||||
|
waitingListMessage,
|
||||||
|
hypixelGuildID,
|
||||||
|
} from "../../../config/options.json"
|
||||||
import mongoose from "mongoose"
|
import mongoose from "mongoose"
|
||||||
import guildapp from "../../schemas/guildAppSchema"
|
import guildapp from "../../schemas/guildAppSchema"
|
||||||
import waitingList from "../../schemas/waitinglistSchema"
|
import waitingList from "../../schemas/waitinglistSchema"
|
||||||
import { waitingListRole } from "../../../config/roles.json"
|
import { waitingListRole } from "../../../config/roles.json"
|
||||||
import { Button } from "../../interfaces"
|
import { Button } from "../../interfaces"
|
||||||
|
import { getGuild } from "../../utils/Hypixel"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "guildapplicationaccept",
|
name: "guildapplicationaccept",
|
||||||
@@ -77,6 +88,53 @@ export = {
|
|||||||
await applicant.roles.add(waitingListRole)
|
await applicant.roles.add(waitingListRole)
|
||||||
await guildapp.findOneAndDelete({ userID: applicantId })
|
await guildapp.findOneAndDelete({ userID: applicantId })
|
||||||
|
|
||||||
|
// update waiting list
|
||||||
|
const channel = guild.channels.cache.get(
|
||||||
|
waitingListChannel,
|
||||||
|
) as GuildTextBasedChannel
|
||||||
|
const wlmessage = await channel!.messages.fetch(waitingListMessage)
|
||||||
|
|
||||||
|
const wlembed = wlmessage.embeds[0]
|
||||||
|
const accepted = await waitingList.find()
|
||||||
|
|
||||||
|
for (let i = 0; i < accepted.length; i++) {
|
||||||
|
const uuid = accepted[i].uuid
|
||||||
|
const guild = await getGuild(uuid)
|
||||||
|
|
||||||
|
if (guild && guild._id === hypixelGuildID) {
|
||||||
|
await waitingList.findOneAndDelete({ uuid: uuid })
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const fields: { name: string; value: string }[] = []
|
||||||
|
|
||||||
|
for (let i = 0; i < accepted.length; i++) {
|
||||||
|
const timestamp = Math.floor(accepted[i].timestamp / 1000)
|
||||||
|
|
||||||
|
fields.push({
|
||||||
|
name: `${i + 1}. ${accepted[i].IGN}`,
|
||||||
|
value: `TS: <t:${timestamp}:R>`,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
await wlmessage.edit({
|
||||||
|
embeds: [
|
||||||
|
{
|
||||||
|
title: wlembed.title!,
|
||||||
|
description: wlembed.description!,
|
||||||
|
color: wlembed.color!,
|
||||||
|
footer: {
|
||||||
|
text: "Last updated by " + user.username,
|
||||||
|
icon_url: user.avatarURL()!,
|
||||||
|
},
|
||||||
|
thumbnail: wlembed.thumbnail!,
|
||||||
|
fields: fields,
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user