Skip to content

Commit 6bd7374

Browse files
feat(api): announcement controller
1 parent e87eba0 commit 6bd7374

File tree

2 files changed

+114
-96
lines changed

2 files changed

+114
-96
lines changed

.vscode/settings.json

Lines changed: 97 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,97 @@
1-
{
2-
"editor.formatOnSave": true,
3-
"editor.codeActionsOnSave": {
4-
"source.organizeImports": "explicit",
5-
"source.fixAll": "explicit"
6-
},
7-
"typescript.tsdk": "node_modules/typescript/lib",
8-
"window.commandCenter": true,
9-
"workbench.experimental.share.enabled": true,
10-
"C_Cpp.files.exclude": {
11-
"extensions/**": true,
12-
"build/**": true,
13-
"src/**": true,
14-
"tmp/**": true,
15-
"tests/**": true,
16-
"node_modules/**": true
17-
},
18-
"cSpell.words": [
19-
"afks",
20-
"antijoin",
21-
"antispam",
22-
"automod",
23-
"automoderation",
24-
"bannable",
25-
"bitfield",
26-
"blazebuild",
27-
"blazew",
28-
"Bootable",
29-
"botinfo",
30-
"Buildable",
31-
"commitlint",
32-
"cooldown",
33-
"crosspostable",
34-
"datetime",
35-
"deepmerge",
36-
"dmhistory",
37-
"dminfs",
38-
"editmsg",
39-
"kickable",
40-
"manageafks",
41-
"MASSBAN",
42-
"MASSKICK",
43-
"Memoizable",
44-
"moderatable",
45-
"moderatormessage",
46-
"moderatorstat",
47-
"moderatorstats",
48-
"modmsg",
49-
"modstats",
50-
"nsfwjs",
51-
"oclif",
52-
"openai",
53-
"Rakin",
54-
"ratelimiter",
55-
"ratelimiting",
56-
"resolvables",
57-
"RESTJSON",
58-
"rmrf",
59-
"sendhistory",
60-
"SOFTBAN",
61-
"softbanned",
62-
"Stringable",
63-
"subkey",
64-
"sudobot",
65-
"Sweeped",
66-
"tesseract",
67-
"tfjs",
68-
"Timeframe",
69-
"tsbuildinfo",
70-
"Unban",
71-
"Unbans",
72-
"undici",
73-
"Unmutes"
74-
],
75-
"material-icon-theme.folders.associations": {
76-
"automod": "Server",
77-
"framework": "Lib",
78-
"policies": "Controller",
79-
"permissions": "Resolver",
80-
"build_src": "Tools",
81-
"polyfills": "Interface",
82-
"arguments": "Messages",
83-
"blazebuild": "Project"
84-
},
85-
"typescript.preferences.importModuleSpecifier": "non-relative",
86-
"eslint.experimental.useFlatConfig": true,
87-
"editor.inlayHints.enabled": "on",
88-
"typescript.inlayHints.enumMemberValues.enabled": true,
89-
"typescript.inlayHints.parameterNames.enabled": "all",
90-
"typescript.inlayHints.functionLikeReturnTypes.enabled": true,
91-
"typescript.inlayHints.parameterNames.suppressWhenArgumentMatchesName": true,
92-
"typescript.inlayHints.parameterTypes.enabled": true,
93-
"typescript.inlayHints.variableTypes.enabled": true,
94-
"typescript.inlayHints.propertyDeclarationTypes.enabled": true,
95-
"typescript.inlayHints.variableTypes.suppressWhenTypeMatchesName": true,
96-
}
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.codeActionsOnSave": {
4+
"source.organizeImports": "explicit",
5+
"source.fixAll": "explicit"
6+
},
7+
"typescript.tsdk": "node_modules/typescript/lib",
8+
"window.commandCenter": true,
9+
"workbench.experimental.share.enabled": true,
10+
"C_Cpp.files.exclude": {
11+
"extensions/**": true,
12+
"build/**": true,
13+
"src/**": true,
14+
"tmp/**": true,
15+
"tests/**": true,
16+
"node_modules/**": true
17+
},
18+
"cSpell.words": [
19+
"afks",
20+
"antijoin",
21+
"antispam",
22+
"automod",
23+
"automoderation",
24+
"bannable",
25+
"bitfield",
26+
"blazebuild",
27+
"blazew",
28+
"Bootable",
29+
"botinfo",
30+
"Buildable",
31+
"commitlint",
32+
"cooldown",
33+
"crosspostable",
34+
"datetime",
35+
"deepmerge",
36+
"dmhistory",
37+
"dminfs",
38+
"editmsg",
39+
"kickable",
40+
"manageafks",
41+
"MASSBAN",
42+
"MASSKICK",
43+
"Memoizable",
44+
"moderatable",
45+
"moderatormessage",
46+
"moderatorstat",
47+
"moderatorstats",
48+
"modmsg",
49+
"modstats",
50+
"nsfwjs",
51+
"oclif",
52+
"openai",
53+
"Rakin",
54+
"rakinar",
55+
"ratelimiter",
56+
"ratelimiting",
57+
"resolvables",
58+
"RESTJSON",
59+
"rmrf",
60+
"sendhistory",
61+
"SOFTBAN",
62+
"softbanned",
63+
"Stringable",
64+
"subkey",
65+
"sudobot",
66+
"Sweeped",
67+
"tesseract",
68+
"tfjs",
69+
"Timeframe",
70+
"tsbuildinfo",
71+
"Unban",
72+
"Unbans",
73+
"undici",
74+
"Unmutes"
75+
],
76+
"material-icon-theme.folders.associations": {
77+
"automod": "Server",
78+
"framework": "Lib",
79+
"policies": "Controller",
80+
"permissions": "Resolver",
81+
"build_src": "Tools",
82+
"polyfills": "Interface",
83+
"arguments": "Messages",
84+
"blazebuild": "Project"
85+
},
86+
"typescript.preferences.importModuleSpecifier": "non-relative",
87+
"eslint.experimental.useFlatConfig": true,
88+
"editor.inlayHints.enabled": "on",
89+
"typescript.inlayHints.enumMemberValues.enabled": true,
90+
"typescript.inlayHints.parameterNames.enabled": "all",
91+
"typescript.inlayHints.functionLikeReturnTypes.enabled": true,
92+
"typescript.inlayHints.parameterNames.suppressWhenArgumentMatchesName": true,
93+
"typescript.inlayHints.parameterTypes.enabled": true,
94+
"typescript.inlayHints.variableTypes.enabled": true,
95+
"typescript.inlayHints.propertyDeclarationTypes.enabled": true,
96+
"typescript.inlayHints.variableTypes.suppressWhenTypeMatchesName": true
97+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Action } from "@framework/api/decorators/Action";
2+
import Controller from "@framework/api/http/Controller";
3+
4+
class AnnouncementController extends Controller {
5+
@Action("GET", "/announcements/latest")
6+
public async getLatest() {
7+
return {
8+
title: "Announcement",
9+
content:
10+
"We're here to announce that SudoBot 9.x \"Chocolate Cake\" is now available! 🎉🍰🎉\n\nThis release adds a bunch of new features, and performance fixes. We're open to any questions or suggestions as always, feel free to contact us anytime! We hope you have a great day.",
11+
from: "rakinar2",
12+
timestamp: 1715616799882
13+
};
14+
}
15+
}
16+
17+
export default AnnouncementController;

0 commit comments

Comments
 (0)