Bots Home
|
Create an App
abcdeeznutz
Author:
jerkin4green
Description
Source Code
Launch Bot
Current Users
Created by:
Jerkin4green
/* * Robust Token Access Bot * Prevents non-token holders from chatting and sends a private prompt. */ cb.settings_choices = [ {name: 'min_tokens', type: 'int', minValue: 1, default: 1, label: 'Min tokens to chat'}, {name: 'message_color', type: 'str', default: '#FF0000', label: 'Warning Message Color'}, {name: 'denial_msg', type: 'str', default: 'Tokens are required to chat in this room! Click "Get Tokens" to join the fun.', label: 'Denial Message'} ]; cb.onMessage(function(msg) { // Check if user has tokens if (msg.user_has_tokens === false || msg.user_has_tokens === 0) { // 1. Mark the message to be ignored by other apps msg.X_X_chat_box_ignore_ = true; // 2. Send a PRIVATE notice only they can see cb.sendNotice(cb.settings.denial_msg, msg.user, "", cb.settings.message_color, "bold"); // 3. Set the message text to empty to prevent it from displaying msg.m = ""; // 4. Return the modified message with 'p' (prevent) set to true return {p: true}; } // If they have tokens, let the message through as normal return msg; }); cb.onEnter(function(user) { if (!user.has_tokens) { cb.sendNotice("Welcome! Just a heads up: this is a token-only chat room.", user.user, "", cb.settings.message_color); } });
© Copyright Chaturbate 2011- 2026. All Rights Reserved.