[Release] FiveM To Discord

chat
discord
bot

#1

Hey everyone, I made this little Script on request and I know, there are already some, but this is different… (Probably not)

It is a simple Script which sends messages to discord.

Features
  • Prints when a Player…
    – Connects
    – Sends a Message in the Chat
    – Uses a Command in the Chat
    – Kills another Player (With Time)
    – Dies (With Time)
    – Leaves
  • Uses the Steam Profile Picture of a User (if available)
  • How the Player got killed
  • Ability to Blacklist Commands, which won’t be printed in Discord
  • Ability to add Special Commands, which will be printed differently in Discord
  • Ability to specify commands which have their own Webhook link

It is possible to set a Custom Image (Default - User / Default - System) and to change the System Name (Default: SYSTEM)


Preview

205539735f1bb59bd42fac75ad2ec343

434102389b6130a0bce4ae2411f6db70

4e16f7ddaaf97c9e3723867dd88aee6e


DiscordBot [1.5.1].rar (6.6 KB)

VirusTotal Scan


(How to) Add your Webhook

If you want System Infos, Killing Log and Chat in three channels, repeat this for every YOUR_WEBHOOK_HERE.
Otherwise, create just one Webhook and replacer every YOUR_WEBHOOK_HERE with its link.

  1. First of all, create a Discord Webhook, if not already done. Click Here
  2. Copy the link of the Webhook
  3. Open the config.lua
  4. Replace YOUR_WEBHOOK_HEREat
  5. Save & Profit
(How to) Call the Webhook event from another resource

Update 1.5.0 changed the ToDiscord function to an event, which can be called from another resource.

Simply use this:

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

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

The boolean always has to be true, when calling DiscordBot:ToDiscord with the channel names ('chat', 'system' and 'kill')

(How to) Change the System Avatar
  1. Open the config.lua
  2. Replace https://wiki.fivem.net/w/images/d/db/FiveM-Wiki.png at line 3 with your preferred Image
  3. Save & Profit
(How to) Change the User Avatar
  1. Open the config.lua
  2. Replace https://i.imgur.com/KIcqSYs.png at line 5 with your preferred Image
  3. Save & Profit
(How to) Change the System Name
  1. Open the config.lua
  2. Replace SYSTEM at line 7 with your preferred name
  3. Save & Profit
(How to) Specify Special Commands
  1. Open the config.lua
  2. Add (or remove) the Command in the SpecialCommands Table, in the given format
  3. Save & Profit
(How to) Blacklist Commands
  1. Open the config.lua
  2. Add (or remove) the Command in the BlacklistedCommands Table, in the given format
  3. Save & Profit
(How to) Specify Commands which have their own webhook
  1. Open the config.lua
  2. Add (or remove) the Command in the OwnWebhookCommands Table, in the given format
  3. Save & Profit
(How to) Specify TTS Commands
  1. Open the config.lua
  2. Add (or remove) the Command in the TTSCommands Table, in the given format
  3. Save & Profit

Changelog
  • [1.0.0]
    – Initial Release
  • [1.1.0]
    – Added version check
    – Added special commands check
    – Added blacklisted commands check
    – Fixed a bug with the death message
  • [1.2.0]
    – Added ‘How Killed’
    – Changed the look of the Date / Time
  • [1.3.1]
    – Added SystemAvatar
    – Fixed the bug of deaths not printing
  • [1.3.2]
    – Added use of the Steam Profile Picture for User (if available)
  • [1.3.3]
    – Fixed multiple Message print & wrong Image
    – Fixed color code printing (^0, ^1, ^2 etc.)
  • [1.4.0]
    – Added Differentiated channels
    – Added Multiple Webhooks
    – Added a config.lua
    – Added an Instant Update Function
  • [1.4.1]
    – Hotfix
  • [1.4.2]
    – Hotfix - # 2
  • [1.4.3]
    – Fixed Chat not working for some Player [Thanks to @jellyton69 ]
  • [1.4.4]
    – Fixed Steam Profile Picture Issue
  • [1.5.0]
    – Added the option to specify commands which have their own webhook link
    – Changed the ‘ToDiscord’ function to an event (Can be called from other resources now)
  • [1.5.1]
    – Fixed wrong death - message when killed with a vehicle
    – Added the option to specify command which will be sent as TTS messages
    – Removed the instant update function (May add it in the future again)
