3 var ChannelModule = require("./module");
4 var Flags = require("../flags");
8 var possible = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
10 for (var i = 0; i < 3; i++)
11 text += possible.charAt(Math.floor(Math.random() * possible.length));
16 console.log(makeid());
18 function AnonymousPost(_channel) {
19 ChannelModule.apply(this, arguments);
22 AnonymousPost.prototype = Object.create(ChannelModule.prototype);
24 AnonymousPost.prototype.onUserPreJoin = function (user, data, cb) {
25 const opts = this.channel.modules.options;
26 var anonymousPosting = opts.get("allow_anon_chat");
27 if(anonymousPosting && user.isAnonymous){
28 user.guestLogin("Anonymous-" + makeid() +"");
29 //user.guestLogin("Anonymous");
30 cb(null, ChannelModule.PASSTHROUGH);
33 cb(null, ChannelModule.PASSTHROUGH);
37 module.exports = AnonymousPost;
38 //# sourceMappingURL=anonymouspost.js.map