Logo
Explore Help
Sign In
intercal/omnibot
1
0
Fork 0
You've already forked omnibot
Code Issues Pull Requests Releases Wiki Activity
Files
304a8d4164b210275bf85adf1bae1fcfc7fc5459
omnibot/lib/core/welcome.ex

12 lines
184 B
Elixir
Raw Normal View History

WIP: Move Config.all_channels/0 and Config.channel_modules/1 logic into State; add State.add_loaded_module/2 The problem: When we're going through the list of modules to send messages to based on the channels they're a part of, it was being done so through the config. Since the config doesn't (and shouldn't) list all of the core modules that get included, any core modules that were loaded and running under the ModuleSupervisor would not get included in the router's attempt to send messages to a module. Now, the Config.all_channels and Config.channel_modules functions live in State, and State has a new "add_loaded_module" function where loaded modules are registered. The aforementioned moved functions will use this as the "source of truth" when deciding where to send messages for modules to handle. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-06-13 17:13:05 -04:00
defmodule Omnibot.Core.Welcome do
use Omnibot.Module
require Logger
@impl true
def on_msg(irc, _) do
Logger.info("Syncing channels")
Irc.sync_channels(irc)
end
end
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.5 Page: 42ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API