Giter Site home page Giter Site logo

poodlechat's Introduction

PoodleChat

PoodleChat screenshot

Chat resource used on the Poodle's Palace FiveM and RedM servers:

Based on the following resources:

Dependencies

Features

  • Text chat is proximity by default
  • /global or /g to send a message to all players
  • /whisper or /w to send a private message
  • /staff channel based on an ace
  • Optionally sends events and global messages to a Discord channel via a webhook
  • Optionally displays messages from a Discord channel in-game
  • Optionally send player reports to a Discord channel
  • Configurable roles based on aces
  • Configurable emoji shortcuts (:heart:, :smile:, and so on) and emoji selector

Configuration

General

The following variables in shared/config.lua control general settings for the chat:

Variable Description
Config.ActionColor The colour for action messages (/me).
Config.DefaultLocalColor The default colour for local messages.
Config.DefaultGlobalColor The default colour for global messages.
Config.DefaultStaffColor The default colour for staff messages.
Config.WhisperColor The colour for received whisper messages.
Config.WhisperEchoColor The colour for sent whisper messages.
Config.ActionDistance The distance between players at which actions will be visible.
Config.LocalMessageDistance The distance between players at which local messages will be visible.

Discord

The following variables in server/config.lua control the Discord integration:

Variable Description
ServerConfig.DiscordWebhookId The webhook ID to use to send messages to a channel.
ServerConfig.DiscordWebhookToken The webhook token to use to send messages to a channel.
ServerConfig.DiscordName The name to use when sending event messages (joins/disconnects).
ServerConfig.DiscordAvatar The avatar to use when sending event messages or if no avatar is found for a player.
ServerConfig.DiscordBotToken A Discord bot token to use in order to get messages and player avatars.
ServerConfig.DiscordChannel A Discord channel to echo messages in-game from.
ServerConfig.DiscordColor The colour for messages from Discord.
ServerConfig.DiscordReportWebhook A Discord webhook to send player reports to.
ServerConfig.DiscordReportColor Colour used for the report message embed on Discord.
ServerConfig.DiscordReportFeedbackSuccessMessage Message sent to players upon successfully submitting a report.
ServerConfig.DiscordReportFeedbackFailureMessage Message sent to players if a report fails to be submitted.
ServerConfig.DiscordReportFeedbackColor Colour for the above feedback message.
ServerConfig.DiscordRateLimit Time in milliseconds between any two Discord requests.
ServerConfig.SteamKey A Steam key to use in order to retrieve avatars from Steam.

All of these are optional, and can be left with their default value (empty string, '') to disable the Discord integration.

  • For sending in-game messages to Discord, at minimum ServerConfig.DiscordWebhookId and ServerConfig.DiscordWebhookToken must be set.
  • For receiving messages from Discord and displaying them in-game, at minimum ServerConfig.DiscordBotToken and ServerConfig.DiscordChannel must be set.

The ID and token of a Discord webhook can be found from the URL: https://discord.com/api/webhooks/<id>/<token>

Staff channel

The ServerConfig.StaffChannelAce variable in server/config.lua defines the ace that determines which players can access the Staff channel. By default, it is chat.staffChannel.

If you add/remove the ace for players while the server is running, you must run poodlechat_refresh_perms or restart the resource to apply the changes.

Roles

Roles are labels that appear next to a player's name in chat, such as "Admin" or "Moderator". Each role is associated with an ace, so that any players with that ace will receive that role. Optionally, each role can be given a colour that overrides the default local and global chat colours for names.

The list of available roles is configured in server/config.lua.

Example:

Config.Roles = {
    {name = 'Admin', ace = 'chat.admin'},
    {name = 'Moderator', color = {0, 255, 0}, ace = 'chat.moderator'}
}

In server.cfg:

add_ace group.admin chat.admin allow
add_ace group.moderator chat.moderator allow

Execute commands from Discord

To enable executing commands from the Discord channel, you must:

  1. Add principals for the Discord IDs of all Discord users that can execute commands.

  2. Grant those principals the ace defined in ServerConfig.ExecuteCommandsAce.

  3. Grant the poodlechat resource any aces needed to execute the desired commands.

Example:

# Add Discord users as moderators
add_principal identifier.discord:123456789 group.moderator
add_principal identifier.discord:987654321 group.moderator

# Allow moderators to execute commands from Discord
add_ace group.moderator chat.executeCommands

# Specify which commands can be used from Discord
add_ace resource.poodlechat command.kick allow
add_ace resource.poodlechat command.ban allow

You will then be able to prefix messages with ! in the channel specified in ServerConfig.DiscordChannel to have them executed as commands on the server:

!kick "Some Player" "Get outta here!"

The following variables in server/config.lua control aspects of executing commands from Discord:

