[Release] FiveM To Discord

Is it possible to capture the text before the command is run via event?

I don’t know what wizard magic you used to make this but this is totally awesome. Thank you so much.

Nope, afaik it is not possible

Apparently something isn’t working with mine. When I execute the command /ooc or /report with the premade config.lua it does not send it in the Discord. I have added webhooks to the 3 required things at the top for it to work properly, which it does, but commands I add or already added in SpecialCommands do not work. I’ve tried adding these commands in the webhook part and that doesn’t seem to work either.

When will you solve the problem, if the killer does not appear?

–>never tells me about this problem

–>When will you solve the problem, if the killer does not appear?

I am not aware of this “problem”. If you could provide more information, I could figure it out…

I was able to get the RP Chat commands working. It required me to edit the FiveM Chat by adding a server event to send the chat text before command execution to the discord resource. Not a standalone solution for your wonderful script but it works :slight_smile:

Yeah, I already know this but that is no solution, like you said. Also it won’t work if the command gets executed through the F8 Console…

image

Problem is, when one person kill the other, it only appears that someone has died. Not showing who is the killer, follow the print. The killer does not appear

I am using RPChat and it appears to cancel the commands and won’t send them to the Discord. Would this be where I would use the ToDiscord event? If this is the case, could anyone provide me with an example for one of the commands below?

RegisterCommand('me', function(source, args, user)
      local name = GetPlayerName(source)
      TriggerClientEvent("sendProximityMessageMe", -1, source, name, table.concat(args, " "))
      TriggerEvent('DiscordBot:ToDiscord', 'WHICH_CHANNEL', 'NAME', 'MESSAGE', 'IMAGE_URL', true) 
-- not to sure what to put where for the above line 
  end, false)

Thanks!

1 Like

Guess I should’ve did a search in here before hand. Anyway you can share how you fixed that?

Why is this happening? i changed only the webhooks, nothing else

image

hi i want find solution to make send message like this
can you help me please?
the random name is not mandatory, no name is good
using a command / tweet and / dark for example
Capture

@itismejoey

 -- Channels: 'chat' or 'system' or 'kill'

TriggerEvent('DiscordBot:ToDiscord', 'WHICH_CHANNEL', 'NAME', 'MESSAGE', 'IMAGE_URL', true)

For example:
To send a message in the CHAT channel:
The name of the sender: Flatracer
The message: This is the message
The image used as profile picture: https://i.imgur.com/KIcqSYs.png
TriggerEvent('DiscordBot:ToDiscord', 'chat', 'Flatracer', 'This is the message', 'https://i.imgur.com/KIcqSYs.png', true)

@LixeiroCharmoso
Which version are you using?

You just blew my mind that you can feed it an image URL.

Joey, it requires quite a bit of editing to fivem chat and this resource. I wouldn’t release this “fix” without Flatracer’s approval because it isn’t a standalone fix to the resource. If he says ok, ill post the code.

Updated to v1.5.2



  • Re-Done the ToDiscord Event


Also, if you have the problem with some commands not being sent to discord, check the newly added spoiler: (How to) 'Fix' some commands not printing (Not recommended though)

Download in the First Post!

Have a question can you restart the server from discord with this? If you can how?

No, you can’t.


Messages from players are not showing on discord bot, only left/join any fix?

1 Like