|
1 | 1 | import { NodeCG } from "nodecg/types/server"; |
2 | | -import { requireService } from "nodecg-io-core/extension/serviceClientWrapper"; |
3 | | -import { IRCServiceClient } from "nodecg-io-irc/extension"; |
| 2 | +import { requireService } from "nodecg-io-core"; |
| 3 | +import { IRCServiceClient } from "nodecg-io-irc"; |
4 | 4 |
|
5 | 5 | module.exports = function (nodecg: NodeCG) { |
6 | | - nodecg.log.info("Sample bundle for <the-service-name> started"); |
| 6 | + nodecg.log.info("Sample bundle for irc started."); |
7 | 7 |
|
8 | 8 | const service = requireService<IRCServiceClient>(nodecg, "irc"); |
9 | 9 | service?.onAvailable((client) => { |
10 | | - nodecg.log.info("IRCclient has been updated."); |
11 | | - const chat = client.getNativeClient(); |
12 | | - chat.join("#skate702"); // Change this channel, if you want to connet to a different channel. |
| 10 | + nodecg.log.info("IRC client has been updated."); |
| 11 | + client.join("#skate702"); // Change this channel, if you want to connect to a different channel. |
13 | 12 |
|
14 | | - chat.addListener("message", (from, to, message) => { |
15 | | - console.log(from + " => " + to + ": " + message); |
| 13 | + client.addListener("message", (from, to, message) => { |
| 14 | + nodecg.log.info(from + " => " + to + ": " + message); |
16 | 15 | }); |
17 | 16 |
|
18 | | - chat.addListener("error", function (message) { |
19 | | - console.log("error: ", message); |
| 17 | + client.addListener("error", function (message) { |
| 18 | + nodecg.log.info("error: ", message); |
20 | 19 | }); |
21 | 20 | }); |
22 | 21 |
|
23 | | - service?.onUnavailable(() => nodecg.log.info("IRCclient has been unset.")); |
| 22 | + service?.onUnavailable(() => nodecg.log.info("IRC client has been unset.")); |
24 | 23 | }; |
0 commit comments