diff --git a/docs/plugin-meta.lua b/docs/plugin-meta.lua index d4b1ac25b..7de590afd 100644 --- a/docs/plugin-meta.lua +++ b/docs/plugin-meta.lua @@ -30,18 +30,13 @@ c2.EventType = {} -- Begin src/common/Channel.hpp ---@alias c2.ChannelType integer ----@type { None: c2.ChannelType, Direct: c2.ChannelType, Twitch: c2.ChannelType, TwitchWhispers: c2.ChannelType, TwitchWatching: c2.ChannelType, TwitchMentions: c2.ChannelType, TwitchLive: c2.ChannelType, TwitchAutomod: c2.ChannelType, TwitchEnd: c2.ChannelType, Irc: c2.ChannelType, Misc: c2.ChannelType } +---@type { None: c2.ChannelType, Direct: c2.ChannelType, Twitch: c2.ChannelType, TwitchWhispers: c2.ChannelType, TwitchWatching: c2.ChannelType, TwitchMentions: c2.ChannelType, TwitchLive: c2.ChannelType, TwitchAutomod: c2.ChannelType, TwitchEnd: c2.ChannelType, Misc: c2.ChannelType } c2.ChannelType = {} -- End src/common/Channel.hpp -- Begin src/controllers/plugins/api/ChannelRef.hpp ----@alias c2.Platform integer ---- This enum describes a platform for the purpose of searching for a channel. ---- Currently only Twitch is supported because identifying IRC channels is tricky. ----@type { Twitch: c2.Platform } -c2.Platform = {} ---@class c2.Channel c2.Channel = {} @@ -131,9 +126,8 @@ function c2.Channel:__tostring() end --- - /automod --- ---@param name string Which channel are you looking for? ----@param platform c2.Platform Where to search for the channel? ---@return c2.Channel? -function c2.Channel.by_name(name, platform) end +function c2.Channel.by_name(name) end --- Finds a channel by the Twitch user ID of its owner. --- diff --git a/docs/wip-plugins.md b/docs/wip-plugins.md index cd38fa18c..663c7d54c 100644 --- a/docs/wip-plugins.md +++ b/docs/wip-plugins.md @@ -219,15 +219,6 @@ c2.register_callback( ) ``` -#### `Platform` enum - -This table describes platforms that can be accessed. Chatterino supports IRC -however plugins do not yet have explicit access to get IRC channels objects. -The values behind the names may change, do not count on them. It has the -following keys: - -- `Twitch` - #### `ChannelType` enum This table describes channel types Chatterino supports. The values behind the @@ -260,9 +251,9 @@ used on non-Twitch channels. Special channels while marked as is an actual Twitch chatroom use `Channel:get_type()` instead of `Channel:is_twitch_channel()`. -##### `Channel:by_name(name, platform)` +##### `Channel:by_name(name)` -Finds a channel given by `name` on `platform` (see [`Platform` enum](#Platform-enum)). Returns the channel or `nil` if not open. +Finds a channel given by `name`. Returns the channel or `nil` if not open. Some miscellaneous channels are marked as if they are specifically Twitch channels: @@ -275,7 +266,7 @@ Some miscellaneous channels are marked as if they are specifically Twitch channe Example: ```lua -local pajladas = c2.Channel.by_name("pajlada", c2.Platform.Twitch) +local pajladas = c2.Channel.by_name("pajlada") ``` ##### `Channel:by_twitch_id(id)` diff --git a/src/controllers/plugins/PluginController.cpp b/src/controllers/plugins/PluginController.cpp index 3f1d36a56..9a9d05207 100644 --- a/src/controllers/plugins/PluginController.cpp +++ b/src/controllers/plugins/PluginController.cpp @@ -168,9 +168,6 @@ void PluginController::openLibrariesFor(Plugin *plugin, const QDir &pluginDir) lua::pushEnumTable(L); lua_setfield(L, c2libIdx, "EventType"); - lua::pushEnumTable(L); - lua_setfield(L, c2libIdx, "Platform"); - lua::pushEnumTable(L); lua_setfield(L, c2libIdx, "ChannelType");