bump versions #43

Merged
Anri merged 3 commits from bump into main 2022-07-27 21:46:09 +02:00
7 changed files with 490 additions and 488 deletions
Showing only changes of commit decd0b65f3 - Show all commits

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", "author": "La confrérie du Kassoulait",
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
"dependencies": { "dependencies": {
"@discordjs/rest": "^0.5.0", "@discordjs/rest": "^1.0.1",
"discord-api-types": "^0.36.0", "discord-api-types": "^0.36.0",
"discord.js": "^13.8.1", "discord.js": "^14.0.3",
"typescript": "^4.7.4" "typescript": "^4.7.4"
}, },
"devDependencies": { "devDependencies": {

View file

@ -6,7 +6,7 @@ import { removeExtension } from '../utils/misc';
/** Load all the commands. */ /** Load all the commands. */
export default async (client: Client) => { 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)) const command_categories = (await readdir(__dirname))
.filter(element => !element.endsWith('.js') && !element.endsWith('.ts')); .filter(element => !element.endsWith('.js') && !element.endsWith('.ts'));

View file

@ -1,6 +1,6 @@
import { SlashCommandBuilder } from '@discordjs/builders'; import { SlashCommandBuilder } from '@discordjs/builders';
import { Locale } from 'discord-api-types/v9'; import { Locale } from 'discord-api-types/v9';
import { Client, CommandInteraction, MessageEmbed } from 'discord.js'; import { Client, CommandInteraction, CommandInteractionOptionResolver, EmbedBuilder } from 'discord.js';
import { getLocale, getLocalizations } from '../../utils/locales'; import { getLocale, getLocalizations } from '../../utils/locales';
import { getFilename } from '../../utils/misc'; import { getFilename } from '../../utils/misc';
import '../../modules/string'; import '../../modules/string';
@ -33,7 +33,9 @@ export default {
interaction: async (interaction: CommandInteraction, client: Client) => { interaction: async (interaction: CommandInteraction, client: Client) => {
const loc = getLocale(client, interaction.locale); const loc = getLocale(client, interaction.locale);
const desired_command = interaction.options.getString(client const desired_command = (
interaction.options as CommandInteractionOptionResolver
).getString(client
.locales .locales
.get(client.config.default_lang) .get(client.config.default_lang)
?.get(`c_${getFilename(__filename)}_opt1_name`) ?? ''); ?.get(`c_${getFilename(__filename)}_opt1_name`) ?? '');
@ -59,8 +61,8 @@ export default {
// Sends a list of commands sorted into categories // Sends a list of commands sorted into categories
return interaction.reply({ embeds: [ return interaction.reply({ embeds: [
new MessageEmbed() new EmbedBuilder()
.setColor('BLURPLE') .setColor('Blurple')
.setTitle(loc.get('c_help1')) .setTitle(loc.get('c_help1'))
.setDescription(loc.get('c_help2')) .setDescription(loc.get('c_help2'))
.addFields(fields), .addFields(fields),
@ -79,8 +81,8 @@ export default {
// Send information about the command // Send information about the command
return interaction.reply({ embeds: [ return interaction.reply({ embeds: [
new MessageEmbed() new EmbedBuilder()
.setColor('BLURPLE') .setColor('Blurple')
.setTitle('`/' + command.data.name + '`') .setTitle('`/' + command.data.name + '`')
.setDescription( .setDescription(
// Loads the description // 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'; import { getLocale } from '../../utils/locales';
/** https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-interactionCreate */ /** https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-interactionCreate */
export default (interaction: Interaction, client: Client) => { export default (interaction: Interaction, client: Client) => {
if (interaction.isCommand()) { if (interaction.type === InteractionType.ApplicationCommand) {
const command = client.commands.list.get(interaction.commandName); const command = client.commands.list.get(interaction.commandName);
if (!command) { if (!command) {
const loc = getLocale(client, interaction.locale); 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 { getLocale } from '../../utils/locales';
import { isImage, userWithNickname } from '../../utils/misc'; import { isImage, userWithNickname } from '../../utils/misc';
import { showDate } from '../../utils/time'; import { showDate } from '../../utils/time';
@ -83,7 +83,7 @@ export default async (message: Message, client: Client) => {
// Remove duplicates then map the quoted posts // Remove duplicates then map the quoted posts
[...new Set(messages)].map(quoted_post => { [...new Set(messages)].map(quoted_post => {
const embed = new MessageEmbed() const embed = new EmbedBuilder()
.setColor('#2f3136') .setColor('#2f3136')
.setAuthor({ .setAuthor({
name: 'Citation', name: 'Citation',
@ -149,10 +149,17 @@ export default async (message: Message, client: Client) => {
}); });
// Location/author of the quoted post // Location/author of the quoted post
embed.addField(author, `${quoted_post?.author}`, true); embed.addFields(
embed.addField( {
'Message', `${quoted_post?.channel} - [Lien Message](${quoted_post?.url})`, name: author,
true 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 // 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 { readFileSync } from 'fs';
import { loadLocales } from './locales'; import { loadLocales } from './locales';
import '../modules/client'; import '../modules/client';
@ -7,8 +7,8 @@ import '../modules/client';
export default async () => { export default async () => {
const client: Client = new Client({ const client: Client = new Client({
intents: [ intents: [
Intents.FLAGS.GUILDS, GatewayIntentBits.Guilds,
Intents.FLAGS.GUILD_MESSAGES, GatewayIntentBits.GuildMessages,
], ],
}); });