Dateien nach "scripts" hochladen
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
registerPlugin({
|
||||
name: 'Follow Me',
|
||||
version: '3.0.0',
|
||||
backends: ['ts3', 'discord'],
|
||||
description: 'The bot will follow the movements of any of the clients given',
|
||||
author: 'SinusBot Team', // Michael Friese, Max Schmitt, Jonas Bögle
|
||||
vars: [{
|
||||
name: 'clientUids',
|
||||
title: 'Comma-separated list of client-UIDs that the bot should follow',
|
||||
type: 'string'
|
||||
}]
|
||||
}, (_, {clientUids}) => {
|
||||
const engine = require('engine')
|
||||
const backend = require('backend')
|
||||
const event = require('event')
|
||||
|
||||
if (!clientUids) {
|
||||
engine.log('No client-UIDs set.')
|
||||
return
|
||||
}
|
||||
|
||||
const uids = clientUids.trim().split(',')
|
||||
event.on('clientMove', ({ client, toChannel }) => {
|
||||
if (toChannel && uids.includes(client.uid())) {
|
||||
backend.getBotClient().moveTo(toChannel)
|
||||
}
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user