Skip to content

Commit b157e33

Browse files
committed
commands: Alts permissions
1 parent 920500f commit b157e33

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/ps/commands/alts.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ import type { PSCommand } from '@/types/chat';
66

77
export const command: PSCommand = {
88
name: 'alts',
9-
help: 'Testing command',
10-
syntax: 'CMD USERNAME?',
9+
help: "Lists a user's alts. Requires trusted perms to view beyond your own.",
10+
syntax: 'CMD [user?]',
1111
aliases: ['getalts'],
1212
categories: ['utility'],
1313
async run({ message, arg, $T, checkPermissions }) {
1414
let lookup = message.author.userid;
1515
if (arg) {
16-
if (!checkPermissions(['room', 'driver'])) throw new ChatError($T('ACCESS_DENIED'));
16+
// TODO: Change this to use _any_ room
17+
if (!checkPermissions(['room', 'driver']) && !checkPermissions(['global', 'voice'])) throw new ChatError($T('ACCESS_DENIED'));
1718
lookup = toId(arg);
1819
}
1920
const altsList = await getAlts(lookup);
20-
message.reply($T('COMMANDS.ALTS', { alts: altsList.join(', ') }));
21+
// TODO: Handle no-alts case
22+
message.privateReply($T('COMMANDS.ALTS', { alts: altsList.join(', ') }));
2123
},
2224
};

0 commit comments

Comments
 (0)