Bots Home
|
Create an App
GenderBot 2.0
Author:
tablesalt9090
Description
Source Code
Launch Bot
Current Users
Created by:
Tablesalt9090
/************************************************************* ** ** Title: Gender Bot ** Author: tablesalt90 - tablesalt90@gmail.com - @tablesalt90 ** Version: 2.0 ** Description: Simple Chat Bot that adds Gender Emotes to messages ** *************************************************************/ class Gender { constructor() { this.botVersion = "2.0"; this.botMsgBg = '#6ed3ff'; this.modelName = cb.room_slug; this.emotes = {}; if (!cb.settings.emoteStyle) { cb.settings.emoteStyle = 'Stick Figure'; } switch (cb.settings.emoteStyle) { case 'CB Style': this.emotes = { m: ':genderM', f: ':genderF', c: ':genderC', s: ':genderS', u: ':genderG' } break; default: this.emotes = { m: ':avatar_gen_male', f: ':avatar_gen_female', c: ':avatar_gen_couple', s: ':avatar_gen_trans', u: ':avatar_gen_unknown' } break; } } announce() { let statusMsg = '\n*** Gender Bot v. ' + this.botVersion + ' *** by tablesalt90\n'; return statusMsg; } } cb.settings_choices = [ { name: 'emoteStyle', type: 'choice', label: 'Select an emote style', choice1: 'CB Style', choice2: 'Stick Figure', defaultValue: 'Stick Figure' }, ]; /* * handle messages from users */ cb.onMessage(function(message) { let genderStr = ""; genderStr = gender.emotes[message['gender']]; if (!genderStr) genderStr = gender.emotes.u; message['m'] = genderStr + ' ' + message['m']; }); cb.onEnter(function(user) { if (user['users'] === 'tablesalt90') { cb.chatNotice('\nGenderBot creator tablesalt90 just entered the room!\n','',gender.botMsgBg); } }); const gender = new Gender(); cb.chatNotice(gender.announce(),'', gender.botMsgBg,'','bold');
© Copyright Chaturbate 2011- 2024. All Rights Reserved.