make discord relay optional
This commit is contained in:
parent
8af6d44e68
commit
bd2e7b5b43
@ -5,9 +5,13 @@
|
|||||||
* Purpose: commands that can be used on the discord channel
|
* Purpose: commands that can be used on the discord channel
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* ** Error Checking ** */
|
||||||
|
#if defined DISCORD_DISABLED
|
||||||
|
#endinput
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ** Includes ** */
|
/* ** Includes ** */
|
||||||
#include < YSI\y_hooks >
|
#include < YSI\y_hooks >
|
||||||
#include < discord-command >
|
|
||||||
|
|
||||||
/* ** Commands ** */
|
/* ** Commands ** */
|
||||||
DISCORD:commands( DCC_Channel: channel, DCC_User: author, params[ ] )
|
DISCORD:commands( DCC_Channel: channel, DCC_User: author, params[ ] )
|
||||||
|
@ -5,11 +5,24 @@
|
|||||||
* Purpose: discord implementation in-game
|
* Purpose: discord implementation in-game
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* ** Enable or disable discord ** */
|
||||||
// #define DISCORD_DISABLED // !!!! DISABLED BY DEFAULT !!!!
|
// #define DISCORD_DISABLED // !!!! DISABLED BY DEFAULT !!!!
|
||||||
|
|
||||||
/* ** Includes ** */
|
/* ** Includes ** */
|
||||||
#include < YSI\y_hooks >
|
#include < YSI\y_hooks >
|
||||||
#include < discord-connector >
|
#tryinclude < discord-connector >
|
||||||
|
#tryinclude < discord-command >
|
||||||
|
|
||||||
|
/* ** Disable if discord connector not enabled ** */
|
||||||
|
#if !defined dcconnector_included && !defined DISCORD_DISABLED
|
||||||
|
#warning "Discord is disabled as the connector is not found. (https://github.com/maddinat0r/samp-discord-connector)"
|
||||||
|
#define DISCORD_DISABLED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined _discordcmd_included && !defined DISCORD_DISABLED
|
||||||
|
#warning "Discord is disabled as the command handler is not found. (https://github.com/AliLogic/discord-command)"
|
||||||
|
#define DISCORD_DISABLED
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ** Definitions ** */
|
/* ** Definitions ** */
|
||||||
/* Guild */
|
/* Guild */
|
||||||
@ -56,23 +69,33 @@ new stock
|
|||||||
DCC_Role: discordRoleMember
|
DCC_Role: discordRoleMember
|
||||||
;
|
;
|
||||||
|
|
||||||
stock DCC_SendChannelMessageFormatted( DCC_Channel: channel, const format[ ], va_args< > ) {
|
|
||||||
return DCC_SendChannelMessage( channel, va_return( format, va_start< 2 > ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ** Error Checking ** */
|
/* ** Error Checking ** */
|
||||||
#if defined DISCORD_DISABLED
|
#if defined DISCORD_DISABLED
|
||||||
stock DCC_SendChannelMessage( DCC_Channel: channel, const message[ ] ) {
|
stock TMP_DCC_SendChannelMessage( DCC_Channel: channel, const message[ ] ) {
|
||||||
#pragma unused channel
|
#pragma unused channel
|
||||||
#pragma unused message
|
#pragma unused message
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined _ALS_DCC_SendChannelMessage
|
||||||
|
#undef DCC_SendChannelMessage
|
||||||
|
#else
|
||||||
|
#define _ALS_DCC_SendChannelMessage
|
||||||
|
#endif
|
||||||
|
#define DCC_SendChannelMessage TMP_DCC_SendChannelMessage
|
||||||
|
|
||||||
stock DCC_SendUserMessage( DCC_User: author, const message[ ] )
|
stock DCC_SendUserMessage( DCC_User: author, const message[ ] )
|
||||||
{
|
{
|
||||||
#pragma unused author
|
#pragma unused author
|
||||||
#pragma unused message
|
#pragma unused message
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stock DCC_SendChannelMessageFormatted( DCC_Channel: channel, const format[ ], va_args< > ) {
|
||||||
|
#pragma unused channel
|
||||||
|
#pragma unused format
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
#endinput
|
#endinput
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -167,3 +190,7 @@ public DCC_OnGuildMemberAdd(DCC_Guild:guild, DCC_User:user)
|
|||||||
DCC_SendUserUsage(user, "Hey there! I am **Stephanie**, i am here to help you out!\nUse **!commands** to see all commands i offer.\nYou need to have **member** role trough to use them, so first verify your account!");
|
DCC_SendUserUsage(user, "Hey there! I am **Stephanie**, i am here to help you out!\nUse **!commands** to see all commands i offer.\nYou need to have **member** role trough to use them, so first verify your account!");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stock DCC_SendChannelMessageFormatted( DCC_Channel: channel, const format[ ], va_args< > ) {
|
||||||
|
return DCC_SendChannelMessage( channel, va_return( format, va_start< 2 > ) );
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user