Merge branch 'master' of ssh://gitea.calebfontenot.com:25566/CCF_100/NoMoreAcronyms
This commit is contained in:
commit
eb4cf4b75f
@ -7,10 +7,24 @@ module.exports = {
|
|||||||
.addStringOption( option =>
|
.addStringOption( option =>
|
||||||
option.setName('string')
|
option.setName('string')
|
||||||
.setDescription("String to count characters in")
|
.setDescription("String to count characters in")
|
||||||
.setRequired(true)
|
.setRequired(false)
|
||||||
|
)
|
||||||
|
.addStringOption( option =>
|
||||||
|
option.setName('messageid')
|
||||||
|
.setDescription("Message ID of message to count characters in")
|
||||||
|
.setRequired(false)
|
||||||
),
|
),
|
||||||
async execute(interaction) {
|
async execute(interaction) {
|
||||||
var inputString = interaction.options.getString('string');
|
var inputString;
|
||||||
|
|
||||||
|
if (interaction.options.getString('string') !== null) {
|
||||||
|
inputString = interaction.options.getString('string');
|
||||||
|
} else if (interaction.options.getString('messageid') !== null) {
|
||||||
|
var messageId = interaction.options.getString('messageid');
|
||||||
|
const messagefromId = await client.channels.cache.get(interaction.channel.id).messages.fetch(messageId);
|
||||||
|
inputString = messagefromId.content;
|
||||||
|
}
|
||||||
|
|
||||||
await interaction.reply("Input: `" + inputString + "`\n" + "Output: " + codeBlock("", countChars(inputString)));
|
await interaction.reply("Input: `" + inputString + "`\n" + "Output: " + codeBlock("", countChars(inputString)));
|
||||||
console.log("User " + interaction.user.tag + " ran /count_chars");
|
console.log("User " + interaction.user.tag + " ran /count_chars");
|
||||||
},
|
},
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
const { REST, Routes } = require('discord.js');
|
const { REST, Routes } = require('discord.js');
|
||||||
|
//var guildId = process.argv.slice(1).toString();
|
||||||
|
//guildId = require('./key.json');
|
||||||
const { clientId, guildId, token } = require('./key.json');
|
const { clientId, guildId, token } = require('./key.json');
|
||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user