omniscientChannelPolicy

The ChannelPolicy annotation dictates whether or not an annotated function should be called based on the *channel* the event took place in, if applicable.

The three policies are ChannelPolicy.home, with which only events in channels in the IRCBot.homeChannels

array will be allowed to trigger it; ChannelPolicy.guest

with which only events outside of such home channels will be allowed to trigger; or ChannelPolicy.any, in which case anywhere goes.

For events that don't correspond to a channel (such as a private message QUERY) the setting doesn't apply and is ignored.

Thus this omniscientChannelPolicy enum constant is a compile-time setting for all event handlers where whether a channel is a home or not is of interest (or even applies). Put in a version block like this it allows us to control the plugin's behaviour via dub build configurations.

  1. enum omniscientChannelPolicy;
  2. enum omniscientChannelPolicy;
    version(WithSeenPlugin && !OmniscientSeen)
    private
    enum omniscientChannelPolicy = ChannelPolicy.home;