Merge branch 'dev' into 'main'

Dev

See merge request illegitimate/illegitimate-bot!160
This commit is contained in:
2024-01-06 15:08:18 +00:00
12 changed files with 27 additions and 32 deletions

View File

@@ -118,7 +118,7 @@ export = {
],
})
const linkedDiscord = player.socialMedia.links.DISCORD || null
const linkedDiscord = player?.socialMedia?.links?.DISCORD || null
if (!linkedDiscord) {
interaction.editReply({
embeds: [

View File

@@ -60,7 +60,7 @@ export interface PlayerData {
userLanguage: string
easter2020Cooldowns2: Easter2020Cooldowns2
rankPlusColor: string
socialMedia: SocialMedia
socialMedia?: SocialMedia
achievementTotem: AchievementTotem
claimed_potato_talisman: number
summer2020Cooldowns: Summer2020Cooldowns
@@ -11346,11 +11346,11 @@ export interface Easter2020Cooldowns2 {
export interface SocialMedia {
prompt: boolean
TWITCH: string
links: Links
links?: Links
}
export interface Links {
DISCORD: string
DISCORD?: string
}
export interface AchievementTotem {

View File

@@ -1,17 +0,0 @@
export type Profile = {
data: {
id: string
name: string
}
}
export type Profile2 = {
data: {
id: string
name: string
properties: { name: string; value: string }[]
profileActions: []
}
}
export type FileType = "js" | "ts"

View File

@@ -1,3 +0,0 @@
import { Profile, Profile2, FileType } from "./Types"
export { Profile, Profile2, FileType }

View File

@@ -8,7 +8,7 @@ import {
Routes,
} from "discord.js"
import fs = require("fs")
import { FileType } from "../typings"
type FileType = "js" | "ts"
async function autoDeployCommands(fileType: FileType) {
const commands = []

View File

@@ -5,7 +5,7 @@ import { loadContextMenuEvents } from "./eventHandlers"
import { loadModalEvents } from "./eventHandlers"
import { loadEvents } from "./eventHandlers"
import { loadAutocompleteEvents } from "./eventHandlers"
import { FileType } from "../typings"
type FileType = "js" | "ts"
export function loadAllEvents(client: Client, ft: FileType) {
loadEvents(client)

View File

@@ -4,7 +4,7 @@ import { Autocomplete } from "../../interfaces"
import { Events, GuildTextBasedChannel } from "discord.js"
import path = require("path")
import fs = require("fs")
import { FileType } from "../../typings"
type FileType = "js" | "ts"
const embedColor = Number(color.replace("#", "0x"))
export default function loadAutocompleteEvents(client: Client, ft: FileType) {

View File

@@ -4,7 +4,7 @@ import { Button } from "../../interfaces"
import { Events, GuildTextBasedChannel } from "discord.js"
import path = require("path")
import fs = require("fs")
import { FileType } from "../../typings"
type FileType = "js" | "ts"
const embedColor = Number(color.replace("#", "0x"))
export default function loadButtonEvents(client: Client, ft: FileType) {

View File

@@ -4,7 +4,7 @@ import { Command } from "../../interfaces"
import { Events, GuildTextBasedChannel } from "discord.js"
import path = require("path")
import fs = require("fs")
import { FileType } from "../../typings"
type FileType = "js" | "ts"
const embedColor = Number(color.replace("#", "0x"))
export default function loadSlashCommandsEvents(client: Client, ft: FileType) {

View File

@@ -4,7 +4,7 @@ import { errorLogChannel, color } from "../../../config/options.json"
import { Events, GuildTextBasedChannel } from "discord.js"
import path = require("path")
import fs = require("fs")
import { FileType } from "../../typings"
type FileType = "js" | "ts"
const embedColor = Number(color.replace("#", "0x"))
export default function loadContextMenuEvents(client: Client, ft: FileType) {

View File

@@ -4,7 +4,7 @@ import { Modal } from "../../interfaces"
import { Events, GuildTextBasedChannel } from "discord.js"
import path = require("path")
import fs = require("fs")
import { FileType } from "../../typings"
type FileType = "js" | "ts"
const embedColor = Number(color.replace("#", "0x"))
export default function loadModalEvents(client: Client, ft: FileType) {

View File

@@ -1,6 +1,5 @@
import fetch from "axios"
import env from "../Env"
import { Profile, Profile2 } from "../../typings"
import { Player, PlayerData } from "../../interfaces"
import { Guild, GuildData } from "../../interfaces"
const apikey = env.prod.hypixelapikey
@@ -11,6 +10,22 @@ const guild = "https://api.hypixel.net/guild"
const minotar = "https://minotar.net/helm/"
type GuildQuerqType = "player" | "name" | "id"
type Profile = {
data: {
id: string
name: string
}
}
type Profile2 = {
data: {
id: string
name: string
properties: { name: string; value: string }[]
profileActions: []
}
}
async function getUUID(ign: string): Promise<string | null> {
try {
const req: Profile = await fetch(mojang + ign)