mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 18:59:19 +00:00
Added and fixed broken commands
This commit is contained in:
@@ -286,7 +286,7 @@ export default class Play extends DiscordModule {
|
|||||||
|
|
||||||
query = args.join(' ');
|
query = args.join(' ');
|
||||||
} else if (data.isSlashCommand()) {
|
} else if (data.isSlashCommand()) {
|
||||||
query = args.getSubcommand();
|
query = data.getSlashCommand().options.getString('query');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!query) return;
|
if (!query) return;
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export default class Search extends DiscordModule {
|
|||||||
query = args.join(' ');
|
query = args.join(' ');
|
||||||
}
|
}
|
||||||
else if (data.isSlashCommand())
|
else if (data.isSlashCommand())
|
||||||
query = args.getSubcommand();
|
query = data.getSlashCommand().options.getString('query');
|
||||||
else if (data.isButton())
|
else if (data.isButton())
|
||||||
query = args;
|
query = args;
|
||||||
|
|
||||||
|
|||||||
@@ -7,40 +7,6 @@ export const GLOBAL_COMMANDS: Object[] = [
|
|||||||
new SlashCommandBuilder().setName('help').setDescription('Show help menu'),
|
new SlashCommandBuilder().setName('help').setDescription('Show help menu'),
|
||||||
new SlashCommandBuilder().setName('ping').setDescription('Measure network latency'),
|
new SlashCommandBuilder().setName('ping').setDescription('Measure network latency'),
|
||||||
new SlashCommandBuilder().setName('invite').setDescription('Invite me to your server!'),
|
new SlashCommandBuilder().setName('invite').setDescription('Invite me to your server!'),
|
||||||
new SlashCommandBuilder().setName('stats').setDescription('Show the bot stats'),
|
|
||||||
new SlashCommandBuilder().setName('skip').setDescription('Skip the current song'),
|
|
||||||
new SlashCommandBuilder()
|
|
||||||
.setName('nowplaying')
|
|
||||||
.setDescription('Show the current song information'),
|
|
||||||
new SlashCommandBuilder().setName('join').setDescription('Join the voice channel'),
|
|
||||||
new SlashCommandBuilder().setName('leave').setDescription('Leave the voice channel'),
|
|
||||||
new SlashCommandBuilder().setName('resume').setDescription('Resume paused music'),
|
|
||||||
new SlashCommandBuilder().setName('pause').setDescription('Pause the current music'),
|
|
||||||
new SlashCommandBuilder()
|
|
||||||
.setName('say')
|
|
||||||
.setDescription('Make me say something')
|
|
||||||
.addStringOption((option) =>
|
|
||||||
option.setName('message').setDescription('Message you want me to say').setRequired(true)
|
|
||||||
),
|
|
||||||
new SlashCommandBuilder()
|
|
||||||
.setName('osu')
|
|
||||||
.setDescription('Interact with the game osu!')
|
|
||||||
.addSubcommand((user) =>
|
|
||||||
user
|
|
||||||
.setName('user')
|
|
||||||
.setDescription('Get user information on osu!')
|
|
||||||
.addStringOption((user) =>
|
|
||||||
user.setName('user').setDescription('Username or User id').setRequired(true)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.addSubcommand((beatmap) =>
|
|
||||||
beatmap
|
|
||||||
.setName('beatmap')
|
|
||||||
.setDescription('Get beatmap information on osu!')
|
|
||||||
.addStringOption((user) =>
|
|
||||||
user.setName('beatmap').setDescription('Beatmap id').setRequired(true)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
new SlashCommandBuilder()
|
new SlashCommandBuilder()
|
||||||
.setName('userinfo')
|
.setName('userinfo')
|
||||||
.setDescription('Lookup discord user information')
|
.setDescription('Lookup discord user information')
|
||||||
@@ -51,6 +17,46 @@ export const GLOBAL_COMMANDS: Object[] = [
|
|||||||
.addUserOption((user) =>
|
.addUserOption((user) =>
|
||||||
user.setName('user').setDescription('Discord user to lookup').setRequired(true)
|
user.setName('user').setDescription('Discord user to lookup').setRequired(true)
|
||||||
)
|
)
|
||||||
|
),
|
||||||
|
new SlashCommandBuilder().setName('stats').setDescription('Show the bot stats'),
|
||||||
|
|
||||||
|
new SlashCommandBuilder()
|
||||||
|
.setName('play')
|
||||||
|
.setDescription('Play music')
|
||||||
|
.addStringOption((option) => option.setName('query').setDescription('Search query or link').setRequired(true)),
|
||||||
|
new SlashCommandBuilder()
|
||||||
|
.setName('search')
|
||||||
|
.setDescription('Search for music')
|
||||||
|
.addStringOption((option) => option.setName('query').setDescription('Search query').setRequired(true)),
|
||||||
|
new SlashCommandBuilder().setName('skip').setDescription('Skip the current song'),
|
||||||
|
new SlashCommandBuilder().setName('pause').setDescription('Pause the current music'),
|
||||||
|
new SlashCommandBuilder().setName('resume').setDescription('Resume paused music'),
|
||||||
|
new SlashCommandBuilder().setName('queue').setDescription('View the music queue'),
|
||||||
|
new SlashCommandBuilder().setName('nowplaying').setDescription('Show the current song information'),
|
||||||
|
new SlashCommandBuilder().setName('join').setDescription('Join the voice channel'),
|
||||||
|
new SlashCommandBuilder().setName('leave').setDescription('Leave the voice channel'),
|
||||||
|
|
||||||
|
new SlashCommandBuilder()
|
||||||
|
.setName('say')
|
||||||
|
.setDescription('Make me say something')
|
||||||
|
.addStringOption((option) =>
|
||||||
|
option.setName('message').setDescription('Message you want me to say').setRequired(true)
|
||||||
|
),
|
||||||
|
|
||||||
|
new SlashCommandBuilder()
|
||||||
|
.setName('osu')
|
||||||
|
.setDescription('Interact with the game osu!')
|
||||||
|
.addSubcommand((user) =>
|
||||||
|
user
|
||||||
|
.setName('user')
|
||||||
|
.setDescription('Get user information on osu!')
|
||||||
|
.addStringOption((user) => user.setName('user').setDescription('Username or User id').setRequired(true))
|
||||||
|
)
|
||||||
|
.addSubcommand((beatmap) =>
|
||||||
|
beatmap
|
||||||
|
.setName('beatmap')
|
||||||
|
.setDescription('Get beatmap information on osu!')
|
||||||
|
.addStringOption((user) => user.setName('beatmap').setDescription('Beatmap id').setRequired(true))
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
export const GUILD_COMMANDS: Object[] = [];
|
export const GUILD_COMMANDS: Object[] = [];
|
||||||
@@ -148,9 +154,7 @@ GUILD_COMMANDS.push(
|
|||||||
|
|
||||||
export const registerAllGlobalCommands = async () => {
|
export const registerAllGlobalCommands = async () => {
|
||||||
Logger.log('info', `Registering all global interaction commands`);
|
Logger.log('info', `Registering all global interaction commands`);
|
||||||
await DiscordProvider.client.application?.commands.set(
|
await DiscordProvider.client.application?.commands.set(JSON.parse(JSON.stringify(GLOBAL_COMMANDS)));
|
||||||
JSON.parse(JSON.stringify(GLOBAL_COMMANDS))
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const unregisterAllGlobalCommands = async () => {
|
export const unregisterAllGlobalCommands = async () => {
|
||||||
@@ -174,10 +178,7 @@ export const registerAllGuildsCommands = async () => {
|
|||||||
|
|
||||||
if (!guildObject) continue;
|
if (!guildObject) continue;
|
||||||
|
|
||||||
Logger.log(
|
Logger.log('info', `Registering all interaction commands on guild ${guildObject.name} (${guildObject.id})`);
|
||||||
'info',
|
|
||||||
`Registering all interaction commands on guild ${guildObject.name} (${guildObject.id})`
|
|
||||||
);
|
|
||||||
await DiscordProvider.client.guilds.cache
|
await DiscordProvider.client.guilds.cache
|
||||||
.get(guildObject.id)
|
.get(guildObject.id)
|
||||||
?.commands.set(JSON.parse(JSON.stringify(GUILD_COMMANDS)));
|
?.commands.set(JSON.parse(JSON.stringify(GUILD_COMMANDS)));
|
||||||
@@ -192,10 +193,7 @@ export const unregisterAllGuildsCommands = async () => {
|
|||||||
|
|
||||||
if (!guildObject) continue;
|
if (!guildObject) continue;
|
||||||
|
|
||||||
Logger.log(
|
Logger.log('info', `Unregistering all interaction commands on guild ${guildObject.name} (${guildObject.id})`);
|
||||||
'info',
|
|
||||||
`Unregistering all interaction commands on guild ${guildObject.name} (${guildObject.id})`
|
|
||||||
);
|
|
||||||
await DiscordProvider.client.guilds.cache.get(guildObject.id)?.commands.set([]);
|
await DiscordProvider.client.guilds.cache.get(guildObject.id)?.commands.set([]);
|
||||||
|
|
||||||
//const commands = await guildObject.commands.fetch();
|
//const commands = await guildObject.commands.fetch();
|
||||||
|
|||||||
Reference in New Issue
Block a user