GitHub - AliLogic/discord-command: My own discord command processor alternative, based on iZCMD-like functionality. So good that people started to copy paste mine.
My own discord command processor alternative, based on iZCMD-like code and functionality.
new
DCC_Channel: gCommandChannel
;
public OnGameModeInit() {
gCommandChannel = DCC_FindChannelById("channel-id-here");
}
DISCORD:stats(DCC_Message: message, DCC_User: author, params[]) {
new
DCC_Channel: channel
;
DCC_GetMessageChannel(message, channel);
if (channel != gCommandChannel) {
return 1;
}
new
name[MAX_PLAYER_NAME]
;
if (sscanf(params, "s[24]", name)) {
return DCC_SendChannelMessage(channel, ":warning: You must provide name of the player.");
}
// Do something here
return 1;
}
public OnDiscordCommandPerformed(DCC_Message: message, bool: success) {
if (!success) {
new
DCC_Channel: channel
;
DCC_GetMessageChannel(message, channel);
return DCC_SendChannelMessage(channel, ":x: The command entered doesn't exist.");
}
return 1;
}