Skip to content

Commit dd32b37

Browse files
committed
Add initial command handler placeholders
- Referencing `ChatModule.sendMessage` switch-cases - Added `TODO` type to keep track of implementation plans
1 parent 2cf2c9d commit dd32b37

10 files changed

Lines changed: 199 additions & 0 deletions

File tree

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
},
1717
"imports": {
1818
"#assets/*": "./src/assets/*",
19+
"#commands": "./src/commands/index.ts",
20+
"#commands/*": "./src/commands/*",
1921
"#components/*": "./src/components/*",
22+
"#composables/*": "./src/composables/*",
2023
"#constants": "./src/constants/index.ts",
2124
"#constants/*": "./src/constants/*",
2225
"#models": "./src/models/index.ts",

src/commands/handlers/channel.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { TODO } from '#models';
2+
3+
/**
4+
* Join a channel.
5+
* `/join <channel>`
6+
*/
7+
export const join: TODO = null;
8+
/**
9+
* Leave a channel.
10+
* `/leave <channel>`
11+
*/
12+
export const leave: TODO = null;
13+
/**
14+
* Switch channel
15+
* `/goto <channel>`
16+
* `/goto #general`
17+
*/
18+
export const goto: TODO = null;

src/commands/handlers/help.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { TODO } from '#models';
2+
3+
/**
4+
* - `/help` - Get list of commands available
5+
* - `/help <command>` - Get command-specific help message
6+
*/
7+
export const help: TODO = null;

src/commands/handlers/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export * as channel from './channel';
2+
export * as help from './help';
3+
export * as operator from './operator';
4+
export * as settings from './settings';
5+
export * as user from './user';

src/commands/handlers/operator.ts

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import type { TODO } from '#models';
2+
3+
/**
4+
* Ban user from channel(s).
5+
* `/ban <channel> <username> [reason]`
6+
* `/ban * <username> [reason]`
7+
*/
8+
export const ban: TODO = null;
9+
/**
10+
* Unban user from channel(s).
11+
* `/unban <channel> <username>`
12+
* `/unban * <username>`
13+
*/
14+
export const unban: TODO = null;
15+
/**
16+
* Quiet user from channel(s).
17+
* `/quiet <channel> <username>`
18+
* `/quiet * <username>`
19+
*/
20+
export const quiet: TODO = null;
21+
/**
22+
* Unquiet user from channel(s).
23+
* `/unquiet <channel> <username>`
24+
* `/unquiet * <username>`
25+
*/
26+
export const unquiet: TODO = null;
27+
/**
28+
* Send notice to channel(s).
29+
* `/notice <channel> <message>`
30+
* `/notice * <message>`
31+
*/
32+
export const notice: TODO = null;
33+
/**
34+
* Ban hostmask (form: `user!nick@host`).
35+
* `/banmask <channel> <mask>`
36+
*/
37+
export const banmask: TODO = null;
38+
/**
39+
* Unban hostmask.
40+
* `/unbanmask <channel> <mask>`
41+
*/
42+
export const unbanmask: TODO = null;
43+
/**
44+
* Get username by nick.
45+
* `/user <nick>`
46+
*/
47+
export const user: TODO = null;
48+
/**
49+
* Get nicks by username.
50+
* `/nicks <username>`
51+
*/
52+
export const nicks: TODO = null;
53+
/**
54+
* Kick user from channel(s).
55+
* `/kick <channel> <username> [reason]`
56+
*/
57+
export const kick: TODO = null;
58+
/**
59+
* Get list of bans
60+
* `/banlist`
61+
*/
62+
export const banlist: TODO = null;
63+
/**
64+
* Change your nickname.
65+
* `/changenick <newNick>`
66+
*/
67+
export const changenick: TODO = null;
68+
/**
69+
* Allow operator to send a RAW command through the websocket.
70+
* `/execute <line>`
71+
*/
72+
export const execute: TODO = null;

src/commands/handlers/settings.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import type { TODO } from '#models';
2+
3+
/**
4+
* Change custom emoticon slot.
5+
* `/emoticon <slot#> <emoticon>`
6+
*/
7+
export const emoticon: TODO = null;
8+
/**
9+
* Get list of custom emoticons.
10+
* `/emoticon-list`
11+
*/
12+
export const emoticonList: TODO = null;
13+
/**
14+
* Change notification indicator that appears in page title.
15+
* `/indicator <indicator>`
16+
*/
17+
export const indicator: TODO = null;
18+
/**
19+
* Update font size.
20+
* `/size <newFontSize>`
21+
* Aliases: `/textsize`, `/fontsize`
22+
*/
23+
export const size: TODO = null;
24+
/**
25+
* View/update notification keywords.
26+
* - `/keywords`
27+
* - `/keywords add <keywords>`
28+
* - `/keywords remove <keywords>`
29+
*/
30+
export const keywords: TODO = null;
31+
/**
32+
* - `/notifications`
33+
* - `/notifications enable <channel>`
34+
* - `/notifications disable <channel>`
35+
*/
36+
export const notifications: TODO = null;
37+
/**
38+
* Updates username color.
39+
* - `/color <hexColor>`
40+
* - `/color <r>, <g>, <b>`
41+
* - `/color <namedColor>`
42+
*/
43+
export const color: TODO = null;
44+
/**
45+
* Toggle chat feature.
46+
* `/toolbar enable <chatFeature>`
47+
* `/toolbar disable <chatFeature>`
48+
*/
49+
export const toolbar: TODO = null;

src/commands/handlers/user.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import type { TODO } from '#models';
2+
3+
/**
4+
* Post message as an action.
5+
* `/me <message>`
6+
*/
7+
export const me: TODO = null;
8+
/**
9+
* Hide messages from a user.
10+
* `/ignore <username>`
11+
*/
12+
export const ignore: TODO = null;
13+
/**
14+
* Show currently ignored users.
15+
* `/ignore-list`
16+
*/
17+
export const ignoreList: TODO = null;
18+
/**
19+
* Show messages from user.
20+
*/
21+
export const unignore: TODO = null;
22+
/**
23+
* Disconnect from chat.
24+
* `/disconnect`
25+
*/
26+
export const disconnect: TODO = null;
27+
/**
28+
* Set self as away.
29+
*
30+
* `/away <reason>`
31+
* If `<reason>` is not given, the default away message is provided instead.
32+
*/
33+
export const away: TODO = null;
34+
/**
35+
* Set self as back.
36+
*
37+
* `/unaway`
38+
*/
39+
export const unaway: TODO = null;

src/commands/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import log from 'loglevel';
2+
import * as Handlers from './handlers';
3+
4+
log.debug(Handlers);

src/models/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ export * from './ban-status';
33
export * from './channel';
44
export * from './connection-status';
55
export * from './message';
6+
export * from './todo';
67
export * from './user';

src/models/todo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export type TODO<T = unknown> = T;

0 commit comments

Comments
 (0)