Skip to content

Commit 32d3622

Browse files
committed
Big changes
- Change from beta to stable domain - Insert reminders into cache when creating - Increase shards per cluster - Update redis - Add description to slash command parents - Change memory usage calculation
1 parent 5f1bb58 commit 32d3622

File tree

32 files changed

+407
-307
lines changed

32 files changed

+407
-307
lines changed

package-lock.json

Lines changed: 278 additions & 235 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
"lib/**/*"
99
],
1010
"dependencies": {
11-
"@sentry/node": "^6.4.1",
11+
"@sentry/node": "^6.19.7",
1212
"chrono-node": "^2.3.8",
13-
"detritus-client": "^0.17.0-beta.12",
14-
"emoji-aware": "^3.0.5",
13+
"detritus-client": "^0.17.0-beta.14",
14+
"emoji-aware": "^3.1.0",
1515
"juration": "^0.1.1",
16-
"moment": "^2.29.1",
16+
"moment": "^2.29.3",
1717
"moment-duration-format": "^2.3.2",
18-
"moment-timezone": "^0.5.32",
19-
"redis": "^3.1.2",
20-
"typescript": "^4.6.4"
18+
"moment-timezone": "^0.5.34",
19+
"redis": "^4.1.0",
20+
"typescript": "^4.7.2"
2121
},
2222
"devDependencies": {
23-
"@types/moment-duration-format": "^2.2.2",
24-
"@types/node": "^17.0.27",
25-
"@types/redis": "^2.8.28"
23+
"@types/moment-duration-format": "^2.2.3",
24+
"@types/node": "^17.0.35",
25+
"@types/redis": "^4.0.11"
2626
},
2727
"scripts": {
2828
"build": "tsc",

src/api/endpoints.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export enum Domains {
99
}
1010

1111
export const Api = Object.freeze({
12-
URL: Domains.BETA,
13-
URL_PUBLIC: Domains.BETA,
12+
URL: Domains.STABLE,
13+
URL_PUBLIC: Domains.STABLE,
1414
PATH: '/api',
1515

1616
AUDIO_TOOLS_CONVERT:

src/api/raw.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,18 @@ export interface RequestContext {
2424
user?: Structures.User,
2525
}
2626

27+
28+
const HOST = Api.URL_PUBLIC.split('/').pop()!;
29+
2730
export async function request(
2831
context: RequestContext,
2932
options: RequestTypes.Options,
3033
): Promise<any> {
3134
options.url = Api.URL + Api.PATH;
3235
options.headers = createHeaders(options.headers);
3336

34-
if (Api.URL === Domains.LOCALHOST) {
35-
options.headers.set('host', 'beta.notsobot.com');
37+
if ((Api.URL as string) === (Domains.LOCALHOST as string)) {
38+
options.headers.set('host', HOST);
3639
}
3740

3841
const token = process.env.NOTSOBOT_API_TOKEN;

src/api/structures/basestructure.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { NotSoBotKeys } from '../../constants';
66

77
export function convertKey(snake: string): string {
88
if (snake in NotSoBotKeys) {
9-
return NotSoBotKeys[snake];
9+
return (NotSoBotKeys as any)[snake];
1010
}
1111
return toCamelCase(snake);
1212
}

src/bot.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ const cluster = new ClusterClient('', {
4343
} else {
4444
process.title = `S:(${cluster.shardStart}-${cluster.shardEnd})`;
4545
}
46-
connectAllListeners(cluster);
47-
connectAllStores(cluster);
4846

4947
cluster.on(ClientEvents.REST_RESPONSE, async ({response, restRequest, shard}) => {
5048
const route = response.request.route;
@@ -106,6 +104,10 @@ const cluster = new ClusterClient('', {
106104

107105
try {
108106
await cluster.run();
107+
108+
connectAllListeners(cluster);
109+
connectAllStores(cluster);
110+
109111
console.log('cluster ran', cluster.ran);
110112
const shardsText = `Shards #(${cluster.shards.map((shard: ShardClient) => shard.shardId).join(', ')})`;
111113
console.log(`${shardsText} - Loaded`);

src/commands/interactions/basecommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export class BaseInteractionImageCommandOption<ParsedArgsFinished = Interaction.
334334
...data,
335335
options: [
336336
...(data.options || []),
337-
{name: 'image', description: 'Emoji/Image URL/User', label: 'url', default: DefaultParameters.lastMediaUrl({audio: false, video: false}), value: Parameters.lastMediaUrl({audio: false, video: false})},
337+
{name: 'url', description: 'Emoji/Image URL/User', default: DefaultParameters.lastMediaUrl({audio: false, video: false}), value: Parameters.lastMediaUrl({audio: false, video: false})},
338338
{name: 'file', description: 'Image File', type: ApplicationCommandOptionTypes.ATTACHMENT},
339339
],
340340
});
@@ -364,7 +364,7 @@ export class BaseInteractionVideoCommandOption<ParsedArgsFinished = Interaction.
364364
...data,
365365
options: [
366366
...(data.options || []),
367-
{name: 'video', description: 'Emoji/Media URL/User', label: 'url', default: DefaultParameters.lastMediaUrl({audio: false, image: false}), value: Parameters.lastMediaUrl({audio: false, image: false})},
367+
{name: 'url', description: 'Emoji/Media URL/User', default: DefaultParameters.lastMediaUrl({audio: false, image: false}), value: Parameters.lastMediaUrl({audio: false, image: false})},
368368
{name: 'file', description: 'Video File', type: ApplicationCommandOptionTypes.ATTACHMENT},
369369
],
370370
});

src/commands/interactions/slash/audio/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { AudioIdentifyCommand } from './identify';
77

88

99
export default class AudioGroupCommand extends BaseSlashCommand {
10-
description = '.';
10+
description = 'Audio-Related Commands';
1111
name = 'a';
1212

1313
constructor() {

src/commands/interactions/slash/fun/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { BadMemeCommand } from './badmeme';
66

77

88
export default class FunGroupCommand extends BaseSlashCommand {
9-
description = '.';
9+
description = 'Fun Commands';
1010
name = 'fun';
1111

1212
constructor() {

src/commands/interactions/slash/help.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ export default class HelpCommand extends BaseSlashCommand {
1212
name = COMMAND_NAME;
1313

1414
run(context: Interaction.InteractionContext) {
15-
return editOrReply(context, 'This is our rewrite bot. <https://beta.notsobot.com/commands> (Join our support server <https://beta.notsobot.com/support/invite>)');
15+
return editOrReply(context, '<https://notsobot.com/commands> (Join our support server <https://notsobot.com/support/invite>)');
1616
}
1717
}

0 commit comments

Comments
 (0)