The online racing simulator
How to sent message from LFSLapper to Discord.
(6 posts, started )
How to sent message from LFSLapper to Discord.
I want to show lfs server messages in Discord, how can I do it? can you help me?
First you have to connect to your Discord bot.

Open Myinc.LPR file in the includes folder.


<?php 
#####DISCORD VARIABLES#####
$DiscordToken "";
$DiscordChannelReceive ""#discordchannel to sent commands to LFSLapper. (Rightclick on the channel and click 'Copy ID')
$DiscordBotStatus "Powered by LFSLapper";
?>

Once your LFSLapper is connected to your DiscordBot .Check the console for the next message: DiscordBot Connected

Open LFSLapper.LPR and look for the next event: Event OnMSO
And create a new command like shown below.

The function to send messages from LFSLapper to Discord can be done with:

sendmessagetodiscord($DiscordChannel,$Message);


<?php 
Event OnMSO
$userName$text # Player event
    
$idxOfFirtsSpace indexOf$text" ");

    IF( 
$idxOfFirtsSpace == -THEN
      $command 
$text;
      
$argv "";
    ELSE
      
$command subStr$text,0,$idxOfFirtsSpace );
      
$argv trimsubStr$text,$idxOfFirtsSpace ) );
    ENDIF
    
    SWITCH( 
$command )
         CASE 
"!message":
              
$Message $argv;
              
$DiscordChannel "";
              
sendmessagetodiscord($DiscordChannel,$Message);
         BREAK;    
    ENDSWITCH
EndEvent
?>


-
(EfsaneTosun) DELETED by Yisc[NL] : Cracking has nothing to do with LFSLapper
Thanks for your answer but I put the code in "Lapper.lpr" file, bot connection failed.
Show us some pictures of the error and the code.
Is your discord token right?
token correct code incorrect

How to sent message from LFSLapper to Discord.
(6 posts, started )
FGED GREDG RDFGDR GSFDG