© 2026 Hedgehog Software, LLC
import { ApplyOptions } from '@sapphire/decorators'; import { Route, methods, type ApiRequest, type ApiResponse } from '@sapphire/plugin-api'; @ApplyOptions<Route.Options>({ route: 'hello-world' }) export class UserRoute extends Route { public override [methods.GET](_request: ApiRequest, response: ApiResponse) { response.json({ message: 'Hello World' }); } public override [methods.POST](_request: ApiRequest, response: ApiResponse) { response.json({ message: 'Hello World' }); } }
[{ “resource": ‘/E:/Test/dev_bot/src/routes/hello-world.ts’, “owner": ‘typescript’, “code": ‘2305’, “severity": 8, “message“: ‘The module ’\”@sapphire/plugin-api\“‘ has no exported member ’methods'.”, “source": ‘ts’, “startLineNumber": 2, “startColumn": 17, “endLineNumber": 2, “endColumn": 24 },{ “resource": ‘/E:/Test/dev_bot/src/routes/hello-world.ts’, “owner": ‘typescript’, “code": ‘2515’, “severity": 8, “message“: ‘The non-abstract class ’UserRoute” does not implement the abstract member “run” inherited from the class “Route<RouteOptions>”.”, “source": ‘ts’, “startLineNumber": 5, “startColumn": 14, “endLineNumber": 5, “endColumn": 23 }]
@sapphire/plugin-api@v7
Join the Discord to ask follow-up questions and connect with the community
Sapphire is a next-gen object-oriented Discord.js bot framework.
2,286 Members