@gluecode-it/discord-voice-channel-observer
TypeScript icon, indicating that this package has built-in type declarations

3.1.5 • Public • Published

Discord VoiceChannel Observer

A small library to watch a discord voice channel is empty or not

Usage

import * as Discord from 'discord.js';
import { VoiceChannelObserver } from 'discord-voice-channel-observer';

const token = '***********************';
const voiceChannelId = '****************';

(async() => {
    const client = new Discord.Client();
    await client.login(token);

    const observer = new VoiceChannelObserver(client, voiceChannelId);
    observer.onEmpty((channelId: string) => {
        console.log(`empty: ${channelId}`)
    })
    observer.onNotEmpty((channelId: string) => {
        console.log(`not empty: ${channelId}`)
    })
})()

/@gluecode-it/discord-voice-channel-observer/

    Package Sidebar

    Install

    npm i @gluecode-it/discord-voice-channel-observer

    Weekly Downloads

    1

    Version

    3.1.5

    License

    ISC

    Unpacked Size

    9 kB

    Total Files

    4

    Last publish

    Collaborators

    • oliverlorenz