MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / __init__

Method __init__

pager_lib/tqdm/contrib/slack.py:28–37  ·  view source on GitHub ↗

Creates a new message in the given `channel`.

(self, token, channel)

Source from the content-addressed store, hash-verified

26class SlackIO(MonoWorker):
27 """Non-blocking file-like IO using a Slack app."""
28 def __init__(self, token, channel):
29 """Creates a new message in the given `channel`."""
30 super().__init__()
31 self.client = WebClient(token=token)
32 self.text = self.__class__.__name__
33 try:
34 self.message = self.client.chat_postMessage(channel=channel, text=self.text)
35 except Exception as e:
36 tqdm_auto.write(str(e))
37 self.message = None
38
39 def write(self, s):
40 """Replaces internal `message`'s text with `s`."""

Callers 1

__init__Method · 0.45

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected