Skip to content

Commit

Permalink
guess what
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Jul 22, 2023
1 parent 7f42645 commit 5bf98ce
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 43 deletions.
1 change: 0 additions & 1 deletion json/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"images": "https://database.faithfulpack.net/images/",
"icon": "https://database.faithfulpack.net/images/branding/logos/transparent/512/complibot_logo.png",
"teams": [
{
"name": "faithful",
Expand Down
38 changes: 1 addition & 37 deletions src/commands/bot/botban.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { Config, SlashCommand, SlashCommandI } from "@interfaces";
import { SlashCommand, SlashCommandI } from "@interfaces";
import { SlashCommandBuilder } from "@discordjs/builders";
import { Client, MessageEmbed, CommandInteraction } from "@client";
import { Collection, MessageAttachment, TextChannel } from "discord.js";
import ConfigJson from "@json/config.json";
import { colors } from "@helpers/colors";
import { readFileSync, writeFileSync } from "fs";
import { join } from "path";
const config: Config = ConfigJson;

export const command: SlashCommand = {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -85,39 +82,6 @@ export const command: SlashCommand = {
} <@${victimID}>`,
ephemeral: true,
});
const embed: MessageEmbed = new MessageEmbed()
.setTitle(
`${
interaction.options.getBoolean("revoke") ? "Removed" : "Added"
} <@${victimID}> to botban list`,
)
.setAuthor({
name: interaction.user.username,
iconURL: interaction.user.avatarURL({ dynamic: true }),
})
.setColor(colors.red)
.addFields([
{ name: "Server", value: `\`${interaction.guild.name}\``, inline: true },
{ name: "Channel", value: `${interaction.channel}`, inline: true },
])
.setTimestamp();

// send log into the addressed logs channel
let logChannel: TextChannel;
const team: string = config.discords.filter((d) => d.id === interaction.guildId)[0].team;
try {
if (team)
logChannel = (await client.channels.fetch(
config.teams.filter((t) => t.name === team)[0].channels.moderation,
)) as any;
else
logChannel = (await client.channels.fetch(
config.discords.filter((d) => d.id === interaction.guildId)[0].channels.moderation,
)) as any;
logChannel.send({ embeds: [embed] });
} catch {
return;
} // can't fetch channel
})
.set("view", async (interaction: CommandInteraction, client: Client) => {
if (
Expand Down
8 changes: 4 additions & 4 deletions src/commands/bot/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const command: SlashCommand = {
execute: new Collection<string, SlashCommandI>()
.set("bot", async (interaction: CommandInteraction, client: Client) => {
let sumMembers = 0;
let version;
let version: string;

client.guilds.cache.each((guild: Guild) => {
sumMembers += guild.memberCount;
Expand All @@ -43,7 +43,7 @@ export const command: SlashCommand = {
).split("$,");

const embed = new MessageEmbed()
.setTitle(`${client.user.username} Stats`)
.setTitle(`${client.user.username}'s Statistics`)
.setThumbnail(client.user.displayAvatarURL())
.addFields(
{ name: FieldTitles[0], value: client.tokens.prefix, inline: true },
Expand All @@ -63,14 +63,14 @@ export const command: SlashCommand = {
)
.setFooter({
text: await interaction.getEphemeralString({ string: "Command.Stats.Footer" }),
iconURL: "https://cdn.discordapp.com/emojis/799357507126427699",
iconURL: `${client.config.images}bot/heart.png`,
});
interaction
.reply({ embeds: [embed], fetchReply: true })
.then((message: Message) => message.deleteButton());
})
.set("command", async (interaction: CommandInteraction, client: Client) => {
//if the command ars is provided and the command does not exist in commandsProcessed:
//if the command args are provided and the command does not exist in commandsProcessed:
if (
interaction.options.getString("command") &&
client.commandsProcessed.get(interaction.options.getString("command")) === undefined
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/sorter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const addPathsToEmbed = (texture: Texture): EmbedFieldData[] => {
};

export const formatName = (pack: string, size: string = "512"): string[] => {
// TODO: use API here
// TODO: migrate from old config (ideally move to API if possible)
let strPack: string;
let strIconURL = ConfigJson.images + `branding/logos/transparent/${size}/`;
switch (pack) {
Expand Down

0 comments on commit 5bf98ce

Please sign in to comment.