mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 05:51:37 +01:00
fix one character commands lmao
This commit is contained in:
@@ -10,6 +10,7 @@ export default new Command({
|
|||||||
aliases: ['use'],
|
aliases: ['use'],
|
||||||
usertype: 'chatter',
|
usertype: 'chatter',
|
||||||
disableable: false,
|
disableable: false,
|
||||||
|
specialaliases: ['i'],
|
||||||
execution: async (msg, user) => {
|
execution: async (msg, user) => {
|
||||||
const messagequery = msg.messageText.trim().split(' ').slice(1);
|
const messagequery = msg.messageText.trim().split(' ').slice(1);
|
||||||
if (!messagequery[0]) { await sendMessage('Please specify an item you would like to use', msg.messageId); return; };
|
if (!messagequery[0]) { await sendMessage('Please specify an item you would like to use', msg.messageId); return; };
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ function selectCommand(message: string): selectedCommand | false {
|
|||||||
const specialcmdselector = message.trim().toLowerCase().split(' ')[0]!;
|
const specialcmdselector = message.trim().toLowerCase().split(' ')[0]!;
|
||||||
const specialcmd = specialAliasCommands.get(specialcmdselector);
|
const specialcmd = specialAliasCommands.get(specialcmdselector);
|
||||||
if (specialcmd) return { cmd: specialcmd, activation: specialcmdselector, isitem: specialcmd instanceof Item };
|
if (specialcmd) return { cmd: specialcmd, activation: specialcmdselector, isitem: specialcmd instanceof Item };
|
||||||
|
if (!message.startsWith(commandPrefix)) return false;
|
||||||
const commandSelector = message.slice(commandPrefix.length).trim().toLowerCase().split(' ')[0]!;
|
const commandSelector = message.slice(commandPrefix.length).trim().toLowerCase().split(' ')[0]!;
|
||||||
const normalcmd = commands.get(commandSelector);
|
const normalcmd = commands.get(commandSelector);
|
||||||
if (normalcmd) return { cmd: normalcmd, activation: commandPrefix + commandSelector, isitem: normalcmd instanceof Item };
|
if (normalcmd) return { cmd: normalcmd, activation: commandPrefix + commandSelector, isitem: normalcmd instanceof Item };
|
||||||
|
|||||||
Reference in New Issue
Block a user