-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a test admin command to reset seasons
- Loading branch information
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// TODO-kev: Delete this file. Purely for testing purposes | ||
|
||
import { Command } from '../types'; | ||
import { SocketUser } from '../../types'; | ||
import seasonAdapter from '../../../databaseAdapters/season'; | ||
import { sendReplyToCommand } from '../../sockets'; | ||
|
||
export const aresetseason: Command = { | ||
command: 'ars', | ||
help: '/ars: Reset season.', | ||
run: async (args: string[], socket: SocketUser) => { | ||
if (args.length != 2) { | ||
sendReplyToCommand(socket, 'Please include the season name.'); | ||
return; | ||
} | ||
|
||
const seasonName = args[1]; | ||
|
||
try { | ||
await seasonAdapter.resetSeason(seasonName); | ||
sendReplyToCommand(socket, 'Successfully reset season.'); | ||
} catch (error) { | ||
sendReplyToCommand(socket, error.message); | ||
return; | ||
} | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters