Add countChars function

This commit is contained in:
Chloe Fontenot 🏳️‍⚧️ 2023-04-04 17:20:28 -05:00
parent 9d5ef6f883
commit 03935a0cee
4 changed files with 19 additions and 19 deletions

@ -18,7 +18,7 @@ module.exports = {
.setDescription("The phrase that the abbreviation shortens")
.setRequired(true)
),
async execute(interaction) {
async execute(interaction, client) {
var abbreviation = interaction.options.getString('abbreviation').toLowerCase();
var phrase = interaction.options.getString('phrase');
await interaction.reply('Adding abbreviation `' + abbreviation + "` to target list. This will complete to the phrase `" + phrase + "`");

@ -14,7 +14,7 @@ module.exports = {
.setDescription("Message ID of message to count characters in")
.setRequired(false)
),
async execute(interaction) {
async execute(interaction, client) {
var inputString;
if (interaction.options.getString('string') !== null) {

@ -7,7 +7,7 @@ module.exports = {
data: new SlashCommandBuilder()
.setName('list_phrases')
.setDescription('Lists phrases in target phrases.'),
async execute(interaction) {
async execute(interaction, client) {
await interaction.reply("Here are the current phrases in the phrase list:" + codeBlock("json", JSON.stringify(abbreviationKey.target_phrases, null, " ")));
console.log("User " + interaction.user.tag + " ran /list_phrases");
},

@ -4,7 +4,7 @@ module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction) {
async execute(interaction, client) {
await interaction.reply('Pong!');
console.log("User " + interaction.user.tag + " ran /ping");
},