bump versions #43

Merged
Anri merged 3 commits from bump into main 2022-07-27 21:46:09 +02:00
7 changed files with 489 additions and 489 deletions

929
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -15,9 +15,9 @@
"author": "La confrérie du Kassoulait",
"license": "GPL-3.0-only",
"dependencies": {
"@discordjs/rest": "^0.5.0",
"@discordjs/rest": "^1.0.1",
"discord-api-types": "^0.36.0",
"discord.js": "^13.8.1",
"discord.js": "^14.0.3",
"typescript": "^4.7.4"
},
"devDependencies": {

View file

@ -6,7 +6,7 @@ import { removeExtension } from '../utils/misc';
/** Load all the commands. */
export default async (client: Client) => {
const rest = new REST({ version: '9' }).setToken(client.token ?? '');
const rest = new REST({ version: '10' }).setToken(client.token ?? '');
const command_categories = (await readdir(__dirname))
.filter(element => !element.endsWith('.js') && !element.endsWith('.ts'));

View file

@ -1,6 +1,6 @@
import { SlashCommandBuilder } from '@discordjs/builders';
import { Locale } from 'discord-api-types/v9';
import { Client, CommandInteraction, MessageEmbed } from 'discord.js';
import { Client, CommandInteraction, EmbedBuilder } from 'discord.js';
import { getLocale, getLocalizations } from '../../utils/locales';
import { getFilename } from '../../utils/misc';
import '../../modules/string';
@ -33,10 +33,10 @@ export default {
interaction: async (interaction: CommandInteraction, client: Client) => {
const loc = getLocale(client, interaction.locale);
const desired_command = interaction.options.getString(client
const desired_command = interaction.options.get(client
.locales
.get(client.config.default_lang)
?.get(`c_${getFilename(__filename)}_opt1_name`) ?? '');
?.get(`c_${getFilename(__filename)}_opt1_name`) ?? '')?.value as string;
// If a command isn't specified
if (!desired_command) {
@ -59,8 +59,8 @@ export default {
// Sends a list of commands sorted into categories
return interaction.reply({ embeds: [
new MessageEmbed()
.setColor('BLURPLE')
new EmbedBuilder()
.setColor('Blurple')
.setTitle(loc.get('c_help1'))
.setDescription(loc.get('c_help2'))
.addFields(fields),
@ -79,8 +79,8 @@ export default {
// Send information about the command
return interaction.reply({ embeds: [
new MessageEmbed()
.setColor('BLURPLE')
new EmbedBuilder()
.setColor('Blurple')
.setTitle('`/' + command.data.name + '`')
.setDescription(
// Loads the description

View file

@ -1,9 +1,9 @@
import { Client, Interaction } from 'discord.js';
import { Client, Interaction, InteractionType } from 'discord.js';
import { getLocale } from '../../utils/locales';
/** https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-interactionCreate */
export default (interaction: Interaction, client: Client) => {
if (interaction.isCommand()) {
if (interaction.type === InteractionType.ApplicationCommand) {
const command = client.commands.list.get(interaction.commandName);
if (!command) {
const loc = getLocale(client, interaction.locale);

View file

@ -1,4 +1,4 @@
import { Client, GuildMember, Message, MessageEmbed, TextBasedChannel } from 'discord.js';
import { Client, GuildMember, Message, TextBasedChannel, EmbedBuilder } from 'discord.js';
import { getLocale } from '../../utils/locales';
import { isImage, userWithNickname } from '../../utils/misc';
import { showDate } from '../../utils/time';
@ -83,7 +83,7 @@ export default async (message: Message, client: Client) => {
// Remove duplicates then map the quoted posts
[...new Set(messages)].map(quoted_post => {
const embed = new MessageEmbed()
const embed = new EmbedBuilder()
.setColor('#2f3136')
.setAuthor({
name: 'Citation',
@ -149,10 +149,17 @@ export default async (message: Message, client: Client) => {
});
// Location/author of the quoted post
embed.addField(author, `${quoted_post?.author}`, true);
embed.addField(
'Message', `${quoted_post?.channel} - [Lien Message](${quoted_post?.url})`,
true
embed.addFields(
{
name: author,
value: `${quoted_post?.author}`,
inline: true,
},
{
name: 'Message',
value: `${quoted_post?.channel} - [Lien Message](${quoted_post?.url})`,
inline: true,
}
);
// Delete source message if no content when removing links

View file

@ -1,4 +1,4 @@
import { Client, Collection, Intents } from 'discord.js';
import { Client, Collection, GatewayIntentBits } from 'discord.js';
import { readFileSync } from 'fs';
import { loadLocales } from './locales';
import '../modules/client';
@ -7,8 +7,8 @@ import '../modules/client';
export default async () => {
const client: Client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
],
});