Replies: 11 comments 15 replies
-
A plugin that allows for dynamic filtering & highlighting of messages. This can be more extensible than we currently allow in Chatterino, applying your own logic and storing previous messages from the specific user etc |
Beta Was this translation helpful? Give feedback.
-
summarizing some of the previous ideas: #4885 - add buttons to profile card that can open web links #4449 - read message (tags) and play sound #2091 - replace message content (or add message) #4931 - open a websocket & populate some custom split with system messages |
Beta Was this translation helpful? Give feedback.
-
Many of my ideas are related to what I'm missing in Chatterino, because it doesn't use GraphQL. But I think this can be implemented using plugins. Here is my list of ideas:
From the Chatterino API, the following would be required for this:
This is just what recently came to my mind. 🫠 |
Beta Was this translation helpful? Give feedback.
-
Possibly move IRC support to a plugin. We already want to have plugins be able to create messages. For this we also would need for plugins to be able to grab a channel like |
Beta Was this translation helpful? Give feedback.
-
A few plugin ideas:
|
Beta Was this translation helpful? Give feedback.
-
game/title change alerts (e.g., alert me when x streamer switches to y category) |
Beta Was this translation helpful? Give feedback.
-
Chat history for a channel in the plugins channel object would be cool |
Beta Was this translation helpful? Give feedback.
-
API Feature
Channel-specific commands or text/emote replacements. An example of this would be setting a replacement for
Another plugin feature would be a similar feature, except global replacements but this time matching specific [emoteId, emoteName] and replacing it with [emoteIds...] where emoteIds[0] > emotesId[1] > emotesId[2] > etc.
|
Beta Was this translation helpful? Give feedback.
-
QtCreator added a C++ plugin to load Lua plugins (blog article). The source can be found here (permalink). It uses sol3 in C++. It provides the following features (also kinda applicable to Chatterino): Especially for something like GUI, sol3 seems to be easier to use than manually working with the C API of Lua, thus allows more people to contribute. |
Beta Was this translation helpful? Give feedback.
-
Custom completion APIsGoal: I want to create some completion engine, mainly for custom emote completion, but current API has significant limitations
|
Beta Was this translation helpful? Give feedback.
-
#2091 (mentioned in #4999 (comment)) wants to build a chat translator. To do this, plugins need the ability to add rich messages (not just system messages). I'm proposing a minimal API as a start. With this API, plugins can create the same messages as the C++ code. Currently, a few things like links and images are hidden, so only text and linebreaks can be added. Plugins can't introspect or change messages once they're created. These can be future additions. I haven't implemented this in C++ yet. The following should be possible with the proposed API: c2.register_command("/hello-world", function (ctx)
local msg = c2.Message.new({
elements = {
{
type = "text",
text = "Hello,",
color = "#ff0000",
},
{
type = "text",
text = "world",
color = "#00ff00",
trailing_space = false,
},
{
type = "text",
text = "!",
color = "#0000ff",
}
},
id = "my-unique-message",
flags = c2.MessageFlag.System
})
ctx.channel:add_message(msg)
end) Type definitions---@class c2.Message
c2.Message = {}
---@class MessageInit A table to initialize a new message
---@field flags? c2.MessageFlag Message flags (see `c2.MessageFlags`)
---@field id? string The (ideally unique) message ID
---@field parse_time? number Time the message was parsed
---@field search_text? string Text to that is compared when searching for messages
---@field message_text? string The message text (used for filters for example)
---@field login_name? string The login name of the sender
---@field display_name? string The display name of the sender
---@field localized_name? string The localized name of the sender (this is used for CJK names, otherwise it's empty)
---@field username_color? string The color of the username
---@field server_received_time? number The time the server received the message
---@field highlight_color? string|nil The color of the highlight (if any)
---@field elements MessageElementInit[] The elements of the message
---@class MessageElementInitBase A base table to initialize a new message element
---@field flags? c2.MessageElementFlag Message element flags (see `c2.MessageElementFlags`)
---@field tooltip? string Tooltip text
---@field trailing_space? boolean Whether to add a trailing space after the element (default: true)
---@alias MessageColor "text"|"system"|string A color for a text element - "text" and "system" are special values that take the current theme into account
---@class (exact) TextElementInit : MessageElementInitBase A table to initialize a new message text element
---@field type "text" The type of the element
---@field text string The text of this element
---@field color? MessageColor The color of the text
---@field font_style? c2.FontStyle The font style of the text
---@class (exact) SingleLineTextElementInit : MessageElementInitBase A table to initialize a new message single-line text element
---@field type "single-line-text" The type of the element
---@field text string The text of this element
---@field color? MessageColor The color of the text
---@field font_style? c2.FontStyle The font style of the text
---@class (exact) MentionElementInit : MessageElementInitBase A table to initialize a new mention element
---@field type "mention" The type of the element
---@field display_name string The display name of the mentioned user
---@field login_name string The login name of the mentioned user
---@field fallback_color MessageColor The color of the element in case the "Colorize @usernames" is disabled
---@field user_color MessageColor The color of the element in case the "Colorize @usernames" is enabled
---@class (exact) TimestampElementInit : MessageElementInitBase A table to initialize a new timestamp element
---@field type "timestamp" The type of the element
---@field time number? The time of the timestamp (in milliseconds since epoch). If not provided, the current time is used.
---@class (exact) TwitchModerationElementInit : MessageElementInitBase A table to initialize a new Twitch moderation element (all the custom moderation buttons)
---@field type "twitch-moderation" The type of the element
---@class (exact) LinebreakElementInit : MessageElementInitBase A table to initialize a new linebreak element
---@field type "linebreak" The type of the element
---@class (exact) ReplyCurveElementInit : MessageElementInitBase A table to initialize a new reply curve element
---@field type "reply-curve" The type of the element
---@alias MessageElementInit TextElementInit|SingleLineTextElementInit|MentionElementInit|TimestampElementInit|TwitchModerationElementInit|LinebreakElementInit|ReplyCurveElementInit
---@enum c2.MessageFlag
c2.MessageFlag = {
None = 0,
System = 0,
Timeout = 0,
Highlighted = 0,
-- ...
}
---@enum c2.MessageElementFlag
c2.MessageElementFlag = {
None = 0,
Misc = 0,
Text = 0,
Username = 0,
Timestamp = 0,
-- ...
}
---@enum c2.FontStyle
c2.FontStyle = {
Tiny = {}, ---@type c2.FontStyle.Tiny
ChatSmall = {}, ---@type c2.FontStyle.ChatSmall
-- ...
}
--- Creates a new message
---
---@param init MessageInit The message initialization table
---@return c2.Message msg The new message
function c2.Message.new(init) end
---@enum c2.MessageContext Context of the message being added to a channel
c2.MessageContext = {
--- This message is the original
Original = {}, ---@type c2.MessageContext.Original
--- This message is a repost of a message that has already been added in a channel
Repost = {}, ---@type c2.MessageContext.Repost
}
--- Adds a message to the channel
---
---@param message c2.Message The message to add
---@param context? c2.MessageContext The context of the message being added
---@param override_flags? c2.MessageFlag|nil Flags to override the message's flags (some splits might filter for this)
function c2.Channel:add_message(message, context, override_flags) end |
Beta Was this translation helpful? Give feedback.
-
Got an idea for a plugin that you feel like would be useful in Chatterino, but might not make sense in Chatterino itself?
Post it here - we're looking to see how the API should be designed, so getting some ideas as to what you'd like to be able to do with plugins is useful.
Beta Was this translation helpful? Give feedback.
All reactions