mirror of
https://gitlab.com/qwerinope/qweribot.git
synced 2026-02-04 15:06:58 +01:00
disabled items can no longer be used with !use, admingive is now disableable, removed command specific intents, simplified command permission system
This commit is contained in:
@@ -2,14 +2,14 @@ import { redis } from "bun";
|
||||
import { basecommands, Command, sendMessage } from ".";
|
||||
import parseCommandArgs from "../lib/parseCommandArgs";
|
||||
|
||||
export default new Command('getcommands', ['getcommands', 'getc'], [], async msg => {
|
||||
export default new Command('getcommands', ['getcommands', 'getc'], 'chatter', async msg => {
|
||||
const args = parseCommandArgs(msg.messageText);
|
||||
if (!args[0]) { await sendMessage(`A list of commands can be found here: https://github.com/qwerinope/qweribot#commands`, msg.messageId); return; };
|
||||
if (!args[0]) { await sendMessage(`A full list of commands can be found here: https://github.com/qwerinope/qweribot#commands`, msg.messageId); return; };
|
||||
const disabledcommands = await redis.smembers('disabledcommands');
|
||||
if (args[0].toLowerCase() === 'enabled') {
|
||||
const commandnames: string[] = [];
|
||||
for (const [name, command] of Array.from(basecommands.entries())) {
|
||||
if (!command.disableable) continue;
|
||||
if (command.usertype !== 'chatter') continue; // Admin only commands should be somewhat hidden
|
||||
if (disabledcommands.includes(name)) continue;
|
||||
commandnames.push(name);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user