Hey,
i have some questions:
1. Is it possible to remove a value that is stored with the set() function?
2. Is it possible to add a Channel with a password?
3. Is it possible to promote a user in a certain channel to channeladmin?
Edit and it would be nice if the channelCreate function returns the channelid of the created channel, so i could save the channel by channelid instead of name (because the name could be doubled).
For better understanding why this would be usefull i've added my current script here:
Edit:It would be nice if the channelCreate function returns the channelid of the created channel, so i could save the channel by channelid instead of name (because the name could be doubled).
i have some questions:
1. Is it possible to remove a value that is stored with the set() function?
2. Is it possible to add a Channel with a password?
3. Is it possible to promote a user in a certain channel to channeladmin?
Edit and it would be nice if the channelCreate function returns the channelid of the created channel, so i could save the channel by channelid instead of name (because the name could be doubled).
For better understanding why this would be usefull i've added my current script here:
Code:
registerPlugin({
name: 'Private Channel',
version: '0.1',
description: 'Allows certain users to create their own private channel',
author: 'good_live',
vars: {
parentid: {
title: 'ID of the parent Chanel',
type: 'number'
placeholder: '0'
},
groupid: {
title: 'ID of the group that is allowed to create a Channel',
type: 'number'
placeholder: '0'
},
}
}, function(sinusbot, config) {
sinusbot.on('chat', function(ev) {
if(ev.msg.indexOf('!private') == 0){
var groupid = config.groupid;
var i = ev.clientServerGroups.length;
while (i--) {
if (ev.clientServerGroups[i].i == groupid) {
var cname = ev.msg.replace("!private", "");
var key = ev.clientUid + "_private";
var obj = get(key);
if(cname == ""){
chatPrivate(ev.clientId, 'Usage: !private <channelname>');
}else if(obj != undefined){
chatPrivate(ev.clientId, 'You already have a private channel: ' + obj);
}else{
channelCreate({ name: cname, parent: config.parentid, topic: ev.clienNick, enc: 1, perm: 1, sperm: 0, order: 0, maxClients: 10 });
chatPrivate(ev.clientId, 'Channel: ' + cname + ' created.');
set(key, cname);
}
return true
}
}
chatPrivate(ev.clientId, 'You are not allowed to create a private Channel');
}
});
});
Edit:It would be nice if the channelCreate function returns the channelid of the created channel, so i could save the channel by channelid instead of name (because the name could be doubled).
Last edited: