mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
Modify test file
This commit is contained in:
@@ -2,15 +2,33 @@
|
||||
|
||||
import * as PlugAPI from "plugapi";
|
||||
|
||||
let yolo = new PlugAPI({
|
||||
new PlugAPI({
|
||||
email: "",
|
||||
password: ""
|
||||
}, function (err,bot) {
|
||||
}, function (err, bot) {
|
||||
if (!err) {
|
||||
bot.connect("roomslug"); // The part after https://plug.dj
|
||||
bot.on("roomJoin", function (room) {
|
||||
const ROOM = "roomslug";
|
||||
bot.connect(ROOM); // The part after https://plug.dj
|
||||
|
||||
bot.on(PlugAPI.events.ROOM_JOIN, function (room) {
|
||||
console.log("Joined " + room);
|
||||
});
|
||||
|
||||
bot.on("chat", function (data) {
|
||||
if (data.type == "emote") {
|
||||
console.log(data.from + data.message);
|
||||
} else {
|
||||
console.log(data.from + "> " + data.message);
|
||||
}
|
||||
});
|
||||
|
||||
bot.on("error", function () {
|
||||
bot.connect(ROOM);
|
||||
});
|
||||
|
||||
bot.deleteAllChat = false;
|
||||
bot.multiLine = true;
|
||||
bot.multiLineLimit = 5;
|
||||
} else {
|
||||
console.log("Error initializing plugAPI: " + err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user