Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion sopel/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
import signal
import threading
import time
from typing import Optional
from types import MappingProxyType
from typing import Mapping, Optional

from sopel import irc, logger, plugins, tools
from sopel.db import SopelDB
Expand Down Expand Up @@ -189,6 +190,14 @@ def hostmask(self) -> Optional[str]:

return self.users.get(self.nick).hostmask

@property
def plugins(self) -> Mapping[str, plugins.handlers.AbstractPluginHandler]:
"""A dict of the bot's currently loaded plugins.

:return: an immutable map of plugin name to plugin object
"""
return MappingProxyType(self._plugins)

def has_channel_privilege(self, channel, privilege):
"""Tell if the bot has a ``privilege`` level or above in a ``channel``.

Expand Down