bash remove trailing slash
VALUE=/looks/like/a/path///
TRIMMED=$(echo $VALUE | sed 's:/*$::')
echo $VALUE $TRIMMED
bash remove trailing slash
VALUE=/looks/like/a/path///
TRIMMED=$(echo $VALUE | sed 's:/*$::')
echo $VALUE $TRIMMED
how to clear all slash commands
require('dotenv').config();
const { SlashCommandBuilder } = require('@discordjs/builders');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const token = process.env.TOKEN;
const clientId = process.env.CLIENT_ID;
const guildId = process.env.TEST_GUILD_ID;
const rest = new REST({ version: '9' }).setToken(token);
rest.get(Routes.applicationGuildCommands(clientId, guildId))
.then(data => {
const promises = [];
for (const command of data) {
const deleteUrl = `${Routes.applicationGuildCommands(clientId, guildId)}/${command.id}`;
promises.push(rest.delete(deleteUrl));
}
return Promise.all(promises);
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us