blob: 38efa6e0dc0572847977bdd50c5c1f4085456b41 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
import weechat
from slack.config import SlackConfig, SlackWorkspace
from slack.shared import shared
from slack.task import create_task
from slack.util import get_callback_name
def shutdown_cb():
weechat.config_write(shared.config.weechat_config.pointer)
return weechat.WEECHAT_RC_OK
async def init():
print(shared.workspaces)
if "wee-slack-test" not in shared.workspaces:
shared.workspaces["wee-slack-test"] = SlackWorkspace("wee-slack-test")
shared.workspaces[
"wee-slack-test"
].config.api_token.value = weechat.config_get_plugin("api_token")
shared.workspaces[
"wee-slack-test"
].config.api_cookies.value = weechat.config_get_plugin("api_cookie")
workspace = shared.workspaces["wee-slack-test"]
print(workspace)
print(workspace.config.slack_timeout.value)
print(shared.config.color.reaction_suffix.value)
def main():
if weechat.register(
shared.SCRIPT_NAME,
shared.SCRIPT_AUTHOR,
shared.SCRIPT_VERSION,
shared.SCRIPT_LICENSE,
shared.SCRIPT_DESC,
get_callback_name(shutdown_cb),
"",
):
shared.weechat_version = int(weechat.info_get("version_number", "") or 0)
shared.workspaces = {}
shared.config = SlackConfig()
shared.config.config_read()
create_task(init(), final=True)
|