Comments (8)
I believe it does, but I'm not in front of the computer to test right now - does your bot have a high enough role (permissions level) in the room to be able to change the description?
from plugapi.
Yes, it is a co-host. I think I'm not very good with this. There is a lot I want to do, but frankly have no clue how to do. I kind of just brute force my way through things sometimes. I figured this would be straight forward like bot.changeRoomName(); and bot.changeRoomWelcome(); are. Thanks in advance for any help. :)
from plugapi.
Gentle reminder nudge. :)
from plugapi.
Hi @moongoesrawr ,
Just ran some test and i can confirm it seems that bot.changeRoomDescription("your description") does nothing even with co-host permissions.
PlugAPI is deprecated on that point and need some update on changeRoomDescription() method since Plug.DJ does now have a "short description" and "detailed description" in room info meta ( https://plug.dj/_/rooms/state ) and not using actively description anymore.
I think an update is needed in client.js to include some new methods ChangeRoomDescription ( for short description ) and ChangeRoomLongDescription ( for detailed description ).
Maybe something like that ?
changeRoomDescription(description, callback) {
if (!store(this)._room.getRoomMeta().slug || !this.havePermission(undefined, PlugAPI.ROOM_ROLE.COHOST) || Object.is(store(this)._room.getRoomMeta().short_description, description) || this.guest) {
return false;
}
store(this)._queueREST('POST', endpoints.ROOM_INFO, {
name: undefined,
short_description: description,
long_description: undefined,
minChatLevel: undefined,
welcome: undefined
}, callback);
return true;
}
changeRoomLongDescription(longDescription, callback) {
if (!store(this)._room.getRoomMeta().slug || !this.havePermission(undefined, PlugAPI.ROOM_ROLE.COHOST) || Object.is(store(this)._room.getRoomMeta().longDescription, longDescription) || this.guest) {
return false;
}
store(this)._queueREST('POST', endpoints.ROOM_INFO, {
name: undefined,
short_description: undefined,
long_description: longDescription,
minChatLevel: undefined,
welcome: undefined
}, callback);
return true;
}
I've tested this modification on test environment and it worked fine.
const PlugAPI = require('plugapi');
new PlugAPI({
email: 'Your_MAIL',
password: 'Your_PASSWORD'
}, (err, bot) => {
if (!err) {
bot.connect('YourRoom'); // The part after https://plug.dj
bot.on(PlugAPI.events.ROOM_JOIN, (room) => {
console.log(`Joined ${room}`);
bot.multiLine = true;
bot.multiLineLimit = 5;
bot.sendChat("#1 - Changing Room Short Description");
bot.changeRoomDescription("THIS IS MY SHORT DESC", function(){
bot.sendChat("Changed room description !");
});
bot.sendChat("Sleeping for 5sec !");
setTimeout(function() {
bot.sendChat("#2 - Changing Room Long Description");
bot.changeRoomLongDescription("THIS IS A DETAILED DESCRIPTION ALSO CALLED LONG DESCRIPTION", function(){
bot.sendChat("Changed room long description !");
});
}, 5000);
});
} else {
console.log(`Error initializing plugAPI: ${err}`);
}
});
Regards,
Talos.
from plugapi.
Hi,
We aren't deprecated as much as ... busy with life. I apologize for not having responded in a timely manner but you're right, Plug changed it so that there's both a long and short description now. A lot of stuff still needs to be fixed with plugAPI to get it working 100% and any help we can get is much appreciated.
If you'd like to, you can either pull request to have that added or I can add it in myself and release a minor version to add it in.
Thanks,
- Thedark1337
from plugapi.
@thedark1337 Just did a pull request to address this issue. Once again thanks for bringing us PlugAPI and I didn't mean to disrespect you when i mentioned this project as "deprecated".
from plugapi.
No offense taken, thanks for your help! I'll be updating dependencies as well, before releasing a version that will fix this issue
from plugapi.
Wow, thanks guys!
from plugapi.
Related Issues (20)
- Errors in callback functions passed to playlist methods are mishandled HOT 2
- Should treat URLs as atoms when splitting long chat messages HOT 5
- Use ES6 Promise in place of callbacks HOT 5
- The advance event when last DJ finishes has djs.length == 2 HOT 2
- getPlaylists callback argument is not a RESTCallback HOT 6
- Chat events mentions are always [] HOT 3
- Duplicate advance event on skip (some times) HOT 2
- Playlist management functions some times silently fail HOT 5
- Cannot read property 'length' of undefined HOT 3
- Bot gets 403 error, restarts at random intervals HOT 7
- addToWaitList throws 403 error when target user has no playlists HOT 3
- Errors trying to perform npm install plugapi HOT 2
- Error after connection with account without playlist HOT 2
- Not sure if playlist functions are working properly
- Unsupported events
- User.language is null HOT 2
- Convert name to ID? HOT 8
- Have a bot.
- I'm using your api for a plug bot
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugapi.