-
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.
* Add in percy badge * Percy stuff
- Loading branch information
Showing
5 changed files
with
53 additions
and
6 deletions.
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
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,38 @@ | ||
import { sendReplyToCommand } from '../../sockets'; | ||
import { SocketUser } from '../../types'; | ||
import { Command } from '../types'; | ||
import { sendToDiscordAdmins, sendToDiscordMods } from '../../../clients/discord'; | ||
|
||
export const adiscordmessage: Command = { | ||
command: 'adiscordmessage', | ||
help: '/adiscordmessage <admin|mod> <ping (true|false)> <message>: Sends a discord message to the admin or mod channel.', | ||
run: async (args: string[], socket: SocketUser) => { | ||
|
||
if (args.length < 4) { | ||
sendReplyToCommand(socket, 'Need at least 3 args.'); | ||
return; | ||
} | ||
|
||
const channel = args[1]; | ||
const ping = args[2] === "true"; | ||
const message = args.slice(3).join(' '); | ||
|
||
switch(channel) | ||
{ | ||
case "admin": { | ||
sendToDiscordAdmins(message, ping); | ||
break; | ||
} | ||
case "mod": { | ||
sendToDiscordMods(message, ping); | ||
break; | ||
} | ||
default: { | ||
sendToDiscordAdmins(`Invalid channel. Expected "admin" or "mod", got ${channel}.`); | ||
return; | ||
} | ||
} | ||
|
||
sendReplyToCommand(socket, 'Message sent.'); | ||
}, | ||
}; |
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