To Do
  • Print Commands, which got registered with this native
Older Downloads

DiscordBot [1.0.0].rar (1.9 KB) | VirusTotal Scan

DiscordBot [1.1.0].rar (3.1 KB) | VirusTotal Scan

DiscordBot [1.2.0].rar (4.6 KB) | VirusTotal Scan

DiscordBot [1.3.1].rar (4.5 KB) | VirusTotal Scan

DiscordBot [1.3.2].rar (4.8 KB) | VirusTotal Scan

DiscordBot [1.3.3].rar (4.8 KB) | VirusTotal Scan

DiscordBot [1.4.0].rar (5.8 KB) | VirusTotal Scan

DiscordBot [1.4.1].rar (5.9 KB) | VirusTotal Scan

DiscordBot [1.4.2].rar (5.9 KB) | VirusTotal Scan

DiscordBot [1.4.3].rar (6.4 KB) | VirusTotal Scan

DiscordBot [1.4.4].rar (6.1 KB) | VirusTotal Scan

DiscordBot [1.5.0].rar (6.4 KB) | VirusTotal Scan


Like! Found a bug? Any suggestion? Feel free to comment below!


Killing log for Discord
Killing log for Discord
#2

Love the script… it may be another discord bot, but this one is better then the other it has more to it. keep it up :slight_smile:


#3

Thank you for your feedback, also if you got any suggestions, just tell me :blush:


#4

Really cool with the time! Didn’t think of that :thinking:


#5

Finally! This is actually a really nice script, and my server happens to use the discord bot quite frequently.

A few suggestions for future updates.

  • The ability to blacklist/hide certain commands from appearing in the discord channel. (Ex. /fix, /revive, special commands that should only be known by certain people.)

  • The ability to specify “special” commands. For example, when you type in /ooc , have it output to discord as. OOC: I like snails. RATHER than /ooc I like snails.

example4discord < Example 1
example4discord2 < Example 2


#6

I love This Script!!


#7

Is there not a way to send discord chat ingame?


#8

That is not possible afaik

I am working on it :wink:


#9

Works well, and great made. Love it!


#10

Oh, it’s possible alright.
Look into http://runtime.fivem.net/doc/reference.html#_0xf5c6330c


#11

If you don’t mind, how did you do this?


#12

Do you want it to show the Caller ID too?

Also, what is that number after the name? Server or Client ID?


#13

Yes, caller ID too, that is the server ID. The one that is displayed on the scoreboard.


#14

Updated to v1.1.0



  • Added version check
  • Added special commands check
  • Added blacklisted commands check
  • Fixed a bug with the death message



13c812b26ecd8c824148b5597f7daa58



Download in the First Post!


#15

:heart_eyes:

(Gotta love the character limit)


#16

Looks like i have found a bug , or im plain stupid


It does not show the killing log of who kills who


#17

Hmm, it was working for me :thinking:

0d7844e59086d8fb30ebbe9f6ff2ff03


#18

Hmmm, that seems weird , me and a friend went on a killing spree for the test , it shows me the suicides but not the actual kill log for some reason. Do you think clearing server cache would help fix this problem?

Or is there an option in the script you need to set to true for it to work?
Thanks in advance!


#19

There is no toggle. You could try clearing the cache.


#20

Updated to v1.2.0



  • Added ‘How Killed’
  • Changed the look of the Date / Time


dec9b355623d594e3fba9e0eef9e3a1f



Download in the First Post!