Coder Social home page Coder Social logo

obsbot's Introduction

obsbot

obsbot repo: will have bot and server code since they go on same host

Setup:

Discord Setup:

Create discord bot (token will be put in .env file)
add to discord server
give permission
add role for image approver (will be put in .env file)

Clone repo onto host

Ensure security/traffic rules allow http on port 80

Rename .envlocal to .env and update values:

TOKEN= discord bot token from earlier goes here
SERVER_URL= public IP of host bot/server are runnning/listening on
DATABASE_NAME= what you want your db name to be 
CHANNEL_ID= the channel you want the bot to listen to
APPROVAL_EMOJIS= the emojis you want the bot to listen for (pizza is default) (list)
APPROVER_ROLES= the roles that you want to bot to listen for approval from ('approver' is default) (list)
CAROUSEL_DELAY= how long you want the images up before they scroll (3000ms/3s is default)

Set up environment

python3, pip3
pip install: flask, sqlite3, dotenv, discord packages
ensure .env file is accurate
run the db set up script
    python3 sqlLiteDbStartup.py

Run the bot and the server

python3 bot.py
sudo python3 server.py

Add the source to your streamlabs/obs

URL: http://<server ip from env>/carousel
Width/Height: up to you, i did 360x360
I left the CSS for transparent background
Make sure "Refresh Browser when scene becomes active" is checked

my brainstorming notes:

  • channel where we/users/ravers post pics they take during the event to be shown on stream/video feed
  • a bot/integration listening to that channel
  • when an image in that channel gets emojied/verified by staff/admins (people in this channel as an example) the bot picks it up and adds it to the carousel
  • overlay/scene uses browser source of the carousel, server handles image transitions/timing

parts

  • channel (#image-submissions in obs' discord) - done(tested)
    • any can submit pics - done(tested)
    • admin/specific role can react with emoji done(tested)
    • lock down to only image uploads (no text possible?) - done
  • bot (python script on aws host)
    • listens to right channel in right discord - done
    • listens for reactions on image posts - done
    • if specific reaction by specific people, send image to server via rest api - done
    • have command to empty image queue on server via rest api - done
    • have command to toggle browser source - not doing in discord bot, will be obs chat bot
    • commands
      • empty queue !flush - done
  • server (flask app on aws host)
    • single html view with image carousel (bootstrap probably) - done
    • maintain image queue - done
    • transition between images - done
    • rest api
      • add image to queue - done
      • remove image from queue - done
      • skip image - done
      • rewind - not doing
      • empty queue - done

obsbot's People

Contributors

tpageforfunzies avatar

Watchers

 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.