Git Product home page Git Product logo

ledusercount's Introduction

ledusercount

Using a for example a WS2812 5050 RGB LED this Discord bot shows how many of your friends are logged in to your Discord server. Excludes the channel AFK when counting users.

Tested and confirmed working with discord.py version 1.1.1.

Supported modules

  • stdout (for testing)
  • WS281x
  • Blinkstick

Example: the WS2811

Wiring

Solder the LED strip to pin 18, +5V and GND respectively.

The device in action

  • Shows a red LED up top when the bot is online but noone is logged in.
  • Flashes leds when a new user joins.
  • Shows up to the maximum number of leds of the attached led strip.

Setting up your raspberry pi zero w

Create two files in the boot partition, one empty called ssh and one called wpa_supplicant.conf with the following contents (edit to fit your network):

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="your_real_wifi_ssid"
    scan_ssid=1
    psk="your_real_password"
    key_mgmt=WPA-PSK
}

Provisioning

Clone the repo, obviously.

Choose the appropriate script depending on your output interface.

sudo chmod +x provision_<CHOOSE_VARIANT>.sh
sudo ./provision_<CHOOSE_VARIANT>.sh

Set up a Discord bot (Google for instructions if you don't know how). Add your Discord bot token to a text file called apikey.txt in the repo.

Set your preferred output module at line 13 in usercounter.py.

Running it

python3 usercounter.py &

or add an @reboot line to crontab (using the provided add_cronjob.sh):

@reboot sudo /usr/bin/python3 /home/pi/ledusercount/usercounter.py > /home/pi/cronjoblog 2>&1

ledusercount's People

Contributors

andli avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.