{"_id":"messaging-api-slack","_rev":"90-95696237258ee4828b8914780ef8c91c","name":"messaging-api-slack","description":"Messaging API client for Slack","dist-tags":{"latest":"1.1.0","next":"1.0.0-beta.33"},"versions":{"0.2.1":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.2.1","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.2.1","scripts":{},"_shasum":"3a57b938a17178679a4bf16bf8c25a34cd91a4a8","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"dist":{"shasum":"3a57b938a17178679a4bf16bf8c25a34cd91a4a8","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.2.1.tgz","integrity":"sha512-oVuDcZmHdc7v2RQyc4w50+VMDoSxKD5rD7KrTCgDfqMUt361YLqzihsM65nR/9mhy5IaIMY088iMCYNkhKK+kA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBn58US6bCQHXc/J82RQ3pAJFvGxvHbilrirLYW3tBblAiA6XaSfe58c7VrGvnYwSfh9/VIzSS+lJNNXtu4UwVmQ/w=="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.2.1.tgz_1499317638362_0.08811678108759224"},"directories":{}},"0.2.2":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.2.2","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.2.2","scripts":{},"_shasum":"a4efdbc64595fd36d35d55587c287741f0dc91a5","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"dist":{"shasum":"a4efdbc64595fd36d35d55587c287741f0dc91a5","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.2.2.tgz","integrity":"sha512-kqZPzHAkIpy/2iAniyl0ur1GnLueSr4DQ/JQ0B+SEWp4zYOT99lklYLJGbZbVPtN3XtdkljA1qCD3bLUn63N/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1xccQHuh3SRXhcrO6k6LC5IbPZ7YbGZ046j8+c/gs5QIgIj43hy6OGzIcq8uGkOllFtr4Sr/BZGb6XWp5DAP1rFQ="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.2.2.tgz_1499741073200_0.11067307321354747"},"directories":{}},"0.2.3":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.2.3","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.2.3","scripts":{},"_shasum":"1ab5d42e2cc174706dbe4eb4906c32f3523b3569","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"dist":{"shasum":"1ab5d42e2cc174706dbe4eb4906c32f3523b3569","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.2.3.tgz","integrity":"sha512-Sj2euVLRia5U44w2OtFl4DHJUGEYOjAhQaxgg/5MMRiiBggQeqMy8VqecwxJqKwzJQneVlkXhs269xinbyWApA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDeT9ktNQjrq+bAiDkZvgsrB8JOtuaqeJNzUN8Wd6mCjwIgVLyuolAqNkbXwV4p3O7wwKbDrIJb8QvO3Bx5fuz3VKE="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.2.3.tgz_1499927735814_0.9155110754072666"},"directories":{}},"0.2.4":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.2.4","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.2.4","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-wp+lhsWTx9ngLlHSgtgI5fjqvzQI55BiHEDKzFEyN0SFUy5DuPwi10dZc+FTCwmbNUfL2dFNT/BqsfqyZu1qtA==","shasum":"e83bb2e9f68f3294281f999ea7deb843f012d8ea","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.2.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBnUMzBa4QlaYM+yaXQp1aYEXpJhlBLavctHm+s6VRLQAiEA2zAKlSk2wYIeBr5LPFwHpqyjlbe8nBUPoRf3i3/rsVs="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.2.4.tgz_1501661720470_0.9305845345370471"},"directories":{}},"0.2.5-0":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.2.5-0","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.2.5-0","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-au6uhHPHyxWb2Y29PmjHwZ9V7a1yCuek9fetaaD6w0Gf8uDjjgIlz4Mfdx5c/dDfYuvShz2yRzjMMda9gtH7TA==","shasum":"646830103def5ec69096045d5bc031ac681342ef","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.2.5-0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPPRMtoZmfAHkAYEGHaIXWVzXjk709nIWYmrbnLjzkAgIgNCcU8zn3Yo/w4BRDui2PDAuMrJ84EfolfAVXnsIsN5I="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.2.5-0.tgz_1501746461714_0.966571664204821"},"directories":{}},"0.2.5-1":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.2.5-1","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.2.5-1","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-NUEII1FO5Md6EK5ryJdQGadlYOHJQzfKes9dWWSR7y/hJVIM0ocxTv6EqvunestrtseuVsZuwNpo/DNz1lw0vw==","shasum":"18ee4d57d7ccec2f5d661e57b32633761787bad9","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.2.5-1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMF1sO5WTy8WqYwWdpoZD1hZcaCuEsc9YhmwXPZsc5SgIgVTC9jCbXsPcFpwx78QIT7g3bzlm4dw37Wpr3utCVRsQ="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.2.5-1.tgz_1501860112127_0.8741338383406401"},"directories":{}},"0.2.5":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.2.5","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.2.5","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-/7givJ8p5nRWWLLgto4cORfeBOuxiZCtdx5r4aKK/7UtaGf9XtomwebmICSY2LO1cU4KD91KTRDEEs7aGlXp4w==","shasum":"e87b2b4f4c93fabe9caa19811d57c3188b3e12f0","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.2.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDo7aPmbixC5//QpypnNorCTW1U0qFgtcXtRSgdsvAAsQIhANUHvxSnDdeSkwVkHbu3KXXZ7lFoXOKb+yxog+SKPT4j"}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.2.5.tgz_1502266222551_0.6776951143983752"},"directories":{}},"0.2.6":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.2.6","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.2.6","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-lCjatEzFKviZ+DedRM/di46n3SEbRXV2OtsLfbMoysMBOSqIL/GqHt7EWs6sH7EWekFtq9az/95/nQVYwwga+A==","shasum":"804feaaa703a3bd00feec0c2e00900e4d6fbd0a8","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.2.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmWKtVERMuLIBMr/aWODvgMkF9NfisRIZjPJx3o5kbFQIhAJitdeQ2k3oP6A2RBbKb9ywpJTlLBfKXy1Q9lIfHdAdE"}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.2.6.tgz_1502695621405_0.2280024455394596"},"directories":{}},"0.3.0":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.3.0","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.3.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-N60XVTLePbmQnn4qZbeqKTlTlhwwybH6zhE5UzQ13V4NpZFn2RlSMQKMXTGZGnyH3gld9tvb28jTYE9CvAoPeQ==","shasum":"9edb62849aa566c37082afed00e5c214d4a85b16","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.3.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHWNoBZPcdM5NXwDnN4hAlGoGtXyDjLBkHUAVU1Wd38+AiEArFcNh7TzAM0JWjJeHYDxLNOBKHEOhL1uq4y87SPMbP0="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.3.0.tgz_1503992208264_0.9143501883372664"},"directories":{}},"0.3.3":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.3.3","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.3.3","_npmVersion":"5.4.0","_nodeVersion":"8.4.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-nco89lcUnmzJNIEuvibG5DQ05caqUVkJeSIrALCfXqCW+Zi6X1VCaNdMaAJpDTwTfoLwJ4anodVg6j6ptzGflQ==","shasum":"6b5ea7dbdcd0c6f9788d53d03adc79b3a93cd6b2","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.3.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID7UMGUnbwx8aM2GN710HO3D09sZFmcwybLUaahgxVVdAiEAokw2vl+Kyc/A5MkOekCOMuVqBWNZwsdJwUN4hfTnk6s="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.3.3.tgz_1504770548306_0.9892436554655433"},"directories":{}},"0.3.4":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.3.4","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.3.4","_npmVersion":"5.4.0","_nodeVersion":"8.4.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-/XqrWavcozaEPibeTLfEtWuRFvKYWaS/2NtVrrpE5jukZOr+F1MyCNfRBZ4pqv+/C6TT2ZhT1BzF4ZQOKWdd3w==","shasum":"9f66d1827092b4e3f45f5115e766a393abd80a39","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.3.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCcUqNSIOq6m+hlRPLTRw76KJnP4V8s8eYzwhI5bbX+AIgPiUTXB84GtPEYIsESnjkHKA4OlA3AcmVYDEFpTyyELE="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.3.4.tgz_1505297683091_0.22806052793748677"},"directories":{}},"0.3.5":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.3.5","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.3.5","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-o5akE7zoUkaoKpK38b+9vIKCX167Lij0JcUmFV8rdAz0ha5X3b4FD1TVPM6Ej0j14h0Oqth1xKejPW+/oubWTA==","shasum":"32e192ef994349ace3dc4472401e3a6a75ef386f","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.3.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAsMbIOoAzVdWfw2Q8y9hiA8qU4nNosWAY39ZhMUhIv3AiBOrBUwpfIxJ9Hdg9hUp9ynzhvFXla7u6dxb3/1YxBLcg=="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.3.5.tgz_1505405717464_0.9277981796767563"},"directories":{}},"0.4.1":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.4.1","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.4.1","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-CbcdZCYss0qleDVWuYngv6lwupjK8QB4m4+RxKKVKylH5W5F88GKgxHpVvXPha91rEFZCgNA0f/ISIv7mJJzLg==","shasum":"80ea4c98e92c2b756bbe0d6ba09e0fe0d0ebb3d3","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.4.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1FnXz3wmL8QSBB+5Na3C5s1XZWdLz+xEKUV0T/sh9wQIgHJIepd2pogbkUC6nWY1yZDJrP5OmAJ5nsu5OnJ/1oh8="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.4.1.tgz_1505819879564_0.2753093058709055"},"directories":{}},"0.4.2":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.4.2","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.2","invariant":"^2.2.2"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.4.2","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-Gm8fPBJRfwbjs3QOGYObjbbSfiLLvKj/fYOCNQPgtvL9GLoEZp3alFjfZYJFWeaGneSoQ1eOEgOPZrApuqADfA==","shasum":"608984fb47017732dff189657a7a0aa11d48e572","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.4.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFWrdieDmLwxA2rJVonIGvQVt3NOglEdKPwBq7Xps9KIAiEA+3M3hzlnpJhzo5ZUIJDmq5TqA3OvNaWfDpLXQPEvDRk="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.4.2.tgz_1506044611545_0.4956871329341084"},"directories":{}},"0.4.3":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.4.3","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.2","invariant":"^2.2.2"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.4.3","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-Jmn50yMB9N4drZrVWdfRiMGaXtFD6gpQIzuYrVP/KpwPSI/BY8GdkdCZkuQPT0cLfbANW3oznBOMb9f/MzSUmw==","shasum":"0ecf785b9f36ce782916cfcc77f1440fa00ea5d3","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.4.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDN/8agaYA/fCArwHzUROYrADtRT++4PTkh3DxUxg0+ywIgPSYOIZSJyt8cTtgvBj5zyM0Pe3RcKg8U3BAWh7uHkIs="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.4.3.tgz_1506574451906_0.3761812502052635"},"directories":{}},"0.4.4":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.4.4","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.2","invariant":"^2.2.2"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.4.4","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-HNCrRkmylRfUAG8vE/n7hGEPWeZh3zqfRo2Cr1LXTxbF8F3t6IY1uiiFxAjoqcth5OQZJ/M8yRvBXFX5Y0pmzw==","shasum":"1812c72d82fbd8e7ad85f9114cd2bd18d7a098ae","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.4.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdxz4o9Ttm88YOGwjyhNmMtxi4F0USc2Q764atrh48kAIhAL9GH1JAXfinncsFFfmG8P4ZQDZ291irkDYXfoqFjUIO"}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.4.4.tgz_1507709003620_0.5055347792804241"},"directories":{}},"0.5.0-0":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.5.0-0","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.2","axios-error":"^0.5.0-0","invariant":"^2.2.2","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.5.0-0","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-uUBAQfiY+27mixc0zcptqpinAhW8/h7pIernKwafDMTfDUGFOLbGwOm7fy2lf/25HJ3wjCVCnja2kvLiLA+RCw==","shasum":"d4e4a47f0d7073684e9a9701dfbd28cd84ff6024","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.5.0-0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDV3aaaUjmPYD4LqvA7LBt5ho+LOK7DSxmRWG+rZzcF7QIhAOzpW2cUGu8C+JphVu/m2li2gMaye0iJkbyaLM+feuP8"}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.5.0-0.tgz_1508482616422_0.13376049185171723"},"directories":{}},"0.5.0":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.5.0","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.16.2","axios-error":"^0.5.0","invariant":"^2.2.2","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.5.0","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-rDTzOyYGwzcg5tRDPm4mv+ZPwwXGMVXh7S1cajqW3oNIK2gyavJGjH/d6Q+IvDwcpEvjwZyuC03bwTBScU5YsA==","shasum":"5dddda215c493d2ad3b377de8d520eb48dfe8673","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.5.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICZe+pWx/HCxxqT8wtQVPjrMYuiHAoEqtmavP6MBAy62AiEAk3Q6Lc8xfJaeGubGVnjCD0RrQAjZ70xasYxygwNh99U="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.5.0.tgz_1508483917383_0.35693462658673525"},"directories":{}},"0.5.2":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.5.2","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.2","invariant":"^2.2.2","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.5.2","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-ExhhbAJ++L61w96pQeCs3dfnJP1XcRySJ0Z7TV0JpwoPDyyFlogi2rjg3E0+4/VzfwwrcCMfxQzvqrI1jsSXrA==","shasum":"21a6342aa0cc53956df17fb32d08576c6c4efe96","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.5.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCadjszZNrkaNhgtheEjEf+tobaBkDxZr7CSRSXrvjt9wIgModO8b0LAizK5jY4k9Ul0JFFgjIVnYr7/fculZRM+ik="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.5.2.tgz_1508990949377_0.3564819684252143"},"directories":{}},"0.5.4":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.5.4","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","invariant":"^2.2.2","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.5.4","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-LOvdC5CEhWwCU4M9MjBeLmVmjqPhkp5cuWJwSOd9F9sV1vffxvAI16i2ExeUy5M5Sb1izkZu5G+jTPHSmdh9sQ==","shasum":"630e6af02df1b00d7efcb9a1fcb43cc588b4387c","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.5.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAPspgq4GUuDNR6Zg6bxZDwp+DNseoK1wFN+ctCHsoQ/AiBJEXh2YhypfYQG9fYbE8KTeNe9uJ5bwbL3IKX/BoXRBw=="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.5.4.tgz_1509341097371_0.8797053387388587"},"directories":{}},"0.5.6":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.5.6","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","invariant":"^2.2.2","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.5.6","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-QfgURKcmcQc8GrK/ByxEHCR64OBBJwWyxNQhveHX1SBmKNU3Dnw28kk1OZydFIsYuyNdV3WFIGQe+Mpfvk+Bqg==","shasum":"ba86381b5fd017e157a2aebf57f9711e531e7e99","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.5.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAjdUXVW6jBSxEYFlIWCXyuLqNikoKyOQiZikQW/1RSNAiAND3PvoV8/Z1rzKexWXv/v0Sa2/ByQR8WesISbU3BIAw=="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.5.6.tgz_1510048897046_0.622378195868805"},"directories":{}},"0.5.7":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.5.7","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","invariant":"^2.2.2","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.5.7","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-ZfUNNzkHg5foQ2mbTNxiNaGHHgzf0WIWhhUqVWjmbqoWGolEjAR0GRssitiVrxB63o9Y0sgZL/zIEFBSwYWGZQ==","shasum":"e54fd07d946e4a03ba08dacf944adf03d04e1c73","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.5.7.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFtWzVQlrp1CSD+Krk6mYgF+t7kVHVzB3BmIVhOWAeL0AiBycurO4+ONXWGuSD3JDJQa8ZWPdX+rnyDrsNCsdhabZw=="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.5.7.tgz_1510219996627_0.7655581517610699"},"directories":{}},"0.5.10":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.5.10","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","invariant":"^2.2.2","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.5.10","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-bbJVzqtQXqjdf4jX9DuQoMaJlk94Pr/n8ZLC8hgDDVbvtG3hHC1zQR9ilx3PpNxupay2GLM8EU2ptIbuyQUcwQ==","shasum":"da4e196b28d59bc55dfcf6b89c36d8eda249b6d7","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.5.10.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCes38NGmwQWQhfXaDJLffS/YZGy61vOGNLCbhcGE/8DwIhAMFVHyfeOoHv1AAhyfoYUCLrcu3/HmRqnu58AhZN6bIh"}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.5.10.tgz_1511249622992_0.8353206792380661"},"directories":{}},"0.5.13":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.5.13","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","invariant":"^2.2.2","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.5.13","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-XLijOkjcB/RNxtGwkBpMKqsa15iMRb6CVc9TmmfOMkvVl7HUIIyiFgDCRx1AxdRWm0I2zaYlTAzqYU+lWtD3+w==","shasum":"db9ea4cdf8f078ef18e9190cf369c83864401123","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.5.13.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjUFGo5/y6qx6LB8vTj/33jOBNl6GTM/XJqyFvFWH80AIhAI8x/S3d5gi8Yw95rc5OcfdYv8u1saNOxvWnUPQUorMi"}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.5.13.tgz_1511869780057_0.7104086719918996"},"directories":{}},"0.5.15":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.5.15","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","invariant":"^2.2.2","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.5.15","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-kUy5dHEEnFkkHn1v+ke4leoDLZ1felkGsGvQrPUDNW9RM20Y1MP4MbnGbkcwEQMjvEn5e8gNxnMerl7ed8bvig==","shasum":"ab7cf4ac8b2b9d0831f02b05190d64e118dcb8a0","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.5.15.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC78vSA91DPk0ONS7bSNnQo5j1T1LkEk3lUpz1259XboAiACZXPZbb03NlNZJ2K6WldQ6kD+njDVU91VrUOopHJxNA=="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.5.15.tgz_1512383336493_0.9813018026761711"},"directories":{}},"0.5.16":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.5.16","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","invariant":"^2.2.2","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.5.16","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-RSbeKWOPAv5sOyLdhiU2DRPrvdtHEOp7sqWW9RnupkRGkK2SIZmwfHSVHkII/Dr4nsvm/arEXUMpkCKUyT6tdw==","shasum":"7b6dfb78372789802074ebd28e02cf3031d11284","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.5.16.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/lSZtOOf/Ig5dVGaZ3Q0SaHqAC3lmf6dMY7JQuqFnkQIgeTvFglFSKPj9b6IzH3JGpBwV/rEcVs+nRcDARsF4R2s="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.5.16.tgz_1512460161050_0.7876958453562111"},"directories":{}},"0.6.0":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.6.0","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.6.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-GTa/cIr1ytapkGe9BQbF5lvXLsBlw7nyo/KyGgOWww5Wy1BzaD22sRLFelV8hBueg3Oqt0FOeQmRc2MymgqsAA==","shasum":"8e379a1bbf6ab937f0923922463fec4a0a8133a4","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.6.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICJ8E1GKyNV3cxbC7kiJ3zmeHC+EKzslp8zsUfAf3T9EAiBnqJWGeI7YqRcRy8O3afp6eirmfeaulgmk59S8pzSf1w=="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.6.0.tgz_1512620025683_0.8652165199164301"},"directories":{}},"0.6.10":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.6.10","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.6.10","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-gx16+Ac/bM+uRSnpgW4kOTgZ2eNiJAX2CQ8R5VTFiOsVl0UM7ByAsQ1Ak21ViO942td34esDauRKKgNXXftnmg==","shasum":"857f5f361072336252dc40dc80eb821b2903a517","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.6.10.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIgpRcKy7f+DdOWBYBU4n4FdhBrZk61CTKbJJt31pqsAIhAMnGhZe8apSH1Tc7Gx2UAxrVJae18VpPGkgcfI6rlQon"}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.6.10.tgz_1515739416113_0.36164709855802357"},"directories":{}},"0.7.0-alpha.2":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.0-alpha.2","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-alpha.2"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-slack@0.7.0-alpha.2","dist":{"shasum":"d32566238634f0ae7578404370afa2804bbd9bce","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.0-alpha.2.tgz","integrity":"sha512-pG39+kamZSL0Y07HWjhAdvvuhXPiAJNWf5doYBCQqzCDtBKNtdUMfNjJcQpe1vut/g5mPFloAJpGDXFDHRsqiw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAkGKOJivBn268/E6wh+6YoaNYgcuu1y/8DVuPbN6Ki4AiEAg7bzmf8A4QWS3XlK6PcR/GO45xGoNOp0z6Mn6JNRMAg="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack-0.7.0-alpha.2.tgz_1517796320785_0.7921124177519232"},"directories":{}},"0.6.13":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.6.13","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.6.13","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-tTR/5HbrpNVxkgnv04p75RKfsUbwiLAQI5kGAAkf+86jCQBrwfyrjKvDug+dzfW5RzpnKQR2aKslgjxAxZm6LQ==","shasum":"091e681f28b1452d3f98bd8e6d24ca08b17c3716","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.6.13.tgz","fileCount":15,"unpackedSize":92082,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDet7hcIbG/2na7Jy2VPk59QOFnEpMg0mXNXY0rd0f88QIgFxGbTeqMzHRC0RlSaCLMTUuIrwssJb0NUwfqFzURZsE="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.6.13_1518422608051_0.5035251940317309"},"_hasShrinkwrap":false},"0.7.0-beta.1":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.0-beta.1","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-beta.1"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-slack@0.7.0-beta.1","dist":{"shasum":"ecbab21e65112b7de3cec962a35825761d7f297d","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.0-beta.1.tgz","fileCount":20,"unpackedSize":93737,"integrity":"sha512-0/obeZK3PStGi2ourM20gfr6nzNxizTdTJqjtOhCZ3pcepSAgnKDkDp20oDAU7V6I7X04d97W8umd0Ctdl/vew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH0JUeJabOwI+SdIdPenNZkGijtC9ldeMjtfrXEpdVdCAiAy9NmCRSGMUF1QPaIDp/3q8sRD4YPJpMAYB5/f/4ExrQ=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.0-beta.1_1522054766148_0.41897441126190405"},"_hasShrinkwrap":false},"0.7.0-beta.2":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.0-beta.2","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-beta.2"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-slack@0.7.0-beta.2","dist":{"shasum":"926cffaa1fc7c2da9846343705ca0c3768822267","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.0-beta.2.tgz","fileCount":20,"unpackedSize":93737,"integrity":"sha512-1IjkWiHeIVpklPppJSNcdJ6rlZ0Ad/1ZYF6Pug0kj9F7wZ3gz0mludCsVyUjAV/xEecPeZ/japZ6QEjgLL+0lg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvmN2N7DivHrKUW1OBtlCT1EmM5AX3fA3EStVu0FomXwIgHCB7FmUKi/8UMOwx5PcVzqTrlgzN+/QBS90wkF3PqBs="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.0-beta.2_1522224537873_0.13159364241051286"},"_hasShrinkwrap":false},"0.7.0-beta.3":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.0-beta.3","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-beta.3"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-slack@0.7.0-beta.3","dist":{"shasum":"04a5166ea80ad83ff36c1aba7cdcce081acc4463","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.0-beta.3.tgz","fileCount":20,"unpackedSize":93737,"integrity":"sha512-EbmENeQTZq/jb2bgaFPPt2J/4uxwFRybOK52KC7fmAQ4JC2UrjsRe2eAmtyaCT8f3WmJXZfIDJyxqUXt5Ipl+w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXufm9JVpYt9TgylShMHgybY2N6gHzw26Uwg+odgc8jwIhAMI/auV3RB4/bBezfcvpE6/Jca04ZAioR7cbU2JBjxWB"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.0-beta.3_1522650418989_0.6136972910773504"},"_hasShrinkwrap":false},"0.7.0-beta.4":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.0-beta.4","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-beta.4"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-slack@0.7.0-beta.4","dist":{"shasum":"95f0bed5df9e824bc7de2d278e3b20eae891eb10","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.0-beta.4.tgz","fileCount":20,"unpackedSize":93737,"integrity":"sha512-29Cr7hZ3jdOH7Dspm0/jwjkxNlgjNFAqqxrevGWhzIGQhdOee7JKNY9f7FfT4Ln+juFieYMaL+YukB8JGGlKCw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClkHk0RoP3BhX1UUnDVVyUJSvE9JaK9ooV/3EsjFvHzgIgX1dvSyvGOlwcpcwyUbHDRMrFd31OOnC9kt+HITeV9ms="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.0-beta.4_1522737598259_0.36349691156191555"},"_hasShrinkwrap":false},"0.7.0-beta.5":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.0-beta.5","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-beta.5"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-slack@0.7.0-beta.5","dist":{"shasum":"918eccefc25e266bfd83bb2bf89eedb6a1e4981d","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.0-beta.5.tgz","fileCount":20,"unpackedSize":93737,"integrity":"sha512-Jt1OMdDG7zdookzRAvn3uQ9i7RWQc1cFlkDtZEaULLz2l3lDCdZdvJuZvxBd7sFM5i5HWLb7Xszwo3kTPs7RLg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICxJVCIE6cdd8mhdcg0ZYmy7FU5qdyZWT4NgatPlcetGAiEA/wjQF6I7m7VXvADDiyJvuja5cSjiIljnUHZlCiMdsB8="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.0-beta.5_1522748375411_0.4609847730021406"},"_hasShrinkwrap":false},"0.7.0-rc.1":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.0-rc.1","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-rc.1"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-slack@0.7.0-rc.1","dist":{"shasum":"4cf6894a947a7be55ee5237acb03435654fa6615","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.0-rc.1.tgz","fileCount":20,"unpackedSize":93733,"integrity":"sha512-DHSXHRJ3R97F7LY0pD90GMFuo5IUSpG8uJ0k6jk8mG0LlLAGGoK0Ojm0fEqKcaYcQiwB6wzOKw2IxE4iB+1DSA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9xGJeOmlKO/kezyyCvTCnNV06SV2irW8Z4VTyLpQzxgIgSR0hMXWXOTG2V6HW1MQzyDD3I1vK4JkpFOPlmpqwtdA="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.0-rc.1_1523261660187_0.2166704354282596"},"_hasShrinkwrap":false},"0.7.0-rc.2":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.0-rc.2","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-rc.2"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-slack@0.7.0-rc.2","dist":{"shasum":"a119858c09b4aad56cdee0d3868ae0a9cdf4f75c","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.0-rc.2.tgz","fileCount":20,"unpackedSize":93733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1XXsCRA9TVsSAnZWagAAabIQAJVG40/lXaNxLYZs1PxE\nhUqzsCHE2En37dRRKW/2bAEFtvWE3sNV5YwM4daD6L/zZ2ymGnAZk4AxFCx6\nzJZ8LxAAEtKnnhMZ6Y/a/srA9qgrT8sPMAprdmHEOGIYt36+ZpeYvULnHP1W\nS9vZkRJSzpixFO0WH1FrvYPtucq3R4JThgEt0QgVHQkoiAcNrXfdH6xOAo4q\n1b0SX6Pa62tPMM29UTedvNvMuvWqk5PXgPlfjMWo9bAovbm0T72v14KKVATC\nPQKWP0AlpogvQ7CB0tZTU16joup6yDKbN889RCWAjkL6c6WNR6Bxfem4QiF5\n99queF5PUUbUud04oM0Y4/kBZZy8msB4WDiUItHVqST0PAmdI3IxgrSWcwYF\ndnYSZ0tbcEd292AITfnj8HrKU6Y5JdgxI9NV+Y7NivEw2IDseDWDED6cn/Nf\nv6cjEmPYOI/2BXxmMNdXP2FeCcd/+AK89Bw28SL2yzTORvZUB0VK6NxHlZkD\nWLmZuyo9RFct45s5//VB5nkceRsXWo00HHo3oIloL+8kWrQEloSWq8dmW1ay\nxTyzWM+hc1WKEj5m2/fP7SgaxaA3CcHVi+rdbGsyg18TLzKWHZclaMuw1v5w\nS+q0nUHj58FPI/2RiyLWdv0kOBjAzwK/sImO2aTfMfiy4t5HDUZLwrbnct3O\nUVKa\r\n=Iq2c\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-BfpwuJ3X4IOzEILJyAlXcWhtVlTQrNg3DDTxd1KyyvqdEVNUAW+E2NjTZXypGDkCotdsy3ykNONqWPqiQGMUMA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRkeQfQyd3FVAN9lMhhkXKKLtlbVZgxw1DUANhPiOGNwIhAKc6zQPDU9bDen6gA5+C3GWBGv9Z00vSXG/HViVBR7CQ"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.0-rc.2_1523938795491_0.5261770437646214"},"_hasShrinkwrap":false},"0.7.0-rc.3":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.0-rc.3","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-rc.3"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-slack@0.7.0-rc.3","dist":{"shasum":"05411528d926c420a97172b115c399130e370a6f","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.0-rc.3.tgz","fileCount":20,"unpackedSize":93967,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3qoQCRA9TVsSAnZWagAAQgMP/2Bax5lDXmYRvTX463LJ\nSuiqxEGU53/p4A9MCfTAb6BPP0VsvcBmW2FmPecJQSMCKmsfVL4A+aAdGMHe\nVGFLRlcRRG6i+FrMmhvxn9Q2KqeDtLJ8VvfJQxPMRhy53hBuivUr7Lc6yhnT\nF2ocGpA9rSP2p+VZ8JEjTruAhZcnuc7ZFB3xmG+0s6ESzp4fmTDvYQiyqiRZ\nSWEoW9o5wEKSEQgqVYG0i7KgtmjEU4H7mOua9cXHm2pfE2/NynoO3vdrVY17\nON5FAjExfsDnfMOVh4I1HtCL7Zg5+wmnnRv8AzLDv9UXyW/tajZGlyuT46Qn\nYMqLAQK34cBQFSfuwub6qq3WnqUw/bjiOw1aoCMHs9pF6ohMSBXJL5bkz+07\nzNNjg0acR/7DBl47kKtEmrWy8YjzP8nJ1I3e9644J5DQ/RR9gJCjg/d4D2j0\n1f0BQtYiKeviy05wN4BY7MQSz6hvT1VynowgWhpqNeano4kP8jpe+ZAFuHPp\n9Y3CP3Dm8IHNwjDXEqsijf1d3lM8Njua9AOFTaAj1RWY79pApmNH/o4176we\nJJa73sFHk7Tvvw+kzkVq71SrwW9Xa3RAY4tXrfOgpmGCCM5rn3AHWj5I5pYs\nSrYHFlx7ZvBm0RwMCP1d4ehNVguryOviEARbYyIRptycQ/e0GJdVH5KiitA3\naCjK\r\n=ZPSF\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-fkLxMjJiB4tolb8xIv8eOfdymuObtrd1zJuRPIQq6GFdRKDShmu7WvL9CTKsBur0TSS3FVznj+hDgV5E2SmWYg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAnSsON0wDTKfeoba5D5awS+MZcN5AnEKo8oMr6DuSFvAiEAsuYUDi3ChmPsregjtbiCTp0kXWomFItnc6xa5TJIfwU="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.0-rc.3_1524541967264_0.279739657386995"},"_hasShrinkwrap":false},"0.7.0":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.0","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-slack@0.7.0","dist":{"shasum":"b80541ef629793afe7bbd19914dda9d321e7fd50","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.0.tgz","fileCount":20,"unpackedSize":93957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4yX6CRA9TVsSAnZWagAAoFMP/2YiDBJ/B0v94JgF3kHq\nTGb4sPz+zvt6JWQ0shN7b6SDkPvxsRLp6ekcX8xG6iUC0lS0k2IKAvmi2gSK\nA+EeLqNzIfVqBvYsAtEnEjRi6RfT1hw79zLCoRsD9RtzP5K6d3g+UJy5+Qbr\npN8gV/Nct+d6ykUJJPIU3ZScNVgmG3qCXo1ndqoqZ19LmkWxbYp44MfJu5kb\nWDCzwqgm8jQGP5z7EYn6C1TS+OQwEZd4PHK0eb+6lV02yGehYccBNuIw/oV9\nwZ1yIP8TTVGGLnJ+s3JQV7HHe5Wob4BSm8KsQ+7ejKYaHOYLLqCUYja2bfJZ\ntg89jussJVhmM+CANxDGQPoDJWMO5hzMJkMqfWurlRZ7UeAgeZqy8G13/j6F\n+efaTzpWdJjf6uxzh49Tpsa9U8sL7CKydaw2jnwtTVupu9g/76YXw9TPBunl\nQl3EQQ/d7gV6oPH1AG8YPZKmEDX7UUyrmGAtmv7C3f2lh9U8Egq1y4mAcrj0\n00LEfG40cnvkBGLUHrK8YJr20TakclrBZc0vdV2JFgcBIa8/HgYyykPEFgdN\noKtsNM6ZCoG/Jm3iSkJJ+1yKAc82nbc5kZCbLDQbHubxDSw/avT2lqIaY0M+\ntjaSA5ZjwaYtX86CEtAy52IWDSWTj0KoFm76xBZUlD0TYMjN/zInpOeyo7ln\nflBm\r\n=Gom2\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-9nwRhSbmKDt5or587lDxI2kPIkqXgrOP+U8cTeCsaXbC3YibyjbxXX61biPo5cgSxxUwBJz/W5QtCCmaHljyMw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB9CbYbLS2rFjAYuQf0hDbRh4GWyqQbHR4TUU+I30Dk4AiEA9bQBONG42aGt89PCfXPApQK0VIKDbs0/ehbD8SWOdLI="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.0_1524835833357_0.3394574441096696"},"_hasShrinkwrap":false},"0.7.2":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.2","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-slack@0.7.2","dist":{"shasum":"bede32f954e332e7474d5508828fcd4b851b8b35","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.2.tgz","fileCount":20,"unpackedSize":94815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGgHrCRA9TVsSAnZWagAAqukQAJhpVGvuAEKQdTJzSz4J\nL3R8iUGWnDqOyIUIabF9qAkm1iFvRXFSTwC8TGQ0mUQxnKcBcNF8F7VUSG59\n9rTTgptzDgeupsxXqXxA9NuR6y2y2+j0Sfic3/Vr+k3GGSf7tWY2J5DBkBTi\nDQb2uVUHtLMna1gg5NKsRJdbv20EjBFgATxzBR+Z/XdM3BYSgWUMkHaK+2+E\nGGPw+9Yn9K/AvYy9Hhwzo4blXKRWBFLuVNz2WfD4pBYUkOLlkeARv5YUkjhq\nFJ4LmqgVxoSNW08OYNojgyruZhDhwwNUQoCJCcSe7G9yhZsgWTrDkAVbF0Uw\n4nmbtZcCC/PFU2k5eaDUCHg6BKstTzHGALn21XCuWweeKhVKfQ9GHm71+GAg\n/UiBFRHhKyU0JmZ/soccT1mfaZjXLpCFVTVCvFBzwvFsabfchuOyhlFmgUna\n+8e3c2H3etwcGXB85vFnaoWja9/7d/cqog/4KaZA7LZpOaKakYwpgfY5Za2R\n1AlchtQr9nq+dep63tFhwYhT+mNbFCOzh4srf5If8sIcndXB22xw9ehtbvkM\nGlXH7F+wJI3jPEnacNGygUHOsJX5u6gFNDvEE0numUqOaRnEYykGOvUVTmqP\nHPlHdGNN3yZzK1hP8+QA00x6qSzxfn/qNLPXhsVTFK5rNg6YX9X7cJKzMKej\nkt6a\r\n=R1lB\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-pFHR0FaxtcG1IYAqSE9hoehCZzWGVQQE1R95eErMUAd1rwzHFgTZkk+5tGMTYOfVtrhhJZNwfwIp7Z+X40ePLg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDG6j2nZJ4MsUSNTHa7tmVLft0yfjGDvg4ryyvfkKKgSAIhAPk4TbhZtnNfcZcg6xB6b7AhLrknp1Bl2YTX1jAXSG0g"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.2_1528431082089_0.11810994442260347"},"_hasShrinkwrap":false},"0.7.4":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.4","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.18.0","axios-error":"^0.7.4"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"_id":"messaging-api-slack@0.7.4","dist":{"shasum":"87600efd18b950201017aa0d570c6b4474b364d1","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.4.tgz","fileCount":20,"unpackedSize":96907,"integrity":"sha512-mGz53GORRn9nFu4DWXo4/5oWPZym54DtoMqUeHkDyNljAU/0Jdlwt7wwNxhWR6d7U5Bxb4m0++KfL5PEYqK6ZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICz3IX7xjiJEWphpypErmEwS6jBkQIlvOaP7HIsKKK3PAiEA3tSdq4Afj6KjPUzbgtRCidFLm2A6gaMF3YH9MY9dPxk="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.4_1531368907405_0.432775657429856"},"_hasShrinkwrap":false},"0.7.5":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.5","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.18.0","axios-error":"^0.7.4"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"_id":"messaging-api-slack@0.7.5","dist":{"shasum":"be820bff878afdffc213153f91f9f8af1ded9bdd","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.5.tgz","integrity":"sha512-zsZEHcbcF4JjYa3TpOsFduiVtSZE3rA6MYzibNp+3f75WF+T5uiECmRseSlDP0ZiN/+Z+alN4vhhMqVE/C2eHA==","fileCount":20,"unpackedSize":97695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbZZoNCRA9TVsSAnZWagAATZoP/0XKofpKaWreHubFzxIA\nz0h3+LzloL19A15E101t8jQOWS8SzBAF+cHZmCEz9WGAlcFSBd/Xh45cQCMm\nSuRHg7nJeiVs2LXG8Sdq4yQLPsIoGLEfGXlCVIANtYJHvjsm6yy5Tgvrc6Gi\nypTooPOeUlSsYuQDFuiQaLEx/DoBnp8/F2BDJdhFqxzRCD5HPDsxGKYXMKGx\nXvnVJ4HV0SujPJn8+rn1sMww1P7vTeN9n1DbbujnKku20lq4dfmbPtsBb04e\nhKi62uxOhFjxy3o9VnKMWYc67J2aZP0TIlPVBJWfXy9G0cHmwt4mDCegGZRv\nkj8q4x3kgNwvQOA1YRIB1xDZhFoxHoZV7VdcdHXdyR7XgxbUIhic2UMqTlqx\nefDrz6fZJT9YTxttoSEt2HAGpd+PrnnpIbM81ZwZ0NUFKiDhGKj5GdoZIYE6\nhGL5Vat6d4s35JcCh6Iy8AURUaU0DWPnZwwoK/P/3TutW7l5Qssr3+lge4ik\nlRa+xbq5p7ACk24yAxBi3gT9IRJfkvspXZj7XBtzBgeWBnlOiLL8b/VQ7joJ\njiS5kcLsrIxOk+9aBK3EjxowCdkVO2Y00XEJlCPs7oY5xPN6sHBaZxbPME6T\ncwllSQsoVAmUKXfuy1JJA4qwl2RMcawuehx010ntI+Hr0tuJni1I5ggm3Ked\nZuDM\r\n=kMN3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0ExTc49UDFFM/sNe+cskwd09vhj6EWVUZZXCqfCr5egIgbmRSXVW9mmxmjkhDbEcNN4a+ZPaR9qNOAWh3+FYz038="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.5_1533385229118_0.3567024543376385"},"_hasShrinkwrap":false},"0.7.6":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.6","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.18.0","axios-error":"^0.7.6","lodash.omit":"^4.5.0"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"_id":"messaging-api-slack@0.7.6","dist":{"shasum":"77c849a00a920331d0018864ee038ea0461c2dc6","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.6.tgz","integrity":"sha512-LjSgEneZ0dNG7Pec3uH33JCr0Ji9hDUaEWwRCQXrEgAIxkd1B0wXP75OMnpyGnpEXTc2FCUbvyG9D4A80m3Ugg==","fileCount":20,"unpackedSize":125147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfl3tCRA9TVsSAnZWagAARdEQAJqCLLqk82IwfrfPcpPS\niklWD/SuGlk6m5jJNKgNJQFp3pszkoArEhD9X5IaGmTSN2+xURTEbfPyD/T1\nLnO2uxI+89th90QFdeHjXIRLWQ1KdVyWnvBw5FTgDrGBL57DwlZljEZiK9de\nH/borUD4aZQEByZlzLg4R/AcfL7DNW3yGnbUbJrRPW2aE39gsyMWJx44rZss\n6A9lCUauierS6ywI2qNZeEIHdlC6AGj/TTSWJ3auLSz7c5Xu7QptC57x2g3C\nte/2kPbNJRFsTEb8Ntx3B2gIfpTfKxFxWrmYf3dGORwcBHy1y2cekOEuaDLt\nr1MAR5JED27cyTBsvre0Bf3iGc+57UacckRKpScRs1EafNLMFSYVsHZSClNo\nStDhpctHKLYPAN0eq6OcC2OMEKbZ0a2/tBv4F0VYdAhGsVcEGqIzfeampVdw\n1nhau+gsFFaOwtFKmI+t91mEkdPfWk3nCXm/kEDwSH6yi2ZJtKF22XAtLJn9\nzX92KSpriiCvIGoi27priLKvlyzRuF2Lfgo9suZHgR6KJYpH4uKysy103MH8\nkRYMyClIIoSQBmhgbUwV1kqu3bafwwF/dQeAq9AIcpHYK8nVWchCZzSqiFxg\n0s3T5GMyE6Y9FEHEdFbvl9YWzqEUnxTVhVGFoacLPu7/Y9KRoyBHYNgg7wSm\nwJKC\r\n=SX0S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHOMQan3Hir7XYvJhUDjvqME8jjQN8gDPpfioDyTyaplAiEAxreyFflfu0Y6pZoqlT0VVy9J1r4AzkAPD9H5JkzkBkw="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.6_1535008236469_0.4393629542878754"},"_hasShrinkwrap":false},"0.7.7":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.7","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.18.0","axios-error":"^0.7.7","lodash.omit":"^4.5.0"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"_id":"messaging-api-slack@0.7.7","dist":{"shasum":"c4f2a4c00b0207af9a64645f1a0ec171d897db2b","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.7.tgz","integrity":"sha512-URLukweAAOuGurVVVvBif43ZtBZaO0ONsfbiTA7qMFEGu6mrKyNCfCMkYBjhTeV5uaQ+HAMw5PfHS0iuKsU4xg==","fileCount":20,"unpackedSize":125147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbnh6vCRA9TVsSAnZWagAAcCIP/0uI2ROw/xq2XqXWcObU\nUIbhIZ5LgU8joHalOnzHVJC0G2RTtbJWthX+iXfUHBEMabg1U1HNg2FrVdup\nH9ZQwCOxCy3e9FOCdSJYlD7fTR5msftU9G9mvD81Awpg9Lqr+9aTpz8rfrxz\nA11Zg2vLZAFSiH8qrAaexEa+v6XAIpUDIqwAvCKbeZunDCuYzg7pzXA2DCZl\nyNFG46gfQzb1oqAB7hL0RCjOi1mZn7UopXzSPVlV1YKlC4IohH6Rgb+LXJYN\n0VLci1rvDfV6urHb0z1oZvULLkJ0TZVG0cEREwDOPVvCn5coG/iSIFER+RCf\nFjqgrog9x8k28J/Psk6s5W6yWsteTgZI2iQ85j3nRDZKctP3ociu2bTY4x9G\nBR5J8dhKWfIfgtnb/LQ688VM3uh1+0CfbXlAcUTi4RzPpcKfYFIy//9NgKhq\nfU6ULcnppWZGvbjsbrHw2C+HA6Y/4gy45t8AV5TMP8b9mqYK5Z2nM2eq5aIH\nOs8fjJFmqsZghiqOTHfb/PAaB069O3cpMcNHlLcxTwFTg6pcA6UCtFVQLLYj\nkNOGWXwl/UY3M/KPb8oixoYMsLh1/On9SYiM/VVs6yk8x8t9OxpEbDsbe8v8\nALb6MxRKM+tLTuTxLo6qeiyfdlRE9D3AXMkMLpx5LEpydDfkVC7GFUPgNm8L\noFOy\r\n=lEh9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOkftwfFwEpHcCEBXMt+6m5DgHfol+v3HNEXjXHQk8qgIhAIq41HRowAuxp7erVkSlthoeVky6pcDaSuRXpqTL4fFV"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.7_1537089198363_0.07184589347129866"},"_hasShrinkwrap":false},"0.7.8":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.8","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.18.0","axios-error":"^0.7.8","lodash.omit":"^4.5.0","url-join":"^4.0.0"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"9bcc48ddb1c03d7fc0d883c5c8e0e5421cc3a505","_id":"messaging-api-slack@0.7.8","dist":{"shasum":"54062a665c9a7e468b7b1eebedbab39911d48db2","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.8.tgz","integrity":"sha512-h7y2u36kVZXI/E++ViMIoC28MbXOAWyFIgiK9vL639qBlv1DPW8Dx2RG018KlDgPk5358fuRx+2TQx0WvhFZ/A==","fileCount":16,"unpackedSize":135153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboeWWCRA9TVsSAnZWagAA8sIP/RVO+A9MNpJO+uJc4C6a\nx1+oiF/l/wEDe1FNouUsBJzH4sy7/7rf9gQyCbiBZRYRU1QcCyFI45th+dAU\nwLqVHpzT4x99N6FHl/JkaJuFTcYmxE//1qytYV8dqpBlzu9hDtapTGWSBY4x\nEd9k+YwkCQO0yK0vtdF3xirO5Rku370G50Jli+vbzVIk0Dkw/JlaRoclfV8b\nw2uAl1Yut428uVSkl/n7H6+he9Pixkx3rprzmzg1noJTicJclVFL168cG7gs\nbo7+KW1OpI766t/zdw+NA8/lQ1958Auz/UiVM3Ov7CdGAxj449kzBbub6AtY\nhMvTg8Q5tNoz0upfflVNRfFatbmZwZ06EcwxZTnvH888yZJiUmuEiZkQqkkD\n27qFqQerN0w3LIlOaFTkuZeIlue4wZwwnksBkoqcZFJq9zm02O1Yjp/29r4s\nEzQEHI2SdRmKCF6BZNZpQJm1wjue73vCgrwDjg0/Ozo8YMS0EZBmFYiVQcWT\nzY28kC744xyX9pPbHFdkKzl9+b+HLmqPBJPdOooXnfQ0OZ/9fC6nJotwWuen\noHSWeeyBmM+LeF0XFtzGCeRYuAO4cb6nOvQ5Fk2xAY068n49iYciamcLwG2V\nVPnL86nfasVXfJoX1eBbMWdmWIP5bcg1u3K7ToYIthI519Hpqgw+0s7QTzaD\npnem\r\n=Qw7D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVnHff0Nv0yRUNrex+5/UHdRrsltHpLt4Z0W5PLuhVwwIhALNc2vbariFvqfLT1aYlmhbeXRoWQXIqOn+lkPR30O2o"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.8_1537336725576_0.09448990866920215"},"_hasShrinkwrap":false},"0.7.11":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.11","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.18.0","axios-error":"^0.7.11","lodash.omit":"^4.5.0","url-join":"^4.0.0"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"8e43618226e9c46216372b813d24cae3bdf9ed9e","_id":"messaging-api-slack@0.7.11","dist":{"shasum":"5b0dc33ac876b3dc02865c49efcf53f30c2a845e","integrity":"sha512-T4d8/Um3L9TDGMvvvlFEkBg2DPLgOa0q/PQFF8J0M9CzvRT0QV3/8JW3X65Cyt5kt3j6whU40h0hHADCA9s2pA==","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.11.tgz","fileCount":16,"unpackedSize":135155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbx0xNCRA9TVsSAnZWagAAjeAP/RWNMA8OZLaQvX9w02/a\nVjV0nDhS5OHqSgK/66zqw7aEMquji+fZrCOUZ5BIIS2nbnci/OLUxAc41nUX\nNGcpKZlA3Iqwhz0zyWzkoBxT72DBvgsZ/Xr6El5vhE5385mcBrlfyiJ4AHhz\n+aDnMgjFRyHZsGPS3XfRixsFK0DC3IcK4Xs5Dt9xp638lSNnAdkEMwThbzZk\nD/tqpv38A+skVfGUlZC4MwlT8KBNMMeNmGdkzb8hI9pAAmAH7yXdJ0iTOcyA\nRRNrsiORDkgtOKs0Hy3bo9QAyB8dTN1AFPgJmJ9Om628QpCdUjXNVM2CTloa\nCnKs3IFz0HHYr2BOhzjo8lMkah94k6OM0go0tEIW249VY2XC1a0NQYbf4Stu\nxjZ62uiT1BIm9R3Y4totbApbNpxY06/XN/xtka2OPMi//vG6HT/6vhj0Uagy\nQQjuMsZSTRWoLHdWgltvASReskdhueR+rqEfsWn55LOJeH+RjZ1F0ugIzQ9d\npPGBfjj9G90Hx+DwqIJe4uPktnAB8eO10lzhhL21iuFuD2zSgZccnabQbmpK\n0pI5yMBJhHhtj7IN6OUVv5FvWqIXLXi/vZy9+OABXHBSm3zVYDGWieyh+Dim\npSd5JMjtscJyliX7oYf/gMmRlOpMdif6O8mA00Q/hty4OmdSBywVU0fqS7q9\nkdX6\r\n=FimE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZm/+n7CWnk6kO7jbBMb0rDF07lCkm1IXFko7GNRqRWwIgWBM8wpQ2XVdaz5vJ5qRi+TiHPqeCjpI1Pq8WbPiniPA="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.11_1539787852975_0.5521314018503494"},"_hasShrinkwrap":false},"0.8.0":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.8.0","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.19.0","axios-error":"^0.8.0","lodash.omit":"^4.5.0","url-join":"^4.0.0"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"62a2ec0cb939605bf01a6054b9ccce9f9bb8e1d7","_id":"messaging-api-slack@0.8.0","dist":{"shasum":"d1ab59d3adb7bca6004df9b8ca9f21cf1e860b31","integrity":"sha512-+QnCXJhRt6pEBhZjikR/giox5UbuJojqQXlIlsp+IifSTBIFby1jcngOe2bM4M578f7a900IRtaizDB4m90JWQ==","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.8.0.tgz","fileCount":16,"unpackedSize":135153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdY68/CRA9TVsSAnZWagAAupwP/04U2CfU6MbZ0vZKeyCs\n0sN9u8CdEw34ZdaE1P+LxqcyJHpIPo6v9BRoEtaDSlU7QoWRKWvHAEg7UG1k\nqsfyWtQ6BIeLdNV0lCyWnsJyr7MqrLUsLwqmqmHfDTNLV8qFlXbrv61BF/CR\nyZ1v9TOQpaJu9PTweVyKV30KJSNHnXJwDBIHUF6NOz94MjdD7m9sbj/p5zJh\nKyHOcEjQ0fvHsKo2tE5EwBGOKqZihrZsxP1t7XKwD9TYPgPYkWADt98Z5MMo\ndhJjG+iAbptSAx+seovMNw60sbrt8ysqOSp+pszGyXfdDZAarFDR7Hm8J4Xc\ncfSRJ+D5gBuKXIFOGDuWBMTxsDcrlKVjiAFJk512XjmdlHT6cgqB85r/Q7ks\nkypLWNvsurQw5gaDL5iu8ozEq1riwORaotAN3ajUWck14I6d+1KTB3hujQLD\nTaCZQH1kpOmZWmqXXjvig87KGs+AsNLXjl2qxDal8oKpWcnr1qepyUf0Hi+D\njOw61S248j3MSkiEj3Dgxk9X0VNtnny1K0/0uj15uTEgPdY89/awKLWZtSZ/\n/SJuKQvba6nSiqzMIXTIlpV2nr8zDndrAC3IybkK843ue/GPuw++7TVRemvg\nGtYSE5Vcp8xuG+uQw3g61NNsIol1xyDgdmGG5KR/euOVVpHHA2D3idj4b/tk\nw7py\r\n=kgzM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpkZ17uC+UEKqbCpRgJf8WwWBoLTn7weGCg+3VoQnAzwIgSHTGPf33Xa6Fu8Z99iN/NrnIx3Lf0yr3m17rcMvFP7M="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.8.0_1566814014976_0.3317546819294337"},"_hasShrinkwrap":false},"0.8.1":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"0.8.1","main":"lib/index.js","dependencies":{"axios":"^0.19.0","axios-error":"^0.8.1","lodash.omit":"^4.5.0","url-join":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"622f5664634c26e752e4e54bd32dbc773271390f","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.8.1","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.4/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-LY662YTY6x4Ctv8ft605MjOxTgcx9l2OHdkx+XSZN4uIvPpnkAD1tvflmCC7MhQ3pwnWG0XpBYaKYrz+p9dzOw==","shasum":"28b1e19367234d4e0913ba5c17e57b0c19e0d6eb","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.8.1.tgz","fileCount":16,"unpackedSize":136191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZKycCRA9TVsSAnZWagAALHYQAJpS0dNaR6cSPAH0mLU2\n7GbTSFQwn9WtgGvaqp1JWWWV7N8VnTfaea1TZVDBYXfm3EgbTwKMz5p9X50E\nzDrzS8Wn4YCDRiX5C12wsaYd/mnj8ZabPoW8OnFPhGBBp/rMhf0k6pJY/Vp/\nCAmYMHjvc1ZHL5L6HA2fNn6EcEp9zYaLW5NNUcIvl32y8jCyxT3xSbRUDW/f\n+OHH8M3fshKtOfFRg9x84ENZ63aQK1r3B1RXVvefotC5Hzf8dK5fRCLU6ZCE\nu2/QY+k95c85a8KxTKaEATyIgTSuViUQRLgk3/XNMqPykkKC/v3IUQRe5sJe\nAecrB7X6GxZS9YCJUQJpuZyi4hRAtosCQIqnOboRmCXypelAnj57vfK9gcZb\nkw0A3gkbtMq0Vunpekn1fER7vlOKboFySomiMbclspNPTdU8NGb8hNr1Eek4\nbNoHWP0QQS0kC3vkyjuaWKXhyJi5WKbzuR5BQcjXG6h4gqdY25TdFeJP4MS4\nBUbt1StcEJxfFEB/hygST1OkhfKgu/+vSxTsVM0z8F0nSAxW/t3KmvhuVy4/\ndB5TQmaglAGt1twRkL0o2yGqUdlGzUCH9EKcb3E96UaqBtyZqC7UkEoF01Zx\nqktiexzminhJLDj3VDpOTbnBXPKQjPNpP1WulSwOC49bOm5QU/7Q1tzIFTg0\nV44p\r\n=Gt2Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3ScuGINGm2Q2sU5zhWB+lJFXDSYJYVdWKJp0Q8Tr+4AIgBbuBYx+BFHqr7cquxTkIBqTTiIKJhwDPOUz6jLWmidE="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.8.1_1566878875799_0.7608709515601777"},"_hasShrinkwrap":false},"0.8.2":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"0.8.2","main":"lib/index.js","dependencies":{"axios":"^0.19.0","axios-error":"^0.8.1","lodash.omit":"^4.5.0","url-join":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"c17141765b6417272bfb1a51b19c0b6ae2c7137b","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.8.2","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.4/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-JiL5DqLqXJlYbAM30KjOHo9fUV3nIh4hgaHbcTf/DlOsuwzwNhjhowg0vP+T+mzQ9yWxdaSgI3C6UPQApzjwnQ==","shasum":"109ad200fbfb5d5795b5c8a865a404372f5665b3","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.8.2.tgz","fileCount":16,"unpackedSize":136279,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcLZACRA9TVsSAnZWagAAcQkP/0OOeXYRHlB32xJPDMuC\n0QNegNn6wEl+GsrFAAKvujfl40O77e/GMQW+GcP/FmVBzIcDmGIQwYV1wIof\nqpZCStzGlhQufABIQWHi1txYdJVcjBxtLueix9CY7KJRlC/iwFNZGbTyEdaU\nZdsc8xqv+BZUPcqbAago4/oBaOAhjDm8mkuJs6m4YxOWaQOj4PCBtf5Ty/Tr\n6wFdZL3ZZQkealN9uQl0Tiz3pgRrzg18AMGGBMxv78ZFgbGC7R/57RVF9obg\nHJZqa3FAfdF0S9Wxcb3VbhryR3ptL9G2bb7GTYMb7ofLCyaoSCI2hlDCt25V\nnkapX0AcHm9E+Wbk1yE0wCPkP5BUWKgbDEM07n+1mbAdHyArLOpxvF+HylbM\nqkfc5t3EEIT/cY10tXK5QHkoHX4fteOyh/PCBy2RD6GXTl3jLr9XCBN69ZkQ\nDZO+DZx2cFFVUhWs2uMZWP/9qxOBcTvvCmZaAMUIIT8dqjSWQezi/zLtnZBM\nConuDDl9Zy+DM5mKXrrLBZCVqeIT0W3837r4lZ0QjKC47e56mxDGQ8Au0Uar\ngNI/L8W1HIJCJa6lYFPIBJwtqac0Pudq6l5VJZzjHJyBkRXtPd7HEFSqXrf3\nfXCZqxvBaqXjB9hV64ABlmLjpfIEEuAgRZaI1MGAH7SjEEnt5Tb9+Zx5iFZC\n+V4K\r\n=OiW1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGb1Kgi87C5mnFTmzZriEbOKdPZ064EYM/7dhooHAlfoAiBu/Vo9M/9KpxO73NIeRCyPOF7lINpGJZx3DuFaiudi9A=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.8.2_1567667775795_0.6119362992757977"},"_hasShrinkwrap":false},"1.0.0-alpha.0":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-alpha.0","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-alpha.0","lodash.omit":"^4.5.0","messaging-api-common":"^1.0.0-alpha.0","url-join":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"67490b1b2e7e842f4d1670d944d58a2bf11eb1e4","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-alpha.0","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.4/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-roE61DMQ/TdNdR2otF3Ezd8MyKkf+U0WgO8C2rLPkrxx8c9KHvlWrC364UnP6S5xplFiTId52FL0GanHNyjC9g==","shasum":"79c667cca6d6265c1edf459a1fc662be801d3c7d","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-alpha.0.tgz","fileCount":30,"unpackedSize":250983,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdeMIzCRA9TVsSAnZWagAA/v8P/RR0F8kBqlJqPjbfyTa1\nR6Su11KQAIGpUQYn+xX88p7lFQp7NupONCtae8TYqypbElD1hJmcmYqIjmSg\nkk+I5aqPnWDnEWniG6RrNaPAH2VImN0aZG2mxdxmM4vSV3LmAYL9ZKj63s2X\ntD81TH0v9ZKSg2daMvuqUj5tISe/iiifppeUE0YFjnLHIbJpa+DfI+gYHE5q\ny5A00tCDMpMdVoFr8KpmBNVF4aqa32u0ZeySKnJ8kgclmmAVCwU473JlbuGy\nM7g/whjX0AgDjykW8Vz5jfGVl2BIt+U8FLUPql7HEU3i1jSNuELn9eOJH6y7\ncRNoPLc7KZcyl8XTN54qPHHhEw3Six5vpEJMzPHA+W1GLHAIHg2tzHwJW8H2\nrPRA4Vdy1VkJTnUM6g2kGgIEG06Bs1NxI83vOWZowQSuTgSFp6r4iBZQNX22\nAb9AGr/fjQwOIAP8udf29BGveYYxCAyOhn+9wkEcyM+wj6MKMUBcfy/LdxzT\nm8oJWriSW61pQbLAVB/R/MSwz0LK0YJZYg7hn/mFrNPkQttKtA89YbLGBKXE\nrjTvXoQ4wDcZqLjvodxRHN//Ev9zn0DV9N1o15fZw3s2pqW+VwD1jKjgbl4a\ngPgROWp/k60up1antk4jmKadDtSvPV7UoHFsM1n7sVJNH6+quzJcifNSlv6G\nvyK9\r\n=Qcar\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHeiixRG8xaa7iUAxG9yu5sy1j/ndOGNJcZCFPGsDWk7AiEA4p7o/CVSVu+5CQV4VcKBJaJlgf5zKPvoHA6k/2O3yZk="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-alpha.0_1568195122216_0.20708808838586146"},"_hasShrinkwrap":false},"1.0.0-alpha.2":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-alpha.2","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-alpha.2","lodash.omit":"^4.5.0","messaging-api-common":"^1.0.0-alpha.2","url-join":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"7581219e17a1b1d9ab2f600e14f75b9714dd6fa0","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = SlackOAuthClient.connect(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = SlackWebhookClient.connect(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = SlackWebhookClient.connect({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-alpha.2","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.4/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-EQ3t/KjQx3H2pWRKGhFRuFYjVjHT2IJDGh3jUyLhG4QMsinSqEWObDEeMNO2D1VQo4aITfx2kLEZtuvTQhfz+Q==","shasum":"adb3b27b648541a572abcb6f5ec763e4f4ef6153","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-alpha.2.tgz","fileCount":30,"unpackedSize":255238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlugvCRA9TVsSAnZWagAAlAQP/3XErRlyMMSHuYsi1Vu7\nRdP6patj3M/WfqZTm9qsE4iiujHh//hYxihnzPZtyQejxNwX/ltWfnxuHYrD\nUUuxRXShjdowDndjHNicZsW8PR5h8mwZWRgDHSqif3LLe5uRYX/RWqjhlB8W\nVQlpbXsXcArSwUiuA34O3QB1yu1pHgPpuUTUJITW9k42/BdQFHxXv6zPd2da\n3TZOrhH5JUz3cW6iW2gQK1kyOvwBsTH2JGFCW9WfSFYsa3Uq6HqNudM0+Cxz\nqLI8uXtV0htG5/q9XiQY01zXoi9GYh3WdSganwMW7KDQpM+ZRkL1OIKkenPd\nUnwWk6wNajkSAf0BB6CanvglZmkOCDTVkzKdLU4feVEIw0v/CFQyG0g4wl3m\n9CLdqUslb4Ago0GxzOM18aWn1NA2lasLMBwqaoWvdRVng4pesFMrK7Ium0hM\n7deNk3hHOyy2TFfLEB5MpBg2OiETMJPv+8D0W5TnnSvDxLutmKwMk33UneXd\nCQcwiQ0+CLp+/9+OCdQKuEEBE7Mj+672l2ey9w4qO96mYKBa5UW3PgnKVWsp\nTZ6Aj83n2SbyBFrjPxrxDvLKDXxHxbEYr9+6Q6yK0p8aQihe91V51JG0SbXW\nsxjT4UlfvfHX0NM96BVeuxfo4wiHN5aAz7wIXAvAydmLg0hwXV2gWCQJ8GhF\nGxmR\r\n=npJ6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSK5o1+wQKIqQMoWKALTEX5ZVPPU6VtYlYrgn2qapvwQIgKeMtnJqQtmAkaQSabfqD4S/ONJEb8j8rS9FjUGQ/h9c="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-alpha.2_1570170926695_0.46426980681793495"},"_hasShrinkwrap":false},"1.0.0-alpha.4":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-alpha.4","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-alpha.2","lodash.omit":"^4.5.0","messaging-api-common":"^1.0.0-alpha.2","url-join":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"3ba04ffaa1a5c9c7a2aedbe21242663adec99166","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = SlackOAuthClient.connect(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = SlackWebhookClient.connect(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = SlackWebhookClient.connect({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-alpha.4","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.16.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-Ykl0M/N1inHLy8r49qOSBAYhFZkOMoDSKav8JPKcbG9cmG796fn2UsoqaSnZMtjIfjS20UcAI+mmnDlykuObdw==","shasum":"79ef2684d5b906b2b503e430998a11d3999b93ac","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-alpha.4.tgz","fileCount":30,"unpackedSize":250847,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdyUMJCRA9TVsSAnZWagAAgCUP/3xM4vakX5wkEo3bT6k4\ntQpfDT4SfK6K0Vn0rHk42QFirLwQhM88U+We3ZYBLUm/hYS8ZpawZxx9l7QC\njqdXigQintr68e7kUYBk4iD6WuuESZfk3mxTnfMcsIoYJmj0mnx72m0ud1Q9\nBvmiOj2YaqfGg8sLW0Z3vIJyxLyoXnZ8Gzvdbugs/nTNc8GXCWM351NjTWlK\n7+lKWRO6sKT3tyG41RXVlgAjxHi+zbCNUzRHxmPsc4eUFA+jhyzC1PFNgybb\nBSlga3cs6Qzvh+8ZWnGCfDUFQQmSMZ79fZE/hL+za+JLwPFuiXnfpjTJVVFv\nyfIdpqtEr+QbO+VvDBqg/C3vzp3aQvPkEzMAa5BxThNX5jmib2pAmeLH4NHf\nTNOcUAoeURlg/hrMsBS8UAr1u0ZDG1e9vZujc3CpL6ajEMavMsein8t1RWu+\nkqbpslJQVtU945ro10jGURXzdsrsvdFZGwBvseK1A9cJrMatRxbqi8VL7cdn\nFqtCeQcgowjutPOe5TyXFdILVOZ2+XT+3PXWXNwc0rab8DNHu3T64LUT+RpB\nTndL7+RNHLe897iPpCXNXnMEL6aCC4FgbCu25OEuzOvpTtJWI/p/winGTQAu\nnp34pn98EKuQIdVxKXoWr6D7QixwEfJiyFYujsPU6gh9+gKAYhebsljzCWzz\n2TlY\r\n=77ih\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIClVwmYeCYXPst/yA5zzOI0yANIiCPWL2OLmbxcFCil2AiEAxcKMpMeqewbIqNUcwkxToVzOg2lgFEZgvFEJ4bHh6z8="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-alpha.4_1573470984804_0.6954907608789647"},"_hasShrinkwrap":false},"1.0.0-alpha.6":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-alpha.6","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-alpha.2","lodash.omit":"^4.5.0","messaging-api-common":"^1.0.0-alpha.2","url-join":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"7e2f8be9698b03e5b16a58e6b6ff5c094d514e62","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = SlackOAuthClient.connect(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = SlackWebhookClient.connect(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = SlackWebhookClient.connect({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-alpha.6","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-KgRPCBboBqBg0H0hvaeWbsxIF/65/Gtg2twxylu0mR76uPo38GwQW5XSnkqNgCnrb5dLkn/92E4fPbfKKrO4/g==","shasum":"fc73d2f25180150f0e30978257a5e6802692fae4","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-alpha.6.tgz","fileCount":30,"unpackedSize":250926,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdyUj9CRA9TVsSAnZWagAAiMwP/jxjZ/1FFQCjGEnk8Cif\nI7g19DwBmRIqgGBnbjMBeSZvBEkY/SjKvm7E/nsGTRnzRU1nzw4BShAdgN13\nETTo08n73RhHKDfiX7uaeEAKWWyw9w/oXmiYsdR3JrRuU5TqbEfBlEr0zPVc\nQaXFfGRvdGmPxoO6FsDm+J2X8WCInFWd0kyvkZWdJ40EaDgV2J3QiYePhyVt\nybEjwG/MDzEsX4cJ4t8arIqLJvik2yj/RAMb+KH/nYsVUKcyRQMjBFxi2I87\nK4Of1VZLAgT1KaYF+ARtUbtS0MP7EssR3fAzjayp/U1oIJTzttoPUuPnJufR\nI4mCsFrCEFXlO9g9KhDZ1loXM8t/V2gqIU9efOoh0LBlEpKC0gt/0m/oejCO\n8nIxTK0LcXulLiH6rH23+qFCs9ELvTJKEOx9MHsxi/HlctzFzBhPHkSDvfj3\nDGdNwIiL6VcGQpntEiPdvkSMaMw8w41Oo/0HunS5kXu0tKsF1bbJzFJByDQt\nKzgt5Q7Rvj/9ioM6Xlu7Me5k99jMw4WvtHgfxuA9UOCwnrj3l3uEN8rxZLVK\nhYyhZSSRstcLkBLh8fGB9YjP1YB7UeOa6CzucXaGK6MTZZMa6t18wYfnxftD\nAdQAqx6wg7ysC5TT6cn/hA1zXka8zK6f9pV57Mzhct/U2Yn6NB7MtI5amXej\n7icB\r\n=cjNF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH74qEYkrWIt6ylbJba0U2fdpwYVmtRcs3G+f55D/vtaAiA7La3GWICcqRy78JSmnFEerQNyNo3Hcndc9TX5aSxBHw=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-alpha.6_1573472509139_0.1234358642616531"},"_hasShrinkwrap":false},"1.0.0-beta.0":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.0","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-alpha.2","lodash.omit":"^4.5.0","messaging-api-common":"^1.0.0-beta.0","url-join":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"96eaeb0fc0b1bf8799d17dd93aa4c59f1eeeb0f3","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = SlackOAuthClient.connect(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = SlackWebhookClient.connect(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = SlackWebhookClient.connect({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.0","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-AW6QdoxRknbrVaAIx/WXj4cPsLdHqIILLwq+o+bKwJ/705QqJ+hcXqRM3gO+BpGfuMzAeVx2KjCV3w+hnAiH0A==","shasum":"56520ab2564a5b7e198d1d44bca80a36b9c12af0","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.0.tgz","fileCount":30,"unpackedSize":250924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzP/4CRA9TVsSAnZWagAABFcQAJnvU9xYcpNDQ0mH1e/9\ntgm4+ckfX9Oh7yX6a2RI7OJxX+Z6V86/8Fx5dlzLib5lz8morwPXJOxYWBLC\nNTKTc8pezoEya2Uk2eep4msDnZ8EIO98QmqN+ik+acGPEofYXH3E8L8hJJUw\nXmDY/VvQws4vytxylr6U6rg2LdSB0KzHwPAoReL/FFnyjrTuaDp3pPxsDurU\nTav782rkSyQDCkQB1qXK30Hipvv3AS1X1j5bvPUS7zf0SF5AGrcOo2jkgpFx\n9bJ1MJDpB56XZwv5VWISbvL/Jfmf3FNSTEic3LiPmPdFKtcMK/n34ymB8nfU\nGQ0aaTSirxViyV9qnQVXq2YAfCTflfRITVHsjGSS1DcmMloCFjlq9+p2tP2x\nRc8KUb0Nu7pgunv4uz+cjiptPvdIAyPu6ToOWjMwDp1a2yZJjf0v3PZj46bI\ntcNCp2Gm7GjvN1wpr3L7nZ8J6dWe1b2XzrC8mSgR247ZsdGIgj2yUcjj2Xg9\npNs0KWBnwnwXits35fuLC9jTYNq8qMO49sj47pFAqYRI05g0BO3dngxV4OGH\n3fE0jR5+wZr0eb0hxau2B8YraCZ6c8xraKTkwVbQH5pVVYxJeRfNv5RjV2GM\nHXBKNdbK0YCn3XRXjbKJFg84ndYOAkOKliHsoGl5w6iwtEHZZO2/MxYyACQz\nE9Zo\r\n=uqaX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKlfznj7AM39aAqwo56I3U5KIPYKsUUD7/Bzegs4PcrQIgSOHr5uMspPGvGztGBxSRGSAkkhkBSH9cEs36pCNqtWw="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.0_1573715959978_0.8614500585659728"},"_hasShrinkwrap":false},"1.0.0-beta.1":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.1","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-beta.1","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"c92c8cdb79d62893a7c07f5208a5234f7bfc00cb","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = SlackOAuthClient.connect(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = SlackWebhookClient.connect(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = SlackWebhookClient.connect({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.1","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-yw+KzRq0HIQPi0IHFUYLwYKbrFWTP4nw3/7TMBb5YkbTHLd+muf5cDyl/lbRWbz8NPty983jT9fmo1Hkv4ds4A==","shasum":"38d1ebb4cc858a3cea48e7ceb3ffb83c796e4741","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.1.tgz","fileCount":30,"unpackedSize":244807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd0BYQCRA9TVsSAnZWagAAtvkP/Rp7dP4LRJm+hFlAxsWO\njBJ97l5d1dXwsHGIFxFrfgsfJsX+cHvtoIcBWs2ZrTj0sttML17FPOJjPqFj\nlLK0mZxq2jwKPry7gmLUQPsTTg6TUnlz8P4fz9sOOfDWtcgi97sCurGFPnlm\nYT5W6xRFJwD03ZfYKW7BVtipwixhdMhFuRIWj+nhRHrLRBnG1DJ08O0nvFDt\neXRVqGyRlIZBTMCIQyaRrFblAg407nxlL4uoaGIKoT5/GpIb1LF3o+Ne3YO8\ntMzvOEG6iEoz84ImObCLqhsJ7d0e502W6E8pY/S0l8hr2dt9oHKBhxwnaQMV\nMrl/Osk/f+UaL0V4txhMybvXl3PckFrXmx/bsiYMH2DrxbAwNVf16daKcEu8\n/PD9ndvaURwOayydZ+Xte/8HuDV12+TtytulSK85sezmOZvpNCR/Q/+Ib1q0\nka8UVeMPYc/I1mXlLH0HvT2OeclUiFHz/L3jCV+A40leiqsjQ6wG2/BPAFWR\ngdX/0nfK6fbni0JKMTylg7n8pCY3XBPCVTsDsrkKSFDek56J1XRRrVWcNij8\nGO7R8YrMKOqCPl6vG3dgsxyPYtFpDv/H5x1cxlg30+mjADun911Ravbr/mI4\nWfximQl7Vqnl74dwMcZPp53GnCSVJCuO8vLzPJsSIimLX/jSv/I+fGXZzG6E\ntDaA\r\n=GoO9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcTgpdaJEW/rKKwaCbKc4wx/d8d01Pyt3uuj44Ji/dagIhAMcCKUCieCnhCXN4dNaJ0Li8F6RlHL+RO9sQN2AJ+ZYz"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.1_1573918223643_0.34173159175002565"},"_hasShrinkwrap":false},"1.0.0-beta.2":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.2","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-beta.2","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.2"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"142b0193efd5babac07cf7280545f7ea202deaea","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = SlackOAuthClient.connect(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = SlackWebhookClient.connect(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = SlackWebhookClient.connect({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.2","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-1uVe+95CPW8orkoaFBR/EKrbCl3pr9e7mwHIeQfd5j1hwaHZzOdXdgwtSs3H7qGgUoANvJEJusGPBSSznrtICg==","shasum":"8bfbde556d676911f4a58c64b938a2f8be609e8d","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.2.tgz","fileCount":30,"unpackedSize":244807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd04OwCRA9TVsSAnZWagAAxEAP/RuyiwRTOohtZGuQs9ee\nJ4mwn5unEompLRdmwJQYkF2mcyg/5jOCT+s4xOf0GMY6JEZwhpUNVvZprLof\nZXb9Vk+DSB4nl6bXbxEeojGus4ypPnGVKEvb8Sh3C4dhGjAaXW6sc61eBerI\nEpuuSt2LMQmSM2OJIkh0Kx9pKsZqYFh/mreDEHUGHLDhfKmIBQHujU/w6s8I\nFeht0/9Lvn/TB/riN8pgBgZctpbRAkcRGsMxbwyEtcAEsshDM9z/bmvZbPvm\nZ+URrWvYw2PQdQI4esEHKphUvefiozifsrQ483PwdE0oWGcHBJQQ58OkDM/W\nrZ17WIt4u9Z3ATQIhEpBxMALIMzzvyaZ6dJIG/jlxcbYLw6sOoAd32X0mv5g\nk6fx02pZwn9RlTAYCD38Om3nsjmteUuYd1Ipv51nXFdC1M9qsS1Q+r+xxOqr\nExy/ccQYg5VqY9z2k0N7SGVcyCueHqS64VurjwIhvTzk06ObMGLg44dVzDnc\nvNULqRHm/T4nQHpR9kKAoPt6B3Y2dH4hkBvOd7RF/utnrOvd2cHph97MgaSB\n5nXThG9jG+YgvyVrM/0o5HASAfc/ikMiWqQPUvZ1wfaPAQAfBkHa3840DFwO\nHLJWC/Fh/dgtwBWwzXTGEk1JI9xACic0+q2Z02usT+sTx6RDU95r4evlum9F\nOSI7\r\n=cDxa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXZ8QSg/+l+xCvEDHV6R9ZR5bLPKZEOi/L6faZVFW+LgIgVHbUB4SY1SrSRVX07XDfEd7/20ukF7jgApQVKT5AmUI="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.2_1574142895952_0.26501603978339694"},"_hasShrinkwrap":false},"1.0.0-beta.5":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.5","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-beta.5","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.5"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"701efe776414a93d93d709198a72fc80991f51fc","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = SlackOAuthClient.connect(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = SlackWebhookClient.connect(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = SlackWebhookClient.connect({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.5","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-7yn9uLobehJfXi8pcEp3M5W+y0XAzH9u23CM+qXG+XeJ9l+pZwqENkFmfJYkQ/1b1LdpLa3YBmHbjpgPN2xLEQ==","shasum":"a2ab613bc2d9a26eaa060e3f01bd07de0c71114c","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.5.tgz","fileCount":30,"unpackedSize":244807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1+q8CRA9TVsSAnZWagAAUr4P/3MvZlz7ExztZ2aUxn0E\nz4Gx0VcRUXNmzNwRqd0w4XmQ8gNH1ZGv5aZI2Ek1lZpmb/GIj7yVSL6rlnTk\n0VzsTc8f4wPwHcNFJoufxiBeTMO8SARuzO5qYtETu79wbVw3chtZToNlxLHw\nWAWi2zmVMqyuexVpIO/p215sK8EWvZ0+WBhCjev3RkRAvK2U6CMTcHhNSCw9\nKBgh7wqlUc/oRUJzPeh6MLK88HrhIqzS+YU41DtP0Hvnt/lEjxVjybcg7euA\nKmScEEjatpu67zckaSA1oxjlvO3iLi5TNzlFQr4OahIcchry6o3zDsGbj8od\nhmpaBxhzX6Q7poQG00LxKLqQe5Emw37gC7In62uBBjmZwAACuoq9DOy54B3B\ntMSVKvnjVu/3GhLwJGxZiezXJv5SuatMgavuWmXChcJ/xlAR/ReK31NZPCK5\nidj9L7NGGno5UP0DJ5pZf1rxPefpaWlFIfkcII9LhYa6MYY6RypfaIjppT/B\npfgs3N8xHt3APq0AuSafGbzvPLJLLAQ53NXGhXtoRx6C80W29+kCvfiWuR7Q\nkc988S533Q/gDTBXYZr0vg/Eed+UaQ9houo38riYI9T2T0ROeIZZJ2TEE8Nx\nV2Cv5b0xli+LQjPCrqcM2OiDJVPeoDBkeObxJRjcj5elwb6vf/6zo0j3GEmf\ndFN0\r\n=KPlA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDEbFWHr/rwERDLT+nDZJNLbDaTNBeRsiOFX0dNelnQ+AiEAjqbzK3sOn4wyePHNVfC5qr5vRxfrJCBVDYH5XlbSTf4="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.5_1574431419723_0.8349730067501704"},"_hasShrinkwrap":false},"1.0.0-beta.6":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.6","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-beta.5","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.5"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"54fc93b7222a8a799de56f6d8282d1b0a40f9299","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = SlackOAuthClient.connect(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = SlackWebhookClient.connect(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = SlackWebhookClient.connect({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.6","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-Pvy/g3Sv5azQY9xjydM4+JSoIaY+mTFGRJFKvkRqxh4a+9OMp1sgfLxY/uTgl80lSuiMs6jQOb+g8jSKAhrOTA==","shasum":"79dfbfc08b93a330fe72737b6929d7c205f23ef5","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.6.tgz","fileCount":30,"unpackedSize":277209,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5fTyCRA9TVsSAnZWagAAh3YP/jt/bd0Soj7LmNnpRKmZ\nBu69k4D4EPBfvAJcwDDtZfTsL5hE77Y13QHSUVdPhxq7m8ldTaFSswwiIvKL\nxUD4gaTKFjNHzDThWSkpBKcmuOYhjkugx7dYOyaQ0CmW/0LMtdj8B5VEyUaC\nb3Tq/eqsHocOnUr4xl7CxeFXy9IlWQDDqG0C1EgP2Led62zTUHtWxVP9sotW\nRauhcHPhD9+PKuxIL3SlyE8w1oK1+pSc0J3jkww2ylmk8Yl0RHOr+GtZzNrF\n4rmr/F6TYH8rmUXXF0jjoaJB25u/4X9Bwp/GZxgNmVzBe8YBRWhfL0+hlBFe\noKiBV8TcugWXZBAbnvNqPo8i8NGHZLLFudsOKH010hKAO/98pTU/piGLAQml\n6l+IQfT1eb4YUTbBEzpyMuibH0+9wAdeVXBUA4UUxAF9VS5vA99WCkmQiEw4\n+tiiVZCAipLIPB2Pzst3uzEcC9Miu/FTijePpWg01Ga1hhpiGntgryOyL9so\nMoUg1+qPeYDQmBViZtwACWR5kZomA8/x8g1qCqVdI7H7pPzhk80+6bGsLahR\nWavYkM87v0fpGEmJFcvU1t8T9xLyXa185GnGMBhwdoGwS0PVFqXqDTnVOISP\nN1ndIFBLhG1XY9bBtUHc+l8LVgBAu7tRjd3qL/kVlo0e6k+nBMi6lAjHqapL\n2cl9\r\n=mO4y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCU7Gs+1qnNunmPL4EsvwPMBRoN1AM6QiFqRvYrDUJ79QIhAMzNyLpH/MMaEuXZ6Xqv1wAakhcQiEIEunksgvHG1iaA"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.6_1575351538036_0.5071582495531703"},"_hasShrinkwrap":false},"1.0.0-beta.7":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.7","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-beta.5","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.5"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"12133719c7ae1266347c3f6111873fc80157bbdc","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = SlackOAuthClient.connect(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = SlackWebhookClient.connect(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = SlackWebhookClient.connect({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.7","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-lOMNllEclsD49uuFukH7XunQmNDQF5YsGf/o+sGWz5MT8FLyS0DCAYHcVL5JHu85XQYkM5RTaoXpvE2o7GRYxA==","shasum":"4f2d5ca11e9cd61dba93cecb3ab914a81e07614e","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.7.tgz","fileCount":30,"unpackedSize":291684,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5iJgCRA9TVsSAnZWagAAM0QP/1m8FeNiths42RJbo5m0\nVYgoYj47XZeZ5qslnm9Lnz3/s1uxwv8YFrajUx+4iJBBezjhj+H/f/FUtwM5\nY4o2oHYQBLh4NeP6vbv8wWTfNkyiSODy6dZ0oPAgypMzRvwddXQpgTnQc/gT\nMmIt27ZytB1np2uMBk3lHVUp5qiZyXkmuHFUjLtpfxvfQSyALYIGmNrLVRev\ni/Xpkmt8RhPIY5i9XWqPtx0MiXc0jRa0KaIrqXv5FxYuVJ0rmvZiHyLxN3iB\nRVXYbrKz1kgOaYH3Qe9XuWU70UjrVjZcLKYI7frLa89SA1S/4FVJHevnE9DG\nRTzW/uwJhrSyrLBV9zolb2jhEo8J1snqyQU7wGmNPMisZlDUHuVAA/b6em35\n9dMhB6IPDscaqwpnoSo2u+PnFDlhJD7ciR5ssLYgHDCCt67sn8QKUDkT6Uw/\nAs3CaFxYacZu+mmuCxWjWxWSW7auk2tdLAT7o8skgvFHD38JvR+TZYbQomG6\ndCHfQHAMB0vMe7GeSA9Xg9SIFJCLC7is7XO8DFGNgn/dIq5AaCyDG53eOnRg\nQwD6v9vL7fto+KV8JV+xZXthruQldPsK5UqT2pzJVSYADnPe9RcbD2E541QZ\neXWX7Au+rQ9mO/r8yI49zHIVL7mgtYppbz7wisc9HQklFCiSHCANh2fl5k9h\npc3/\r\n=7kD+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIm4l/6YqiEPvg2RcwpQjCNvz6CoDRlxSa0j9ye0VdYgIgN+M5yi/4FSMdvA6WTXxYxEVAG+vg36wFLJ4sOjJivk8="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.7_1575363167433_0.9740329265462284"},"_hasShrinkwrap":false},"1.0.0-beta.8":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.8","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-beta.5","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.5"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"73897bf03d6a3b7b066eed8bba6bf2033edd7435","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = SlackOAuthClient.connect(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = SlackWebhookClient.connect(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = SlackWebhookClient.connect({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.8","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-CTyusRjEz2FntA6Uwk7s+KtfFgho5ojl7hD8nYkM4Gj1kbivDsJM51jutPZqeza8rnxmUnsWkf1SErpcAoJWnA==","shasum":"a8c4c170610633062117a2ccb0d3d6ac0277114a","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.8.tgz","fileCount":30,"unpackedSize":295342,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6KPMCRA9TVsSAnZWagAA4DYP/RqZIYi6umq8/nkp2tw/\nb1DU3+b3eeSPsjZuF0qIMUDNGnZOL8uM1FaR731AhNOqD4xl6LVnqXulv3T+\nbDrld3ksFSeC3/8vE6Tdc8fsUEFBDpjgDHxlYrCQ50ufj0r/g/CYW0y8og0S\nr6qekWfVrufckUM6PmgEzOh9fSOBcsdezATuY+FqIb/4VVmLKjFkhHsKLHK3\n3PBzzNK5LrAfBSz9wrlO+K1UyaPg2bVfW0CgYx7f85UOP+CS4gdmMlsqXtmm\nWT4uU6crNUsapeqXoBq1jQCEHHOhCXvurByu7xQGDwJJIFnjYY3vMHl8NcqV\nLHhGsNwRgqMXjYNmo/TeYz0lBQz0H9oYo76M+wFJrVr4oDOx+KpNVdlu6rkl\n4Q82fhp98BSiT6LDk/dwuk5LnFGY/qQQdu8pmo6KcLqM6GJhz/zzvZ+3kmYS\nqWqlJTdaxZU6pK93EzTZ9XS2gMIvdZ6kwOmURguiyk8HRpzXrzR9oTQt/McE\njfgBftjB5dnuzFMXEeZlicnpvifUVrfSi0EHfkfQN4zbgM/56wgIH73nX9Uk\n8cKEkm0xUrDCqzpdt2wFsKuVg97W6zQwjyyMZTLUo6OI2mEZGgKjSMi+cY/W\nCiyeeedktYrB650wycg67r1lay5EhdJuiNiOvJwuaQPGAV6lWXs0w721rQgj\n9a+k\r\n=Vo1c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF6sSNCrVRspunJNT/haL3e0C1l1GRtzLlxmDo/0ROmaAiEAjg1VaWcqeUfZ6zkZ1oQhNc03TLr6+gpBccnZ0MWtAfM="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.8_1575527372262_0.09485128091195705"},"_hasShrinkwrap":false},"1.0.0-beta.9":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.9","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-beta.5","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.5"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"8663c6cd509a20e91755061dace7cb0f47248791","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = SlackOAuthClient.connect(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = SlackWebhookClient.connect(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = SlackWebhookClient.connect({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.9","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-Ea+7fj9Fjr96bsn1h3MiWcug4MCpEnTiLd5u6QxX23VqSVg3r9jVOFGR/GqY2w2F4y3Tiegy3VWjZxDPUl9Ejg==","shasum":"50cb1664734264ff14843d4ff1b40d882e8b83f6","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.9.tgz","fileCount":30,"unpackedSize":299713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6dleCRA9TVsSAnZWagAA5UoP/R/oxzA2ovo4M/tQoybV\n6jouoB3Q6aAO40DuoTSKsBLttp88WTVn78ZTa+FCnTwU15zvrYKwoheuW1MB\n+a7AY5hzAHK7BoP67zuSBDpB7zV1RrBeFvS4SV2YgfnI2d7LBliKqzBDScip\nJ946zAlCPmvOrq6p6ZeYXG3i6ZEY9CPEUCtzt97FFSwygh7th0e+4hlX5PHU\np344d7uV7F7WxdAMIRvAZMwLYEm3BVJEdxw0SoLDvfE37u57/3d2nfJ3taTe\nzQyZCGXAcDAnZohp//05kgiVwISJBQVkZ0AjtwqIOcN13x9rfC79M2Gj1oDu\nAaVASry2cFE3mFMoyN9V5kiUtdYz2mmnVZoOlmVuvHsygEVdbLOpdBNuJ0uG\nCnE4VoyVbGlfC1lvYm3EnCww+TUzETDNUY39HLRLGIxrLzQtoH43SLza370f\nWy48XHXn44Bu6ZhpzmsJj0qC5i8grZyt6/WsnQJZIkn+opemSBgd5TJ8HWW5\nJkgbeOrlzZPIMKFQCJ1/I8OeLivxGYaXrH6BIBLnN1p2N+SmFrSK+tWwBJhw\nS4+taORk+TKKbSaH0qQxxZoABGgGt+Fuoxxu2Mjl8hgTpCyNENw5VFFFWiNy\nnoDAXrHw3sVNXtl5c403FgcK7SbVdEFyDLiJ/7fdy04c34rmnjaUdYojxbeC\n00yX\r\n=1pZd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBlywSbwHmGVrr2R4WMw0XabdikxkNtDmLyjCUNNNRE8AiBHjLw4Gf5GpFRHCha+6ZuWHnIvID/2msa4Oz3PsNrK3g=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.9_1575606622034_0.2127094977802222"},"_hasShrinkwrap":false},"1.0.0-beta.10":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.10","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-beta.5","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.5"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"9ce7ddd82779b579beab4256d71ccd4599e6c58f","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = SlackOAuthClient.connect(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = SlackWebhookClient.connect(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = SlackWebhookClient.connect({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.10","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-L9aeVWA0Ajr3xM8vPjbYJ3/kDbH+BVl49k4tFjzZ9laJxupTuKekMWF8Dqmh5MO8/6XAAJa9aZObivUEFuy8iQ==","shasum":"cac527fd46b0e580b0b14edc967b1496a4325b0d","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.10.tgz","fileCount":30,"unpackedSize":298794,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd7cmbCRA9TVsSAnZWagAAqXEP/2huTXZImGpZSZ2EJjmW\nwgxSkpxh6dqJUocblRQo8giiyxSAVSnOWQAmJR3fukno1cuW6jLopOBzqAou\ntY++SZ95hBAXJuwB/8n0L2lwcTg4TptPUT3ouMbRSRioLgulNofioIdXJAQB\nmhHIsxrYb7H5ngK5UdMDiP0s5mRqH1jb/UJG6yP3q3QfYzjEPzRklz1ysmG1\nYIBY4UeomSOWh55tZMa9KFtLilRw0UZyEvD68tWbynYS1foG0ichJdgma7Qj\nPX1hP7BbcmGXMNP3LWD3jT/D4XGtPNCqhiL7Q86zEvc+VZakUa2MOVsLhyQ5\nsQWtHb+ihISUt5Z17UblvrYg8qiSCkmeXh7R6l4BwsFRVSZFW+1im9s1guhl\nQKwM7/WcVp285XhuxMak1v2J9kw3p1qgsflARWQNDxlFz2+X9qr++YM0w0eZ\ncyh9999bALX6yutB3lmjwxgl4TyBhwG0Uu9XXxT82U4vKJ2h5Q0TPbAvk5j+\n18fIUpMfZ2fd73ykxyL+2iVj4/DXBu8T+HAdllwRfua+4LNhzQJhDoQvliL7\nmMVI4wSfQ5xyH4/9g7JB8A2iXX703jQxJrjj/isMpl30chMBLza/E5bPtiKz\nNOo1pv8bkzorfrzloz5gP6So9o8x58fFfItvCGdB7rP278EtNEcNk6wPuPD3\nmvR9\r\n=Wru0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNwhOU+CWeMwrxwgNBOa/DFoSdYml2IHck4E7OruBVswIhAOZSm/+4LKdTVJUBC38xg4XwVY4unCZN0yt/QQemtOFE"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.10_1575864731405_0.9570003453416052"},"_hasShrinkwrap":false},"1.0.0-beta.16":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.16","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.2","axios-error":"^1.0.0-beta.16","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.16"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"e0695dde8d2b01d1a068f4086fbd7988bcf9de4c","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = SlackOAuthClient.connect(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = SlackWebhookClient.connect(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = SlackWebhookClient.connect({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.16","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-bu3Nyva9ZLWiSRMnGOasBk4likAvNWU4ZICwwD2if11Cb0emN3pQhtr9DBPk6/FXi/25PQ+f/ZNeB9Y0pz5+qQ==","shasum":"0a509b807d16771e2a639f893fbec7d1a4cd0280","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.16.tgz","fileCount":30,"unpackedSize":298732,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiz1vCRA9TVsSAnZWagAA8OgQAKCqxvBwizQKeeQC9eve\n1RgDRA6MGKu2lFdcz3Fwas6qwgGhEnSV0D3MzQNy79t1EAbyf3R7WoYuPnSz\n7L5eJ+osSJoqmzT1peDob6MRWmjXEWRhoXVXnw2MmDhTQsUKELtDwrcYE1HV\nj5aQiCXUoJcuouaIrYm+pLBQdQgXUjXMDDUvYLrFtKgG/vgLM+r8bzWiclki\nLCpTBw4vUjRrsosGZX0zjXqG9fEO2TQ59xjuP4TCC+/dlLfUgwBjX4npXvOR\nNNFaNa2hxFZK6sHlYRZX2JUX1e7THoA4Nm3YcASf2EkmO6ZsbmEP+GcMnfyp\nncB9su2Hgk3nnoUVCv93pYuIF6XJykw6ecRua+qSZD+5ns9ust7cmlNZ/ygm\n7fpeBkzFtzvFZgQdJtYoQm7FYPfrmXeJGSM/3d0KrwANPFxWoLTc6NPmTfxc\nUU02XzGr+b3Ry9r2J6TsKZA9IC7MRWq6iDY7HOtzSjbNDh1DBjOJbJ7LZ777\nwcNV/optGAqlDtqCVSgcmR1G3y55Imm2MXCInJmQ6jJsP5BqjeC4p5cAkPyg\nQ5nagodK3oZRovUL+1ANl+qH26xYesmoA/YA3Tc1HY41do2jX/gwCgqkJnSL\nzvKoJrea73iTiw3YR+CwtpmLGJmvDdbEVY0Ur+Y3tSkZQPOZIdRE2zVmFV3Y\n6cX1\r\n=Iic9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqEZ8rnv1iBqNwMIuOQ9aT5STVflEb+W7Oyb4YwCBlzwIhANFfYbhJFwEJNmkt2DRSzVltMt8OYSCnZbb2lv4yYEmW"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.16_1586183535521_0.003659102938986969"},"_hasShrinkwrap":false},"0.7.17":{"name":"messaging-api-slack","description":"Messaging API client for Slack","version":"0.7.17","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","slack"],"dependencies":{"axios":"^0.19.0","axios-error":"^0.7.17","lodash.omit":"^4.5.0","url-join":"^4.0.0"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"e5228dddac20dde2da47d053653b68013ceb3974","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@0.7.17","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-ZF4t3li016W/Fiwvae+nr4A1C5hInL5nSZoIFHPS9A3KX/LviPcRVMkHtz2Mizarr5pXZnPXpiVctFz9zyNqvA==","shasum":"376913e5b7c6fdea48679ae6e8a186c36231db9c","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.17.tgz","fileCount":12,"unpackedSize":121632,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejV27CRA9TVsSAnZWagAAYOMQAKUIA8PJ6PEMJrMbhAWj\nn22KFezRMNVv5t0OBU3pQgbVcuUY7GKkoa1Q1FUzQjWpZvw7l15NuNAFHF8Y\nPLf6FYYrkfn6u5DSenhc4TA3gf72vEJ1LC9zyfL8kxmkZ4QzPkVKwfB2XZWb\nmFCdD8t6WqpN42Kc0rqUWPU2y4QxgqJpC0f7ajKKb/STokcBmLvyveAUR9YX\nXMoL2mv9zFFc18SGvXuvBRkPZqLEr2AHxaPEM1MSrgSG5gYBnwma1nchjThi\nGDB+2wLv6U+g7regxGIV9oyhYPjzACkvcYCv+weRsjaq75QMM0T8QLdf2n/P\nmqkmWXcx0yUbActemDmhWYpvDbQIHB7wegeobfmSMhiOxc0Jxd8HDbvHrVXR\nY/GVei4bjbmGOiVTjS/L+wGBMD51KJPrhaUrdfz+mc/Hw1YfgA5691tuIBop\n24hr3g5KYKYkEFQ1QVv1V4KGlkd6RFR1Ef+sHK1DQAJ8QQpak+S1IGliuHUw\nVARR4rfdlqnKZFTgOkF6imKyam6a8TNYBSI4n87Wko0hQST+8yv3fOzgHShT\nKMcBmlN9QWPEYdTFbm7oTX8AeDVGFHUUEmzhKX7rTI6PZIGL1P1yRlVUtmZk\nBTv3F8l2NszwQ/hGWsJ1EilUwVdUIr1P/lLZd1nCtVZP8xSpl3INJp5quYOH\nI657\r\n=79XI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/bSBJaUx0/OZqQmpP+SOclWXFTrf3xg4n3c0yUK7URwIhAPTZLR2JRVYEi5ptVo19pvcw3JwOL41T0IuAQ5MT8m9W"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.17_1586322874782_0.2830329266639351"},"_hasShrinkwrap":false},"0.7.18":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"version":"0.7.18","main":"lib/index.js","dependencies":{"axios":"^0.19.0","axios-error":"^0.7.18","lodash.omit":"^4.5.0","url-join":"^4.0.0"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=6"},"gitHead":"4318450a056e285e70093a80fc0bf79910665642","_id":"messaging-api-slack@0.7.18","dist":{"shasum":"673fa282fedd9b7a6b0ce150f86ce2634450edcf","integrity":"sha512-/5uQzXjtV61yJjSvX9rtIJQ6Ae1FdkYkEvoeK7FAQzweFIGYHlbMXar3yLCJrhmAmjmVVrc8xjG4ykXWIqvuFw==","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-0.7.18.tgz","fileCount":16,"unpackedSize":135155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejV9XCRA9TVsSAnZWagAAXUEP/Rz6eRih3yoIhOpt35gY\nD+QoHSbrjvMIYxXfI5o0KHozwkMLQ4/k8P/HKz0DGv6gxy4NlV8kfsgIjpYX\nMYk+mV2rkOFstKo5Cfv8WE3klY1JsKm2/VegAEVvdeh5TdjjnUjUmpSYs32h\nYH1WHE3geSyJi6AtD4l+ZO3Gea8CmJfdCfA9+Iq//WI8VsxfqSy46yW/6LNA\n5qFc/DLhwQlysPtch8843KPT9qeHgusNgO+4CiWXPVWxFkVGuh4Fx4+x8+kk\nlp+pBAVyUOabEC/UB55Ikw+Hp6sdIvxbjGrO9MEDV4igimO8+aZoZ4YAnmq5\n9udrDL5mk8etLgzW6H1zRugnMXcQGXjZY+K0ZVfF3G131l5ekCCgJGiGdp9N\nuFS3EpqKIjEHnjBHj6bE/4D4+xpQubW+4llixNr3KRyIPY1guXEeyGjH6vew\nxSPwuHmnqLKX4FUPQrhCmQksnc8vRWHWWgFzgjMD2IVE0jtVLaHIBOSgSt52\n8m9Ar8XN+LgxZsV8D7EJH3Z7Pwc4cVw1mqWCMqp/9JlEPEzBmONWz/OrNgR4\nt03DSaMQXuGmBD+83o+S9MoPNv511a61vCgBI+zXw4Tq+ZQpMKkfjNJ3TwB5\nauX6XTnq9A5GI15dwucaTS6ob/fid+T9sFnSWyU/isxwSoNUfjr2kfwX8HZV\n8+Nm\r\n=UjJG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBFbRRRM+GuG+NqvEKMkAQDunqUmd4ERkiUp413Tku/BAiEAj/1+esiQpylvQsNAsIa9+9KOcBtgMyYC+bFUOBRsdhU="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_0.7.18_1586323286715_0.43208767777150947"},"_hasShrinkwrap":false},"1.0.0-beta.23":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.23","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.2","axios-error":"^1.0.0-beta.16","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.23"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=8"},"gitHead":"5de733d62d61798bdb1d4b19b363bbe216b324e8","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = SlackOAuthClient.connect(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = SlackWebhookClient.connect(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = SlackWebhookClient.connect({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.23","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-B9maNXTIXIoJNpXOd/HGl9goOXVbTsZ6+8k3JbAFF8cgdEhKZz4IMTlsD+upW7wJp9zfSesxKFTd3Jgj9UsXPQ==","shasum":"e2ed9b9aa27bb7e9e5680a87d4011bc7080180a3","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.23.tgz","fileCount":30,"unpackedSize":319382,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewlXCCRA9TVsSAnZWagAAV1wP/1OTCJAiRSuDoMIr5zS0\nHDfN0fQn1h+TMF+shWdi+NNImxJgUnB4/7JTqoaSAVzBYUO5BOkzVGW2lise\n2EyXbJN6neg1RILMkyoaqWUv4GQppW27ETNh8yl1HOkshMyfdYqcV6X/ttWs\nAwoqgts0O8qRm1p+79VpZ8g7VehI9bE1XsrmLdggn8DfNhw5nQ/Ff/aSm6gU\nZoO+3Y5+r32UrlXzQESDTl0R00itlf10BsdbTFLQrgRt3MMcAb479b0tHGT9\nAskys7qVrBbdNFcg6tiOc9HW2keWerMNlRD+umoUN7gzzfuE1T2hFxPbQhqO\nhwEG3AWJ76Bho0v9m3TuY7jfc5X9fmfBG2FwjwRGmzPk9WYu325P2tJwo3Nh\nGg+Sf/nLR6ULW231SbmOGNINBjjiHvmxCtlTeo4187Om5BibzTcK6eUmeb+5\nzJJookHqj6rYpjvGWDyIWi7FYV9CG2PTirKkEsH3rHeU6JHP2fQZdu1YhVfu\np/eijp2s7zqhoteMrOSrk4rlg5kN8UTV+SerzEbfd5jKSfjJDOhbAeNxmwau\njtaAv/D2Fraih4AKCWlk5FPB0iSt97dQnfostgFKRp9JMeUvL+Map2Qhyczi\nbRioUXhqRZ7kdURrJ4+t9vj8BksKzekvft4oWGLdxLuiH61MT9ufasnvsa6m\nw0v7\r\n=VJ97\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHILnzhh10QXCsogrgx7NLL3169h9NBHLsX9pyTZXEiXAiAsMpo+IHrETpcEwODEjO8YGfQjkEAV5iWOS/EZVxS7nw=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.23_1589794242355_0.9462535092330848"},"_hasShrinkwrap":false},"1.0.0-beta.24":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.24","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.2","axios-error":"^1.0.0-beta.24","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.24"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=10"},"gitHead":"18258941a920ed2aabf7b12f17e10e8c14238c15","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = SlackOAuthClient.connect(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = SlackWebhookClient.connect(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = SlackWebhookClient.connect({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = SlackOAuthClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.24","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-bXanMVR3niwIr7STC8CGxYWHbfB7ZVkIvDaAiToC1tWMnPuTmBiT+3DPBY9QgOKehlEYm7dfpAobfKuc4Ps7gA==","shasum":"812dd4b00c0a1ecc515b7ab9ec0180a150a30d49","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.24.tgz","fileCount":30,"unpackedSize":319386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4dEOCRA9TVsSAnZWagAAZykQAJMeD+9XKoLb0Dl2FFxY\nQuDoPydZ5g19+bU56fDetDedyC/t4KqzPeyPChdaZAGwDSqX3Kep8qlXjf8+\novdiusgZpeWwjjzRNNpAn1Jb9fR1OTHlCk2rhvakgDpBDZnxsCV+BuoTrzcd\nLEhiPRZXYexI+DQ4FQ9Ji9dcHcRy6PG+mtIeyyd/QLbBRJv6ZrHLm12SxRjE\noNSprhWoRXJ642Er/yLKUR+sQape+qq/ZC+XmoEInJ+0pLTCZRm/A1U/cTRQ\n3zNrxMnlSWAcAzzH0IdTqfm9g7yK6PIk14Y3jXhJm+oP5COwgh9u5z2vTYeb\nNUun8e7/+mVsrMSdB2ZpN4gHCFDwZS2NauhIjuqjSNHWYr6D3MWWZd6Ywso3\nZHYIw55e0gvozmhlbrBOy3Pbjy5/arw7QaK74jHD6Cry5Z5h/Q+2vCMA5dQj\nOyOKiYoe2h/vPCnWVjsX1lpQAaCGUhVepjlLYosL/6+zI24TVSbxXtM0i4tY\nMvTc+xbgk+O82FWg/2fL7jEsZx47Jn6DVFtsYtWvxx9cpmCAKswI7o44y08F\nbJln3DtGNYgWvJe64PhBZjF/nTJBLDmFTJhYnuf7udbziOLC+ifCLy27wAJN\nHRTP9PEQg2x6eGrveuenQhchV6f3WrNFPTSDe+Mdc+6C0541VPh8lK4y+79M\n1OTY\r\n=D9VQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE950nA9X0rwplgt88oxsbi81r7LBKVe9eSNwT7GcCZYAiADnu0Y6yycbIBVyutmbPx621uo4AeZJGb11ekyYy2kGw=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.24_1591857422309_0.6239226927062262"},"_hasShrinkwrap":false},"1.0.0-beta.25":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.25","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.2","axios-error":"^1.0.0-beta.24","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.24"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=10"},"gitHead":"5cca124548cbd6d36cafbdfb3ce6856fd338dbe3","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = new SlackOAuthClient(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then(res => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then(res => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then(res => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then(res => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then(res => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then(res => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then(res => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = new SlackWebhookClient(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = new SlackOAuthClient({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = new SlackWebhookClient({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = new SlackOAuthClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.25","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-tuT5hwY49yxtTH4ulnocClsvVxIuOk5gaV0eOviJRe4tlP9FHyBWGEZnoftP1ElcE05ODOiefG1FRGI9nbuKuA==","shasum":"63dcc67948d7a1d0df1cf927c66a0a966d68ff2f","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.25.tgz","fileCount":30,"unpackedSize":324910,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4hXXCRA9TVsSAnZWagAA20gP/2w5pWjJVlSniQX7FZQT\nxScUiBCcivP8XYtDyqgbNQQF23NNfXbWiHxWLYlz3T7jdH+50rnDgRcU6usm\n8S0eyOmQmxIdEN5OFwrWP0DlAVvcnfr3rh7dlLR9qSUH4vajnCSzN0YmXbdR\ndyGnDBI0KLvvOckep+eSqroegKwCm/sTqABtliIr41vtAG5c+PoSZAtTrCKA\nnhLZKa417KnUuFj/tmsuLfUhhNL36ZS9I+bQ0sS6p2lEakKvjuJe7U2iA1SA\ngaYals8xRqJz2a7Ci45noQ+iFQAXaXyK/E3Pjg5LCTGCKeo+KzQ1R7oeCG50\nywtKWJe5qw6ZbU0774ZscQc69loDRuycPCQjwdwHf4Js8/tE6hAZK4IcVZ6X\nMCCxGlT09oSAIMyzSmxhbVZYa2oepQSCEW8SOs8w+NRdbg26oGztxZZh9wRT\npWuLKXCUSXGnkD7cPbqSz5Cw9E+dVDMth7Nn7r913zJ7RKowjVq/ccYgM8I/\n047EaQZZZnk5UEZJIsb+adMpwLzJv5/JJ458q7JKCuvWybuS6qPOtIEs5oGs\nY/pQWdZ4XPeVlc5nEacplRY27yewoQfmSoB2Nq0k3WiVDPBtpmNwwpHb8Th0\nzSNTHf/6XrIMeo3XkQWyQ2HWfXvvUI+pB+0yHHfJCm1mytiwpRLg3i5jOzMC\nM6Gz\r\n=zCS+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4SKeXO57Tlw4VPVM0/RU/gxO4rbXlQdCLDdfbc8GxqwIgWWOlrHzpkmJweqS6skRQKpapHgH51GjSWFxhBKGoDs0="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.25_1591875031016_0.7253921815507474"},"_hasShrinkwrap":false},"1.0.0-beta.26":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.26","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.2","axios-error":"^1.0.0-beta.26","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.26"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=10"},"gitHead":"a22b819aad9b425d5d0d2bb45aada31f0ecee42e","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = new SlackOAuthClient(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch((error) => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then((res) => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then((res) => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then((res) => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then((res) => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then((res) => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then((res) => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then((res) => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then((res) => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then((res) => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then((res) => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = new SlackWebhookClient(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = new SlackOAuthClient({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = new SlackWebhookClient({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = new SlackOAuthClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.26","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-rB4oRJ5sb+SkNARC8bVcd62J+dBl3Jg+uzuCxecU/WBylcKZvqG2a/YK1SwhH8iJZ+cEVCPFP+FQHNqpq7J/xA==","shasum":"95f86073256e33ef17bc95b5f1aeb079b601efac","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.26.tgz","fileCount":30,"unpackedSize":325046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6H0rCRA9TVsSAnZWagAA8TsP/3CvDDfvxTWtBkeT0D1x\nKOQaWbPRonEVNLJRDyMwPllyL1MC52rrKNIeaDI+kpmgeFWJrSSkmDU3RlWm\nMeB8aX7hILKOA30/FPSFSUc9pEAF6GyyooLlp0kktUezieTERwCzjJsZf/hd\naqXa6HNBuGWDF/LiUK0jrXzbAVdWvN66/M/oW3zX40XnEywTu73TfDKXK6dy\nJGqGD6skBQVy5qKYrPCoTZBmRHo/EbNGmJpbSDsxnW/P/82JN0wSdQr39/TT\nlry5wDUC6pgDtQcKJphh1QmO5GIOLxDkxgllagF5GKqgnaOd29cdfU80GGQK\nizmjZ928U/+EQiO399hySFdDUtYUpFqR0n//4CDLW/W0s8bylmeTw8mb/Ufu\nd17fMBoZOk3hiX6O4ZhlilSMr9JkQbR2o6Ln9HqjD9DTBzjLuC+DqrS7lOmX\n95n7E8jN8cv6oV2N2gVM8XAHCjB8zilP8d2YwN5Eu7AHNP6Znlpzj8Lx5cQD\nvEP9zPqjOO3Bu+i1NlLM2gHve1ucJrcjG2oGB8UG7GxU+20L6GULG4GVTDIC\nS8Sk0quHOq1JVt+QXZH3fiPVCWNCC0FiUP/NBRAKjbMNTlCgvlP1luphiK3z\nFLUHBTgnV5WiLaqkpRyexQt+rzOM434nQY4sLiMNBgsWNuK4DRssyO50aItl\nAZMG\r\n=I7SB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEQPVcDD8h0bCWWNwfmI5kSDhzPw+beuOBdKju6fJgBwAiEA+X3z/IL4nSErY6U0rASPqkWeDNp7rdsaoHBFSpr3VmE="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.26_1592294698847_0.13166699741653654"},"_hasShrinkwrap":false},"1.0.0-beta.27":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.27","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.2","axios-error":"^1.0.0-beta.27","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.26"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=10"},"gitHead":"38107f34a63c32cf0a1c7994c4c39a2d6034daa4","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = new SlackOAuthClient(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch((error) => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then((res) => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then((res) => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then((res) => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then((res) => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then((res) => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then((res) => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then((res) => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then((res) => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then((res) => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then((res) => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = new SlackWebhookClient(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = new SlackOAuthClient({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = new SlackWebhookClient({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = new SlackOAuthClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.27","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-+lllA+cL/k5FBe1gzXlQIapDG7eBBl1zXcEc4zZgMrWd/J9OUv55GsILLf0OGIF7mdcyddbvuEaT7AgmiqqHxg==","shasum":"824487efa4c700aa74daca52223de741e1b42e6e","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.27.tgz","fileCount":30,"unpackedSize":325046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8ZepCRA9TVsSAnZWagAAovcQAIzP5VUSaY78XgNeT5Ap\ngVwhIwgKZvfDqz+APPdsAVBr7JxEvJE9jmuvhqTbgdzK8oYMa64qfiuO+HSJ\n2nPMfSOqMEFvUtJq9iWfs0g3kG/DkZfdwgP96UlnikHMc/NOWSkc6dS15tbq\nM8FtXjrgAEh0LYLnZ04NshB8CmmfRnLTOtIX1T5N7OF5Vjq4jeHSqIrnN85V\nQR6K8HBg2EwhEfEF/9GMWqjN0Hr3967eTtDUhMkdLc7M3Z1dpmgAHLMlTqey\ng+8vHZRzZf+sLrc0QKoaHwxePjwtZ/clyPZwKRWCXyFOD7Upwi/XMfaWowmy\nkStIoGASPKnaLmHNrs6eAg7fl5oZgCfBgWl5dV7bP7hxVyGW9L7TJf4SpuBC\n7ADubB/ZZ+iD4ISF9g/3480eL8L+pv972AIjYyyvfZ8mQ0caAweMdkG6VimP\nqVz2VW1dDXJsg/tmyko/WKkX9OF6DWL0etdAKmr2UfIaJQK0yLuID0X0/d+8\nDQpVO9VAhl6kdAz1EHhsAbdPrfPP2trqdi8rgw9dViOroMT/ZEMY0AHgYo0M\nOllU/P6SWYvfKpk4hCax4nAxeABGZRjdxl/ZR0/P1k9TSXYelKMGbrHMa8hS\nGqdkCMZfFC9wTwTnXw9DjOxy7eS3jNtkk4pzsLkOVyD2fdTABeY7dyf8Z7Pu\nrJZB\r\n=L4rQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDOHWNfRWl5rGFr0LdvMh/y5pwij8FbX3KxFoAPhZMZKAiBG1aaOOMYQv08+hyQ0QjZoMOvbzgXEq0/3g07odZxGjg=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.27_1592891305485_0.629623424834975"},"_hasShrinkwrap":false},"1.0.0-beta.29":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.29","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/lodash":"^4.14.156","@types/warning":"^3.0.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.27","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.29"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=10"},"gitHead":"3389b14efbdcaf968ed7476820edaaaa95da0772","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = new SlackOAuthClient(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch((error) => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then((res) => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then((res) => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then((res) => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then((res) => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then((res) => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then((res) => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then((res) => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then((res) => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then((res) => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then((res) => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = new SlackWebhookClient(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = new SlackOAuthClient({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = new SlackWebhookClient({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = new SlackOAuthClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.29","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-rX/s9ZWJB8kANLJgzPGX7AZUBbBwPLGVkyPiGAn7cDS4BuOAGVDTuQE1U6GyzXxcmC/LtzZqveOTUwp4agSpDg==","shasum":"e56de603fef7373f1e69be6507c7e9d979069641","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.29.tgz","fileCount":30,"unpackedSize":326041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+W9DCRA9TVsSAnZWagAAVdwP/3Cgy7dySXxNCZlANMod\nhHERbZr7u+Vopx6TsaRuwqct/btzbwPjR7xwJwoqJu0i3L4ZuOQAVq+p1p2m\nFANc/DI2MgeC6wuzvvl3QWMGmDT3xH/AwRU7RUTZ6F6mqLfmdRgc6KQTOB1H\nN2C8z9SxAeggx5JlhNrsJ5tMmOxHOTKEa4YffK5gdE0AUqPTd0uUzU1c9Bz/\nCJ57R2Rlulorewi3SX3Nm9kHjJbSYC2YX07P+gzg4hUOOpGwWCKemX7+O9nc\nwjXkyFCX0Xat2gzHPyuMOWeNgPW/xsU2f07rMUsOCzYIeCuVOD9ZCagXpaFU\nGY/Cb/X0xWGRIx1gGzzT+vpzZxVPGC5PiK+ODJRMoL1XsGQdv/u97aFbOa/C\n9PVom+x93v3aZ+czhibrG85kuoILi4Lgm8PlqvSZvgDJ6XvZzZAdcPjLxqT9\nvPhie78N4yt0uQXpg6fQOMVxPWuU0elzGgfpJLgFgVI2LZAgKDYw+xWGBnul\n15QfQHYOmcrCe3WHCPguAvQ09qqry7SiroXjjf6hBJCCGqtRjtmEsMtTa08U\nXjrmYai7wE9d72oozVbQsKRJLmfcL/BoyEVvku5ufwu29Bu+da5UwpiRWpvC\nWDri5MNjpznYYqps0fXIpm9oxeE8GuJzAOPyqX31UHGXLtaR1ONmrf9dq+ER\nF5fT\r\n=XR7x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIENhtG/PrAKXC616NhBAXRjhbQNdN8w/e2K4TcfhY3EFAiEAviptzAVj1dpzJX3AZ/R4dDOMwi7/+QQh8nEvR052ieY="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.29_1593405250594_0.5083997732914798"},"_hasShrinkwrap":false},"1.0.0-beta.33":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.33","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/lodash":"^4.14.156","@types/warning":"^3.0.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.27","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.29","ts-invariant":"^0.4.4"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=10"},"gitHead":"a3f7afb4cef3784c3459f6be0810e0518b1bb384","readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = new SlackOAuthClient(\n  'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx'\n);\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch((error) => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n## `postMessage(channel, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)\n\nSends a message to a channel.\n\n| Param               | Type                              | Description                                                                                |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------ |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                         |\n| options             | `Object`                          | Other optional parameters.                                                                 |\n| options.accessToken | `String`                          | Custom access token of the request.                                                        |\n\nExample:\n\n```js\nclient.postMessage('C8763', { text: 'Hello!' });\nclient.postMessage('C8763', { attachments: [someAttachments] });\nclient.postMessage('C8763', 'Hello!');\nclient.postMessage('C8763', 'Hello!', { as_user: true });\n```\n\nIf you send message with `attachments`, `messaging-api-slack` will automatically stringify the `attachments` field for you.\n\n```js\nclient.postMessage(\n  'C8763',\n  {\n    text: 'Hello!',\n    attachments: [\n      {\n        text: 'Choose a game to play',\n        fallback: 'You are unable to choose a game',\n        callback_id: 'wopr_game',\n        color: '#3AA3E3',\n        attachment_type: 'default',\n        actions: [\n          {\n            name: 'game',\n            text: 'Chess',\n            type: 'button',\n            value: 'chess',\n          },\n        ],\n      },\n    ],\n  },\n  {\n    as_user: true,\n  }\n);\n```\n\n<br />\n\n## `postEphemeral(channel, user, message [, options])` - [Official docs](https://api.slack.com/methods/chat.postEphemeral)\n\nSends an ephemeral message to a user in a channel.\n\n| Param               | Type                              | Description                                                                                                                     |\n| ------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| channel             | `String`                          | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.                                      |\n| user                | `String`                          | `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. |\n| message             | <code>String &#124; Object</code> | The message to be sent, can be text message or attachment message.                                                              |\n| options             | `Object`                          | Other optional parameters.                                                                                                      |\n| options.accessToken | `String`                          | Custom access token of the request.                                                                                             |\n\nExample:\n\n```js\nclient.postEphemeral('C8763', 'U56781234', { text: 'Hello!' });\nclient.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });\nclient.postEphemeral('C8763', 'U56781234', 'Hello!');\nclient.postEphemeral('C8763', 'U56781234', 'Hello!', { as_user: true });\n```\n\n<br />\n\n#### Users API\n\n## `getUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nLists all users in a Slack team.\n\n| Param               | Type     | Description                                                                                                                                               |\n| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| options             | `Object` | Other optional parameters.                                                                                                                                |\n| options.cursor      | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. |\n| options.accessToken | `String` | Custom access token of the request.                                                                                                                       |\n\nExample:\n\n```js\nclient.getUserList({ cursor }).then((res) => {\n  console.log(res);\n  // {\n  //   members: [\n  //     { ... },\n  //     { ... },\n  //   ],\n  //   next: 'abcdefg',\n  // }\n});\n```\n\n<br />\n\n## `getAllUserList(options?)` - [Official docs](https://api.slack.com/methods/users.list)\n\nRecursively lists all users in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllUserList().then((res) => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getUserInfo(userId, options?)` - [Official docs](https://api.slack.com/methods/users.info)\n\nGets information about an user.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| userId              | `String` | User to get info on.                |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getUserInfo(userId).then((res) => {\n  console.log(res);\n  // {\n  //   id: 'U123456',\n  //   name: 'bobby',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Channels API\n\n## `getChannelList(options?)` - [Official docs](https://api.slack.com/methods/channels.list)\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nLists all channels in a Slack team.\n\nExample:\n\n```js\nclient.getChannelList().then((res) => {\n  console.log(res);\n  // [\n  //   { ... },\n  //   { ... },\n  // ]\n});\n```\n\n<br />\n\n## `getChannelInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/channels.info)\n\nGets information about a channel.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getChannelInfo(channelId).then((res) => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n#### Conversasions API\n\n## `getConversationInfo(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.info)\n\nRetrieve information about a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationInfo(channelId).then((res) => {\n  console.log(res);\n  // {\n  //   id: 'C8763',\n  //   name: 'fun',\n  //   ...\n  // }\n});\n```\n\n<br />\n\n## `getConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRetrieve members of a conversation.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationMembers(channelId, { cursor: 'xxx' });\nclient.getConversationMembers(channelId).then((res) => {\n  console.log(res);\n  // {\n  //   members: ['U061F7AUR', 'U0C0NS9HN'],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationMembers(channelId, options?)` - [Official docs](https://api.slack.com/methods/conversations.members)\n\nRecursively retrieve members of a conversation using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| channelId           | `String` | Channel to get info on.             |\n| options             | `Object` | Other optional parameters.          |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationMembers(channelId).then((res) => {\n  console.log(res);\n  // ['U061F7AUR', 'U0C0NS9HN', ...]\n});\n```\n\n<br />\n\n## `getConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nLists all channels in a Slack team.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getConversationList({ cursor: 'xxx' });\nclient.getConversationList().then((res) => {\n  console.log(res);\n  // {\n  //   channels: [\n  //     {\n  //       id: 'C012AB3CD',\n  //       name: 'general',\n  //       ...\n  //     },\n  //     {\n  //       id: 'C012AB3C5',\n  //       name: 'random',\n  //       ...\n  //     },\n  //   ],\n  //   next: 'cursor',\n  // }\n});\n```\n\n<br />\n\n## `getAllConversationList(options?)` - [Official docs](https://api.slack.com/methods/conversations.list)\n\nRecursively lists all channels in a Slack team using cursor.\n\n| Param               | Type     | Description                         |\n| ------------------- | -------- | ----------------------------------- |\n| options             | `Object` | Optional arguments.                 |\n| options.accessToken | `String` | Custom access token of the request. |\n\nExample:\n\n```js\nclient.getAllConversationList().then((res) => {\n  console.log(res);\n  // [\n  //   {\n  //     id: 'C012AB3CD',\n  //     name: 'general',\n  //     ...\n  //   },\n  //   {\n  //     id: 'C012AB3C5',\n  //     name: 'random',\n  //     ...\n  //   },\n  // ],\n});\n```\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = new SlackWebhookClient(\n  'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'\n);\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n## `sendRawBody(body)`\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw data to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({ text: 'Hello!' });\n```\n\n<br />\n\n## `sendText(text)`\n\n| Param | Type     | Description                     |\n| ----- | -------- | ------------------------------- |\n| text  | `String` | Text of the message to be sent. |\n\nExample:\n\n```js\nclient.sendText('Hello!');\n```\n\n<br />\n\n## `sendAttachments(attachments)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend multiple attachments which let you add more context to a message.\n\n| Param       | Type            | Description                                                                                                                             |\n| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachments([\n  {\n    fallback: 'some text',\n    pretext: 'some pretext',\n    color: 'good',\n    fields: [\n      {\n        title: 'aaa',\n        value: 'bbb',\n        short: false,\n      },\n    ],\n  },\n  {\n    fallback: 'some other text',\n    pretext: 'some pther pretext',\n    color: '#FF0000',\n    fields: [\n      {\n        title: 'ccc',\n        value: 'ddd',\n        short: false,\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendAttachment(attachment)` - [Official docs](https://api.slack.com/docs/message-attachments)\n\nSend only one attachment.\n\n| Param       | Type     | Description                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------- |\n| attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment. |\n\nExample:\n\n```js\nclient.sendAttachment({\n  fallback: 'some text',\n  pretext: 'some pretext',\n  color: 'good',\n  fields: [\n    {\n      title: 'aaa',\n      value: 'bbb',\n      short: false,\n    },\n  ],\n});\n```\n\n<br />\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-slack\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = new SlackOAuthClient({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = new SlackWebhookClient({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Slack server, specify `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = new SlackOAuthClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-slack.js` in your project root:\n\n```js\n// __mocks__/messaging-api-slack.js\nconst jestMock = require('jest-mock');\nconst { SlackOAuthClient, SlackWebhookClient } = require.requireActual(\n  'messaging-api-slack'\n);\n\nmodule.exports = {\n  SlackOAuthClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackOAuthClient)\n      );\n      return new Mock();\n    }),\n  },\n  SlackWebhookClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(SlackWebhookClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-slack` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-slack');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0-beta.33","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-oKPbsK87EDfMWsUVNZvFEdfpBxfu2b0PQ/HyAFTBFmcYgp2h/tEYLS7ocAiZ5LSXCR/3Y0W7KgCA9BlPnh+gEA==","shasum":"b03e9672f6db866deebaab535692da6fa2c40bc6","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0-beta.33.tgz","fileCount":30,"unpackedSize":324708,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfF9+9CRA9TVsSAnZWagAAEmYP/2HWo9PWyu7U5TAbJjmn\n0vqay9Wfq58SlLQ3Bc8JJ0sk+4VaQcr5GdBzermtYSclfZhIIC+i1/Kni+4m\nSbrodCtTKZSvumfXdgI3ffu9jCpY+FNgcJaua1Y4mIR9OtoD2Ckc3bzH78uA\nULD59/N35MQjK5nuKw2VlV5PnTwoV6BnVc+B90uQfbfwhkzvQv6plc9kaUCE\n/OtpmOIcB1S8yWUup9wW3fHYlCQOUGE8oYOBweJN3zdNXOkdHDyO2m/WEZJJ\nn/yaNK5FS796T47Mlm26ez6Q2pr8pdbp3bGjLhXqxldgoo19UHkwrdjAfnUI\nJLzqHgUrYgVlYp1pUExdEKpb7zcUPE1OZKVlff9ju9y8JYc5aRnsnedo6o3F\nA+SaDjwxKrwd43WVuliZBKLLNMzPAInL9uOY7ufmNoTcayvrTjDqMEKkkKJW\nwm8qCRGSlNPayJ8Ijkic73vJynpk7IbiwAerHUrQj9hpjgU6xZYoejwyBjRR\nZVPUiO6V21pHHeNFnEIbo+Vb179ZJDWfLVMfvSciHgenvbnBQ2FkA7y7NgqT\nKGkGwFLm8HxswuMfoNJ4qn6/PjXiSkxCutF9O1IIDb71euDPMKUFP6P4hO0w\nZLn7Qg5GOgP71UWOfK1wgcYNPrXwtZWCdkGCmoXcCfBeZ2PjY3sW6PtVxGbo\nmzma\r\n=tw3u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZWit1FOJdxG9TvXk6RgyI19pVAajxDYpSeSgKuBB7uQIgB8q3HJQOiDcJEjNzr+hlYjeCFbrtFJtVbMSHn6WIrtE="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0-beta.33_1595400125214_0.057591310283229946"},"_hasShrinkwrap":false},"1.0.0":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/lodash":"^4.14.156","@types/warning":"^3.0.0","axios":"^0.19.2","axios-error":"^1.0.0","lodash":"^4.17.15","messaging-api-common":"^1.0.0","ts-invariant":"^0.4.4"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=10"},"gitHead":"879afbd4bebbbb480dd5c1bd32e7cdcc5127437c","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.0","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-A8EsE+ZCTSxij3vdMkiDLex2arbSyedlwIOEqX8bMD+UEnmyEpMs9X8ofKOhxQWy2mNh0hijfP6GOA5+lt7gcQ==","shasum":"2e10bd091c055db29ef05b3d249f344e22cf7969","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.0.tgz","fileCount":30,"unpackedSize":321887,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVfVXCRA9TVsSAnZWagAAbZwP/RdRwZaBWkScLcnnwPny\ngYaF9BEYYdKlB+/4RgAal1QHxGoNRxx/wfoE3RJW1x6OCrO7juxOdV0z1yuF\n7py2jDz84dG3hQKIVdTYEqnddht4I4zCbuY4gSUd4xt9MIQxkvz7a51o74ob\nnUhirN4qn2lsiAYXHeTcANS2bdjI8iBRK+u4I38iqYCIpPIbDln5ujx0watg\njT2a/nMNo2OCiqK2EiAlaoWyW3uha1CGy43/Zggaj2Y6JRuhWvBz1sd5YWE8\nHNCiDAy7LklVSWa2zJanw6nyK2erE5R8/5L4E0msEab5G9E/PK/HXRdb1O4/\nvauPDTHdpbaBcIDJmcYE/1xKUXVbmP+f/ox7IhcLXyUDEB7F9WkJsxzy2VEj\nDhhdTK7eOs2+3xvWjpoD7dFrvh3BUcNBwToRvNKZVRt79na3m8EjFLrAEX6r\ncl2EZ8M+VqO8FG+YMghsRqI70gQ1Bkhbdfj+gKk92loLiCSPY20hcnUH9jX+\nkygp1DBHgJVDxLTfZKbddVTaRExgkNP+MzX4O/oQPNaqwsH6j2v6JBjbmXsw\n6/kmj6v5Qb+ghOOFitSybl56eL2hW5wfFdUSqJKlvo5uoVT03rmVK17d/Qsv\nvZAcatXV3JlCCcuPia7vT2lHFUgg/k7jlf2gZjq7cF+5Roz9nyDxx8+M+EBm\nWEs9\r\n=WGP+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHYZR5m1FZKS365tSaUXiWcV59k+dy1Q+JTsadh1MXSTAiEA3MZE8fvhFbkQ9MiDoCNmNnjAY/aNLDprcW++NgCVVd4="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.0_1599468887408_0.693186926995903"},"_hasShrinkwrap":false},"1.0.1":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.1","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/lodash":"^4.14.156","@types/warning":"^3.0.0","axios":"^0.19.2","axios-error":"^1.0.0","lodash":"^4.17.15","messaging-api-common":"^1.0.0","ts-invariant":"^0.4.4"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=10"},"gitHead":"cc72282a84bd6f2176f63bec462b15ae4dd37265","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.1","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-74AI3U8fWPsPDICVt2SX/XsqEPNacEbMPcdvpwhup4zcOy/UIgNn2t4V2k6bf3S4cG5kZo8v2o2ONPyLYpM3iw==","shasum":"2caa2b4d6c30c9660e1aa568a4c1058841d13275","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.1.tgz","fileCount":30,"unpackedSize":319771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaFDWCRA9TVsSAnZWagAAFRYP/AxPHCG4z8bEeiZhBgXM\nKeZEl/f/FZP4v7RI4CGb1njVwlHA8LwQurOK5EXFMGDloF4jXdXolHaVRN4a\nGJr71ZOENbeC+To2s7HtUsxwoGd33U6fBW/ZgbHN1A/syfsu1YoE0tYcxVjk\nFcbRWk/7beuf39JxNsTKQN70vcOFykgH8scfQR3uM3tvqNlOLv4pxXFnmfWQ\ndiXypVsAMBkDhtPuEmjvZgK688q8EYsDgDnMcGXMibTYWwylZC+tjjizimPB\ns3ie6lzdZf+dpqgcPMgO5rAmHedD/MBsiZlPOdoco3id5pzkb1xsG+ZUsqG8\nM6CRUOCsWH0WOsgj1XeWor1Uwqx1RHEWm8dDHQd4EW8IeuZbaK3a3/9fYGQY\nLMstC+R/R/ZErIc+soA68dTQ5rgwzl+6T5bvyRPBWxvUV/PdYOzuoSDOP4XI\nbijN+D2zAmldphZGlr2cn4QCQdJHOTd84r4t06h7jz7SiahhoSw43ruOe2XP\nCqL1k8GiwIAg5Yta0o/7wMauoWg+hNAp04PSL3c08ouyf+aDs3cR2HjVUt6q\nry3pn+vMAjy6wDVPRjwAtBTJ96u4mLiNFdkatnE15iRDEqcrKsSF110U1dxq\nuZDJ6foE2K+K6MA0EhGxsDLmG3S3/6oVto01ac2xs3xskWuwEjR7bzZt9MCT\ntZLP\r\n=bqD7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICDHWjVYT8dUNbdzgCZdSDEJ81qZMOvzbPaX0ZCyuMzUAiBQX6ydlJgUeRRYCSH4aYaTs/xfRBh4buozR5RRLx19SQ=="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"},{"name":"kpman","email":"s92f002@gmail.com"},{"name":"tw0517tw","email":"tw0517tw@gmail.com"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.1_1600671957588_0.34784560394410247"},"_hasShrinkwrap":false},"1.0.3":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.3","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/lodash":"^4.14.156","@types/warning":"^3.0.0","axios":"^0.19.2","axios-error":"^1.0.0","lodash":"^4.17.15","messaging-api-common":"^1.0.0","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=10"},"gitHead":"dcc5cc952b346b4f8c26f310b7c8a5a65e3c1cf9","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.3","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-e4nD8/CbB0bjHGadXWAsCZi20LF/tnQXL4NvGnqGWXC2ecgCmLBBA2LLVXoNq0MlQzcNx81xeyF+7JKE1QtYsA==","shasum":"14f68d21377590cd61fcf909d6733abba5b34464","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.3.tgz","fileCount":30,"unpackedSize":319796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjrX/CRA9TVsSAnZWagAAs6QP/0hXpFrxcpsYNMWiU6mG\nz/z7sc0fIxHFMEC5Qxh1q1si//rUQzmuTdT53My7uqetoTLHgBFT+rh3oRFF\nUzq4RggNVo0DMbUVIAYboeN92OYs6ZM38RetfeK7niHjPp5UahpuWw03QEB3\nRojl3/nWD5vD5vqWrM1Vbx+XDR1pqGlfRfqw9BGIPEdLVc7VQHSoHABDqWnu\n/u/ZJm6plChvjxvTk0XJpFLelt95JVcHdeAZGh4f+VyVs/klSo0L11qMcWXD\npWTFqH+zg4bz1aO9J15CPIUYaO1ZRqQBSm646XRnvEoOjaZq4rBzy8QkkQxf\nJdHuqIcMi+QvjzsCaSXiTmhxZhrGmxRXNK1lr4F73wbegGMU5Qo5W66Eis3B\nu5qYhWdqbhadM5hm92hHUih4CrcvUt7y6QzrFNfdVYgpaJuh6eB4fIIvQ7hR\nQTeOKc7kW30FuJW9+a8ukaysBisbP7/wEhqS9Gi26qwB36rCyE9EcClNk7l+\npNOlhGbOt9keE6QoyIqLpq4cXG9abF60TzjEVCOvnDUMvlD3JkWQ9wQZNCWl\n5cZw3MEt/3ByVuwJrASoHgR3a1OMj35l11t3XRQs2+adbkgcVxqSl+28/bQo\njAULIrs/G1NaAwRC1K7ts2LQdxpSM3MxDvE1PxKy9uffUGoKzIAdQZU5jNtP\n/vCx\r\n=jEus\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBr0Jys5RTrCrXyTsTt+8vtYWfZE6lJqkZND8TwMWoAxAiA8w//Cvu1ICwyLcooUep/q8Lz0j2YWmrnHTPg4ioAljA=="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"},{"name":"kpman","email":"s92f002@gmail.com"},{"name":"tw0517tw","email":"tw0517tw@gmail.com"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.3_1603188223240_0.06129826895862878"},"_hasShrinkwrap":false},"1.0.4":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.4","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/lodash":"^4.14.156","@types/warning":"^3.0.0","axios":"^0.21.1","axios-error":"^1.0.4","lodash":"^4.17.15","messaging-api-common":"^1.0.4","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=10"},"gitHead":"8d0a6e0549448e353ce90878b2fe1d71db1d0596","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.4","_nodeVersion":"14.15.0","_npmVersion":"lerna/3.22.1/node@v14.15.0+x64 (darwin)","dist":{"integrity":"sha512-a0+XXknUTxzMz4Tj7Sd89fP7S0TXszVYgRmBVHhlSJVAn+E9UQXkfyl5tnfBJs8kYgqDzQwlP1vavDTXdCTFQA==","shasum":"f11d3cf6453c7ed8e71ae6c277e403fcd4572807","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.4.tgz","fileCount":30,"unpackedSize":319796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf++q3CRA9TVsSAnZWagAAR8wQAI1fUZGhi/9tW5tSxBHq\nx/Q9RQgghbi3WTYMagjx1VlNdIl+tyDS9PTnbDmGZHBw8dgdEc3LoOxLkyYl\nW8rzq8ZEglhiPZEN38Zej8fC2BkgP3/b51YqfUIwZSrghhzlN2fRva0I/Vr9\nvTSZV1tCGV9gXiwFhoq0zIpb/Cfn9vZPpw/rB/keuiVlp9A8s56XlaAuM4DN\njCaKZSwefRVFVWE3+WCVu9+hHip9jasVx//vcrYe8RRXyqoTeDXLNmCa0Gc0\nNIgz9+ERqoxzcEu80jGlazjk9VKoFD1uz1HaBxsMP1C0lt+5nXLOhooW8B3m\n9zPuPLdqsFLH8zsFUzo50bisP1zleMzTQYkHr4du8VG+RU7e4CxVKdwSUPik\nRr62ZXHM6+7iDVOeC+l+MqtDFfS0kp5et3uG56m6DHwrnfh0iA2kKpGBXD55\n+ZNZqwjyCoNUvcfFsoWIhlCqNjp728Q/6I4bCou/sUnlBehF/zCWVfoFhLS9\ncel9aunHytWbaF7DJNzVk/oYdmCsBYVDZe11ar+pd526y6/SDus3J/pNtWHx\n6ZV+hAzIA07zwxsvekzEnc72EW9IjP2FRR/L7WQT01kUXgGInJC2vis333og\n742KLdCdPsZ7P9M/Jy8/M40zwT6L0iwWb3PMS+UZqY84vMiMW9OqEOMigSo+\nXcgQ\r\n=Afye\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJa241K0Uaaeeu5MfmdjE6hj2oYj96xGx9sto5PULW/gIhAK/Ywm2zUidHUSEAQYtsDAwNvP3/PmF8Q0ywDPyTuPiX"}]},"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"},{"name":"kpman","email":"s92f002@gmail.com"},{"name":"tw0517tw","email":"tw0517tw@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.4_1610345142793_0.11994325735405775"},"_hasShrinkwrap":false},"1.0.6":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.6","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/lodash":"^4.14.156","@types/warning":"^3.0.0","axios":"^0.21.1","axios-error":"^1.0.4","lodash":"^4.17.15","messaging-api-common":"^1.0.4","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=10"},"gitHead":"785284584a31f3c3a9daa63497ba7b0d6b7a2eb4","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.0.6","_nodeVersion":"14.17.5","_npmVersion":"lerna/3.22.1/node@v14.17.5+x64 (darwin)","dist":{"integrity":"sha512-A49Z+64mHhj42m+MwZiHjFti5A2nZtCv+DCgxQdBSKcG4oXwb3hHcXr0LNCuZBCPVJz+1XszGvHKf+LZy3+K5Q==","shasum":"26328c03c70d53ac2ef483bba0029e4bb809e166","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.0.6.tgz","fileCount":30,"unpackedSize":319826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMQrYCRA9TVsSAnZWagAAkZMQAIftJ+cx1OgXHkf6PR2Z\n8WZFfAdafebRqmlhq945jfSo37rgwN6roWoifxlHUHGuO/UGRH7iuXcGdwYr\nI2vNGh7X7F6q28JnPhG57kOq4znpzX7KxKbx9fZ2sSl9ntnr9MTG/w8Y7h7s\nLeuWGF4Aa7GyWMG/EZOVSe4W/qXgqgrjGDphZ7kMLWpCUOCdAd+ljJ1TS6SX\nzY17q5NBwjnqnOOsh1gWzM/g7paMujXPHHswtxTJvQNstLzUHNolXBxId0QL\n6NuMzuSM7AftJ/W2XTvoO3aa1ydQnUKVEkjqrZSb3Xqlucv+jzhTSuD90M2C\nh55vb1tYpuYjHn3FWeMlM0gPyukGij5B10z+89ItogmlqeaJ8ttLhKSRpMki\n0qfV0I5NsRapVVJpWHRkIBUeN1eDCCv4umhs3z0oNrFQmt3I/F9lsy/Bb7jf\ndoPQVZpr5XWVq6m83uiL9cdJO9sTsPm8pIDMU1dMsvdKo4zz/DgmprK5fQhD\n6hOceTASdqAFcD8bjvnRFHZXkN6ILJtaZ8S5sVMS7MIWpKOb7lm8iQGDeRsL\nzctYpP7pyMr/jC5mdGZZxrDV9RbWB8hE4keMrADpTY8rLgonUqiOT8KiVWbA\nRcq8EwwwMeNwEOiq6lI1E1l1T6bkcTffT9XvZCrJAGAIq81wCuIi6RpsZD5e\nmjak\r\n=eGZz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDWxE5xxtRflDH7wxihM9bJa2BFXwvP9bVAnluZA3qyQIgI48ogoS50UnW96LN4ynOpCTV8Z/KbBIHS2segAXiwSk="}]},"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"},{"name":"kpman","email":"s92f002@gmail.com"},{"name":"tw0517tw","email":"tw0517tw@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.0.6_1630603991892_0.010830940050882587"},"_hasShrinkwrap":false},"1.1.0":{"name":"messaging-api-slack","description":"Messaging API client for Slack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.1.0","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/lodash":"^4.14.156","@types/warning":"^3.0.0","axios":"^0.21.1","axios-error":"^1.0.4","lodash":"^4.17.15","messaging-api-common":"^1.0.4","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","slack"],"engines":{"node":">=10"},"gitHead":"7df9e3bba37712e0892f14895576c42c949d3003","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-slack@1.1.0","_nodeVersion":"14.17.5","_npmVersion":"lerna/4.0.0/node@v14.17.5+x64 (darwin)","dist":{"integrity":"sha512-n6i3s4w04mr3X8o+UfkjpKPOR97F6H2w/jLrjerOGFmSwEZ+9UpWED7SyTn9rd/nTihY80tmyghx1gxC+alByA==","shasum":"fb517f2828f2fa8ffc1733fb0682efc6dc21dbf2","tarball":"https://registry.npmjs.org/messaging-api-slack/-/messaging-api-slack-1.1.0.tgz","fileCount":30,"unpackedSize":249665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2zFvCRA9TVsSAnZWagAAjiAQAIIYqAouecs8gmeBngdJ\nh+0l8m9ZIZah1uLzVq7+RilxqqQBmn2ev6DdB1IavsB3YMvb11iDgSQHlhAA\nOTQbS+VBVUwskUi7XIfaoznMHguF0wUHfht98Dd1j7wGeFNADH1UmQLYvKLC\nUu0DSShXSy+dp6ZRaqdy2ngc+4ACS4UXzuq0hnEBkLl7uSJUAmc93gs09kkV\n8OIXokTzl+CvrshFp6vFf2exV0hX7fvexMMFV8s3wBWttnrXytzF9mK4YaPJ\nN16by1mXtAmwR7ytlS0Teqq25A7M9h8mWSAHiPzpUfNFesvP40PFmlvsXpZT\n0mGXtvODqsIDW2mljnTD3P/Zd5d+mHYP9vn0CHdgyeamSwD3p/FcXkyiDaXq\npi33FcnCFLDGD0G2gsMxHiN6q52V9Q4meB7HzUsTzar1R83NLaXyHhNvWVer\nGu9TeJRG5M+LZJ7ulp3X91r7yROzJY22R3pezk0JOuFyrzeo9wDEMYLxkfGC\np2cDcUulwCD7L2Vq9Xh8yeAVg9sKJbZ4qUtHGKwux5UoaoaMXyMmnju1yWJe\n339HkwPYXiZR0XbPHTuRG0JeHM6boQ5VEOo8A3j80yMWzkpnJqXusgj1hSL9\nRjfbCE1WXsvxozr6SKr0F0zbjIr8ldvFvTeJzhZms5DBeknpo/MZ8pBRleuh\nAKu3\r\n=kA46\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTELjg7wjyjxuTXXkZ0Pdxw21HO43eyAf3ap5B5ttt7wIgAn+5wJmdnmuOqHPyW5coOKxEcbEmuKYCBqDc1BG80gE="}]},"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"},{"name":"kpman","email":"s92f002@gmail.com"},{"name":"tw0517tw","email":"tw0517tw@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-slack_1.1.0_1633326870140_0.5018448254817613"},"_hasShrinkwrap":false}},"readme":"# messaging-api-slack\n\n> Messaging API client for Slack\n\n<img src=\"https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png\" alt=\"Slack\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [OAuth Client](#oauth-client)\n  - [Usage](#usage)\n  - [API Reference](#api-reference)\n- [Webhook Client](#webhook-client)\n  - [Usage](#usage-1)\n  - [API Reference](#api-reference-1)\n- [Debug Tips](#debug-tips)\n- [Testing](#testing)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-slack\n```\n\nor\n\n```sh\nyarn add messaging-api-slack\n```\n\n<br />\n\n## OAuth Client\n\n### Usage\n\nGet your bot user OAuth access token by setup OAuth & Permissions function to your app or check the [Using OAuth 2.0](https://api.slack.com/docs/oauth) document.\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\n// get access token by setup OAuth & Permissions function to your app.\n// https://api.slack.com/docs/oauth\nconst client = new SlackOAuthClient({\n  accessToken: 'xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxx',\n});\n```\n\n#### Error Handling\n\n`messaging-api-slack` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.callMethod(method, body).catch((error) => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n### API Reference\n\nAll methods return a Promise.\n\n<br />\n\n#### Call available methods\n\n## `callMethod(method, body)` - [Official docs](https://api.slack.com/methods)\n\nCalling any API methods which follow [slack calling conventions](https://api.slack.com/web#basics).\n\n| Param  | Type     | Description                                         |\n| ------ | -------- | --------------------------------------------------- |\n| method | `String` | One of [API Methods](https://api.slack.com/methods) |\n| body   | `Object` | Body that the method needs.                         |\n\nExample:\n\n```js\nclient.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });\n```\n\n<br />\n\n#### Chat API\n\n- [chat.postMessage](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_slack.slackoauthclient-1.html#chat)\n- [chat.postEphemeral](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_slack.slackoauthclient-1.html#chat)\n\n<br />\n\n#### Users API\n\n- [getUserList](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_slack.slackoauthclient-1.html#getuserlist)\n- [getAllUserList](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_slack.slackoauthclient-1.html#getalluserlist)\n- [getUserInfo](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_slack.slackoauthclient-1.html#getuserinfo)\n\n<br />\n\n#### Channels API\n\n- [getChannelInfo](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_slack.slackoauthclient-1.html#getchannelinfo)\n\n<br />\n\n#### Conversations API\n\n- [getConversationInfo](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_slack.slackoauthclient-1.html#getconversationinfo)\n- [getConversationMembers](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_slack.slackoauthclient-1.html#getconversationmembers)\n- [getAllConversationMembers](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_slack.slackoauthclient-1.html#getallconversationmembers)\n- [getConversationList](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_slack.slackoauthclient-1.html#getconversationlist)\n- [getAllConversationList](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_slack.slackoauthclient-1.html#getallconversationlist)\n\n<br />\n\n## Webhook Client\n\n## Usage\n\nGet your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration to your team or setup Incoming Webhooks function to your app.\n\n```js\nconst { SlackWebhookClient } = require('messaging-api-slack');\n\n// get webhook URL by adding a Incoming Webhook integration to your team.\n// https://my.slack.com/services/new/incoming-webhook/\nconst client = new SlackWebhookClient({\n  url: 'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ',\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n### Send API - [Official docs](https://api.slack.com/docs/messages)\n\n- [sendRawBody](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_slack.slackwebhookclient-1.html#sendrawbody)\n- [sendText](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_slack.slackwebhookclient-1.html#sendtext)\n- [sendAttachments](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_slack.slackwebhookclient-1.html#sendattachments)\n- [sendAttachment](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_slack.slackwebhookclient-1.html#sendattachment)\n\n<br />\n\n## Debug Tips\n\n### Log Requests Details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api:request\n```\n\nIf you want to use a custom request logging function, just provide your own `onRequest`:\n\n```js\n// for SlackOAuthClient\nconst client = new SlackOAuthClient({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n\n// for SlackWebhookClient\nconst client = new SlackWebhookClient({\n  url: URL,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Testing\n\n### Point Requests to Your Dummy Server\n\nTo avoid sending requests to real Slack server, specify the `origin` option when constructing your client:\n\n```js\nconst { SlackOAuthClient } = require('messaging-api-slack');\n\nconst client = new SlackOAuthClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on your production server.\n","maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"et284vu065k3@gmail.com","name":"etrexkuo"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"wtflink515@gmail.com","name":"link515"},{"email":"s92f002@gmail.com","name":"kpman"}],"time":{"modified":"2022-06-19T18:05:12.912Z","created":"2017-07-06T05:07:18.471Z","0.2.1":"2017-07-06T05:07:18.471Z","0.2.2":"2017-07-11T02:44:33.381Z","0.2.3":"2017-07-13T06:35:35.929Z","0.2.4":"2017-08-02T08:15:20.600Z","0.2.5-0":"2017-08-03T07:47:41.827Z","0.2.5-1":"2017-08-04T15:21:52.232Z","0.2.5":"2017-08-09T08:10:22.736Z","0.2.6":"2017-08-14T07:27:01.530Z","0.3.0":"2017-08-29T07:36:48.579Z","0.3.3":"2017-09-07T07:49:08.467Z","0.3.4":"2017-09-13T10:14:43.168Z","0.3.5":"2017-09-14T16:15:17.527Z","0.4.1":"2017-09-19T11:17:59.665Z","0.4.2":"2017-09-22T01:43:32.775Z","0.4.3":"2017-09-28T04:54:12.077Z","0.4.4":"2017-10-11T08:03:23.750Z","0.5.0-0":"2017-10-20T06:56:56.502Z","0.5.0":"2017-10-20T07:18:37.453Z","0.5.2":"2017-10-26T04:09:09.499Z","0.5.4":"2017-10-30T05:24:57.444Z","0.5.6":"2017-11-07T10:01:37.529Z","0.5.7":"2017-11-09T09:33:17.231Z","0.5.10":"2017-11-21T07:33:43.061Z","0.5.13":"2017-11-28T11:49:40.322Z","0.5.15":"2017-12-04T10:28:56.611Z","0.5.16":"2017-12-05T07:49:21.172Z","0.6.0":"2017-12-07T04:13:45.759Z","0.6.10":"2018-01-12T06:43:36.295Z","0.7.0-alpha.2":"2018-02-05T02:05:20.860Z","0.6.13":"2018-02-12T08:03:28.099Z","0.7.0-beta.1":"2018-03-26T08:59:26.256Z","0.7.0-beta.2":"2018-03-28T08:08:58.024Z","0.7.0-beta.3":"2018-04-02T06:26:59.127Z","0.7.0-beta.4":"2018-04-03T06:39:58.330Z","0.7.0-beta.5":"2018-04-03T09:39:36.434Z","0.7.0-rc.1":"2018-04-09T08:14:20.293Z","0.7.0-rc.2":"2018-04-17T04:19:55.567Z","0.7.0-rc.3":"2018-04-24T03:52:47.457Z","0.7.0":"2018-04-27T13:30:33.454Z","0.7.2":"2018-06-08T04:11:22.203Z","0.7.4":"2018-07-12T04:15:07.482Z","0.7.5":"2018-08-04T12:20:29.203Z","0.7.6":"2018-08-23T07:10:36.591Z","0.7.7":"2018-09-16T09:13:18.504Z","0.7.8":"2018-09-19T05:58:45.741Z","0.7.11":"2018-10-17T14:50:53.165Z","0.8.0":"2019-08-26T10:06:55.122Z","0.8.1":"2019-08-27T04:07:55.912Z","0.8.2":"2019-09-05T07:16:15.982Z","1.0.0-alpha.0":"2019-09-11T09:45:22.369Z","1.0.0-alpha.2":"2019-10-04T06:35:26.829Z","1.0.0-alpha.4":"2019-11-11T11:16:25.104Z","1.0.0-alpha.6":"2019-11-11T11:41:49.319Z","1.0.0-beta.0":"2019-11-14T07:19:20.146Z","1.0.0-beta.1":"2019-11-16T15:30:23.759Z","1.0.0-beta.2":"2019-11-19T05:54:56.109Z","1.0.0-beta.5":"2019-11-22T14:03:39.845Z","1.0.0-beta.6":"2019-12-03T05:38:58.176Z","1.0.0-beta.7":"2019-12-03T08:52:47.625Z","1.0.0-beta.8":"2019-12-05T06:29:32.391Z","1.0.0-beta.9":"2019-12-06T04:30:22.123Z","1.0.0-beta.10":"2019-12-09T04:12:11.566Z","1.0.0-beta.16":"2020-04-06T14:32:15.671Z","0.7.17":"2020-04-08T05:14:34.912Z","0.7.18":"2020-04-08T05:21:26.819Z","1.0.0-beta.23":"2020-05-18T09:30:42.511Z","1.0.0-beta.24":"2020-06-11T06:37:02.441Z","1.0.0-beta.25":"2020-06-11T11:30:31.240Z","1.0.0-beta.26":"2020-06-16T08:04:58.990Z","1.0.0-beta.27":"2020-06-23T05:48:25.639Z","1.0.0-beta.29":"2020-06-29T04:34:10.771Z","1.0.0-beta.33":"2020-07-22T06:42:05.338Z","1.0.0":"2020-09-07T08:54:47.530Z","1.0.1":"2020-09-21T07:05:57.721Z","1.0.3":"2020-10-20T10:03:43.377Z","1.0.4":"2021-01-11T06:05:42.930Z","1.0.6":"2021-09-02T17:33:12.100Z","1.1.0":"2021-10-04T05:54:30.285Z"},"keywords":["bot","chatbot","messaging-apis","slack"],"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","readmeFilename":"README.md","users":{"sayrilamar":true,"lfrichter":true},"homepage":"https://github.com/Yoctol/messaging-apis#readme","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"}}