add the ability to add multiple bots with the new logic
This commit is contained in:
parent
632635e464
commit
1000b149cc
@ -35,8 +35,15 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
sendChatMessage(e) {
|
sendChatMessage(e) {
|
||||||
if (this.text.trim().length > 0){
|
let msg = this.text.trim()
|
||||||
this.$socket.emit('chat_message', this.text.trim())
|
if (msg.length > 0){
|
||||||
|
if (msg.indexOf('/addbot') !== -1 && msg.split(' ').length > 1){
|
||||||
|
for (let i = 0; i < parseInt(msg.split(' ')[1]); i++) {
|
||||||
|
this.$socket.emit('chat_message', msg.split(' ')[0])
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.$socket.emit('chat_message', msg)
|
||||||
|
}
|
||||||
this.text = ''
|
this.text = ''
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
Loading…
Reference in New Issue
Block a user