mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-20 12:21:38 +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:
@@ -1,12 +1,10 @@
|
||||
import { Command, sendMessage } from ".";
|
||||
import { getUserRecord } from "../db/dbUser";
|
||||
import items, { changeItemCount } from "../items";
|
||||
import { isAdmin } from "../lib/admins";
|
||||
import parseCommandArgs from "../lib/parseCommandArgs";
|
||||
import { User } from "../user";
|
||||
|
||||
export default new Command('admingive', ['admingive'], [], async msg => {
|
||||
if (!await isAdmin(msg.chatterId)) return;
|
||||
export default new Command('admingive', ['admingive'], 'admin', async msg => {
|
||||
const args = parseCommandArgs(msg.messageText);
|
||||
if (!args[0]) { await sendMessage('Please specify a user', msg.messageId); return; };
|
||||
const target = await User.initUsername(args[0].toLowerCase());
|
||||
@@ -28,4 +26,4 @@ export default new Command('admingive', ['admingive'], [], async msg => {
|
||||
await sendMessage(`Failed to give ${target.displayName} ${amount} ${item.prettyName + (amount === 1 ? '' : item.plural)}`, msg.messageId);
|
||||
};
|
||||
await target.clearLock();
|
||||
}, false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user