Variable Description
ServerConfig.ExecuteCommandsAce The ace that allows executing commands from Discord.
ServerConfig.ChatCommandPrefix The prefix used in Discord chat to execute a command.
ServerConfig.DeleteChatCommands Whether to automatically delete chat commands from the Discord channel.

Emoji

Shortcuts for emoji can be configured in shared/emoji.lua.

Commands

/clear

Clears the chat window history.

/global [message]
/g [message]

Sends a message to all players in the server.

/me [action]

Sends a message to nearby players in the form of [name] [action].

/mute [player]

Mutes a player, hiding their messages in text chat.

/muted

Show a list of muted players.

/reply [message]
/r [message]

Sends a message to the last player that sent you a private message (/whisper) or that you sent a private message to.

/report [player] [reason]

If enabled, sends a player report to a specified Discord channel.

/say [message]

Sends a message to nearby players. The default text chat is also overridden to be proximity-based.

/staff [message]

Sends a message to all staff members.

/togglechat

Toggles the chat window on/off.

/unmute

Unmute a player, allowing you to see their messages in text chat again.

/whisper [player] [message]
/w [player] [message]

Sends a private message to a player. [player] can be either an ID number or name.

poodlechat's People

Contributors

kibook avatar taymckenzienz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

poodlechat's Issues

qestion.

hello is it possible to have ONLY the /me message appear over a players head instead of all messages?

it would be much better for RP reasons but it seems its all messages or non right now?

[Suggest]How about adding hide switching function?

Like the latest chat resource that fivem offered.
Users can switch from 3 options of status of chat window
form show all the time to hide all the time, and show when msg received.
I do some copy and paste and do some rewriting, but I'm not familiar with js stuff so I was failed "

Use character name instead of player name for RP

I love this script, but my issue with it is it only shows player IDs instead of character IDs. For roleplay, I think it would be better to show the ID of whatever character from the database is being used. Is there anyway you could implement this? Or maybe show me where in the code I can update it to call the character name instead of player name? Thanks!

Several errors, not exactly sure how to fix this?

SCRIPT ERROR: @poodlechat/server/server.lua:11: No such export vorpAPI in resource vorp_core

Attempt to index a nil value (local 'char')

GetName (@poodlechat/server/server.lua:52)

handler (@poodlechat/server/server.lua:132)

[error] Failed to initialize: 403

Fivem Onesync Infinity Support

Is there any chance to make this chat compatible with OneSync in FiveM? All proximity based text is seen server wide.

Permissions for /nick

Hi, how can i allow players to use /nick command ?
I tried add_ace resource.poodlechat command.nick allow
but seems like it wont work..
Please help

Chat sending message twice

Hi, my poodlechat sending the message once as local/global and another time as normal....message how can i disable it?
Also i would like to have the Feature from the default Chat to be able to switch trough Chat visibility like always on, when active or hiddenchat
Thanks for sharing your awesome resource for free tho!

No server Id

Been trying to dig around in the script but im not too familiar with java, trying to figure out how to get the server ID out of the name like in your screenshot.

resource

Hello, Having a problem with loading the script, in server starter.bat says resource poodlechat couldn't start, Please help thanks

custom emoji and gif support

Could you please look into adding custom emoji/emotes and gif support? but perhaps it would have to be approved by the server owner - so, you can't just send any gif or emote, it would be ones that the server owner has added, however, this resource would need support for it.

An example would be discord emotes that you can post in the discord chat channel, as well as in the server itself.

Both discord and fivem chat resources support discord emotes and gifs.

Example emote: https://emoji.gg/emoji/7529_KEKW

Example gif: https://tenor.com/view/fromjess-lmaoa-tantrums-gif-12954222

Love your work by the way, keep it up :)

Redemrp

Not supported on Redemrp ?

Extended character selection load time - FiveM

I'm using FiveM with QBcore and the character selection load time is about 30 seconds since FiveM last updated a week or two ago. If I don't have poodlechat running and just use the standard chat system, character selection screen takes about 3 seconds to show after loading into the server.

issue with names causing issues

hey. ive searched for hours to find the same chat box that you currently offer for (REDM VORP)

however im getting an error as it seems this is outdated.

the following error is what im getting from the server/server.lua:52 which is trying to pull the charters name and is causing an error.
vorp

this is the line 52 in the code
vorp 2

can you please please help me fix this as VORP will not offer any support at all to fix this.

Console command 'say' not working

Whenever I do /say in console and type a message then the only thing that shows up in game is just the name console but no message.

Toggle Overhead Display

Can you please add something in the ReadMe regarding overhead display? People have been asking me recently about this resource and were thinking perhaps I was using a private version.

Also, possibly you could add screenshots?

Thanks ๐Ÿ™‚

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.