Skip to content

Commit

Permalink
more stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
auguwu committed Mar 31, 2021
1 parent 129fb51 commit c3239cf
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/CommandClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,22 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

import { Client, WebSocketClientEvents, ClientOptions } from 'wumpcord';

/**
* List of options available for constructing a new [[CommandClient]].
*/
interface CommandClientOptions extends ClientOptions {
commandsDir: string;
eventsDir: string;
}

/**
* List of events that can emit.
*/
interface CommandClientEvents extends WebSocketClientEvents {

}

export default class CommandClient extends Client<CommandClientOptions, CommandClientEvents> {}
21 changes: 21 additions & 0 deletions src/Event.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2021 August, Lio
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
21 changes: 21 additions & 0 deletions src/decorators/EventEmittion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2021 August, Lio
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
21 changes: 21 additions & 0 deletions src/handlers/CommandHandler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2021 August, Lio
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
49 changes: 49 additions & 0 deletions src/internals/MetadataKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,52 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/**
* Internal keys for reflection metadata on decorators.
*/
export const enum MetadataKeys {
/**
* Event emittions keys for `Reflect.getMetadata('$wumpcord::emittions', <target>)`
*
* Expected value:
* ```js
* [
* {
* "event": "<event name>",
* "type": "on/once",
* "handler": Function
* }
* ]
* ```
*/
EventEmittion = '$wumpcord::emittions',

/**
* Subcommand key for `Reflect.getMetadata('$wumpcord::subcommand', <target>)`
*
* Expected value: `SubcommandInfo[]`
*/
Subcommand = '$wumpcord::subcommand',

/**
* Restriction key for `Reflect.getMetadata('$wumpcord::restriction', <target>)`
*
* Expected value: `RestrictionInfo[]`
*/
Restriction = '$wumpcord::restriction',

/**
* Command key for `Reflect.getMetadata('$wumpcord::command', <target>)`
*
* Expected value: `CommandInfo[]`
*/
Command = '$wumpcord::command',

/**
* Job key for `Reflect.getMetadata('$wumpcord::job', <target>)`
*
* Expected value: `JobInfo[]`
*/
Job = '$wumpcord::job'
}

0 comments on commit c3239cf

Please sign in to comment.