refactor(commands/administration): adding the function list placeholder
- Permit to change all information in only on function
This commit is contained in:
parent
7061a98373
commit
9d50717163
1 changed files with 14 additions and 14 deletions
|
|
@ -20,6 +20,16 @@ import { Guild as GuildPrisma } from '@prisma/client';
|
||||||
import { prisma } from '@lib/prisma';
|
import { prisma } from '@lib/prisma';
|
||||||
import emoji from '../../../assets/emoji.json' assert { type: 'json' };
|
import emoji from '../../../assets/emoji.json' assert { type: 'json' };
|
||||||
|
|
||||||
|
function listPlaceholder(): string {
|
||||||
|
let to_ret: string = '';
|
||||||
|
to_ret += '{user.mention} → mentions the user\n';
|
||||||
|
to_ret += '{user.name} → username\n';
|
||||||
|
to_ret += '{user.tag} → username#0000\n';
|
||||||
|
to_ret += '{guild.name} → server name\n';
|
||||||
|
to_ret += '{guild.count} → number of the member in the guild\n';
|
||||||
|
return to_ret;
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('welcome')
|
.setName('welcome')
|
||||||
|
|
@ -131,13 +141,8 @@ export default {
|
||||||
.setCustomId('placeholder')
|
.setCustomId('placeholder')
|
||||||
.setRequired(false)
|
.setRequired(false)
|
||||||
.setStyle(TextInputStyle.Paragraph)
|
.setStyle(TextInputStyle.Paragraph)
|
||||||
.setLabel('The placeholders allowed for this message')
|
.setLabel('The placeholders (ReadOnly)')
|
||||||
.setValue(
|
.setValue(listPlaceholder());
|
||||||
'{user.mention} → mentions the user\n' +
|
|
||||||
'{user.name} → username\n' +
|
|
||||||
'{user.tag} → username#0000\n' +
|
|
||||||
'{guild.name} → server name\n',
|
|
||||||
);
|
|
||||||
modal.addComponents(
|
modal.addComponents(
|
||||||
new ActionRowBuilder<TextInputBuilder>().addComponents(joinInput),
|
new ActionRowBuilder<TextInputBuilder>().addComponents(joinInput),
|
||||||
new ActionRowBuilder<TextInputBuilder>().addComponents(placeholdersDisplay),
|
new ActionRowBuilder<TextInputBuilder>().addComponents(placeholdersDisplay),
|
||||||
|
|
@ -224,13 +229,8 @@ export default {
|
||||||
.setCustomId('placeholder')
|
.setCustomId('placeholder')
|
||||||
.setRequired(false)
|
.setRequired(false)
|
||||||
.setStyle(TextInputStyle.Paragraph)
|
.setStyle(TextInputStyle.Paragraph)
|
||||||
.setLabel('The placeholders allowed for this message')
|
.setLabel('The placeholders (ReadOnly)')
|
||||||
.setValue(
|
.setValue(listPlaceholder());
|
||||||
'{user.mention} → mentions the user\n' +
|
|
||||||
'{user.name} → username\n' +
|
|
||||||
'{user.tag} → username#0000\n' +
|
|
||||||
'{guild.name} → server name\n',
|
|
||||||
);
|
|
||||||
modal.addComponents(
|
modal.addComponents(
|
||||||
new ActionRowBuilder<TextInputBuilder>().addComponents(leaveInput),
|
new ActionRowBuilder<TextInputBuilder>().addComponents(leaveInput),
|
||||||
new ActionRowBuilder<TextInputBuilder>().addComponents(placeholdersDisplay),
|
new ActionRowBuilder<TextInputBuilder>().addComponents(placeholdersDisplay),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue