Coder Social home page Coder Social logo

p-fruck / jim Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 3.0 153 KB

JIM - The Jitsi Integrated Musicbot is an open source music bot for jitsi, the free video conferencing platform. Together with him, you can get your party started :tada:

License: GNU Affero General Public License v3.0

HTML 17.84% TypeScript 79.51% Dockerfile 2.65%
jitsi music party musicbot jitsi-meet

jim's Introduction

Jim is dead, long live Jim

TL;DR: Jim is discontinued and his successor can be found here

If you are interested in the how and why, check out this issue



JIM
Hi, I'm JIM!

Built with ❀️ and 🍺 by Pius, Tjark, Philipp and contributors

A small music bot for your meeting in Jitsi.

πŸ”’ Monitored by SonarQube

Key Features β€’ Commands β€’ How to deploy β€’ License

πŸ€– Who is JIM?

Hi, I am JIM! Your Jitsi Integrated Musicbot.

πŸŽ‰ Key Features

You would like to know what my key features are? - I will assist you bringing good music to your Jitsi Meet party!

πŸ–₯️ Commands

Command Description
!add <url|searchTerm> Add track or pick the first result from search term to queue
!clear Clear the queue
!help Display the help menu
!joke Try to make you laugh πŸ˜†
!list Show tracks in queue
!pause Pause the current track
!ping Emit a life signal
!play <url|searchTerm> Play track or first result from search term now! Resume if no parameter is provided
!skip Skip current track and play next one
!track <value> If no value is provided, get information about the current track. Use e.g. ++/--- or +40 / -120 to fast forward or rewind
!vol <value> If no value is provided, retrieve the current volume level. Use a number from 0 to 100 or a variable amount of + or - to adjust the volume

πŸš€ How to deploy

You can simply deploy JIM as a container using

docker run --rm -d --init --cap-add=SYS_ADMIN --name=jim -e ROOM_NAME=YourJitsiRoom ghcr.io/p-fruck/jim/jim

This also works with podman. You can even mount a .env file to store your environment variables by adding -v /path/to/.env:.env to the docker command.

Alternatively, you can start the bot without any sort of container-technology, using npm ci && npm run start.

Again, you have to create a .env file containing your environment variables. A list off all available variables can be found below, but only ROOM_NAME is required (=❗):

Variable Default Description
BOT_AVATAR_URL Logo of JIM A link to a publicly accessible profile picture for JIM
BOT_HEADLESS true Whether or not the bot should be launched in headless mode
BOT_NAME DJ JIM Defines the display name of your bot
JITSI_DOMAIN meet.jit.si Specify the base domain of your Jitsi instance
JOKE_DELAY 2500 Sets the delay in ms between setup and delivery of the joke
JOKE_FILTER Any Sets filter the joke API (documentation)
LOG_LEVEL info Defines the minimum log level. Choose error, warn, info or debug
PLAYLIST_MAX_SIZE 100 Defines the maximum amount of songs that can be added to a playlist
TRACK_STEP_SIZE 10 Defines the default step size in sec. to fast forward (or rewind) a track
ROOM_NAME ❗ Name of the room to join
ROOM_PASSWORD Password of the jitsi room (if any)
VOLUME_INITIAL_VALUE 20 Sets the initial music volume in % (0 to 100)
VOLUME_STEP_SIZE 10 Default step size in %, utilized by eg !vol +++

πŸ“˜ License

JIM is licensed under GNU Affero General Public License v3.0!

jim's People

Contributors

dependabot[bot] avatar p-fruck avatar piuswalter avatar tjarbo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jim's Issues

Unable to run jim

Trying to run without docker as specified using the commands I get the following error:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/tmp/jim-admin/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle [email protected]~start: CWD: /tmp/jim-admin
10 silly lifecycle [email protected]~start: Args: [ '-c', 'ts-node ./src/index.ts' ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `ts-node ./src/index.ts`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:210:5)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:210:5)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid [email protected]
15 verbose cwd /tmp/jim-admin
16 verbose Linux 4.15.0-154-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
18 verbose node v12.14.0
19 verbose npm  v6.13.4
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `ts-node ./src/index.ts`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

and on the command line I get this:

npm run start

> [email protected] start /tmp/jim-admin
> ts-node ./src/index.ts

/tmp/jim-admin/src/jitsi-bot.ts:164
        if (!track?.formats?.length) {
                   ^

SyntaxError: Unexpected token '.'
    at Module._compile (internal/modules/cjs/loader.js:895:18)
    at Module.m._compile (/tmp/jim-admin/node_modules/ts-node/src/index.ts:1056:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Object.require.extensions.<computed> [as .ts] (/tmp/jim-admin/node_modules/ts-node/src/index.ts:1059:12)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/tmp/jim-admin/src/index.ts:2:1)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `ts-node ./src/index.ts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-09-02T11_29_32_679Z-debug.log

ARM Containers

As mentioned in #34, arm containers would be a nice addition. A bit of testing is required beforehand to make sure, the container runs properly on eg. a Raspberry Pi

Jim is dead, long live Jim!

Jim is dead, long live Jim!

As you have probably noticed, there wasn't much active development on this project in the last few weeks.
This issue is a short explanation why the development has stopped, why this project is archived and to continue.

Why discontinued

As some of you already pointed out, the usage of a NodeJS backend controlling a chromium browser was
a huge resource hog and a suboptimal architecture in the first place. Jim uses the Jitsi IFrame API
in combination with browser automation. However, this overhead can be reduced by using the Jitsi
low-level API, which is more complex (to me, at least :D) and took me quite some time to figure out.

The project also wasn't very extendable, since the plugin system wasn't very well-defined and hadn't
had many capabilities. All of this pushed me to the decision to start this project from scratch.

How to move on?

This project is archived, but don't worry, Jim already has a successor! Meet Jimmi, the
Jitsi Integrated Musicbot Management Interface! Controlling Jim is now as simple as pointing your
browser to a given website and specifying your conference room using the Management Interface.

The new Jimmi Project isn't only more easily accessible, but will also provide more control option through
the WebGUI in the future and implement a feature-rich plugin system.

Check out Jimmi here, read the instructions
(there are a few requirements to get started) and enjoy good old Jim with a new Management Interface!

How can I help?

Use Jimmi!

You found some Bug? -> Create an issue!

You have a feature request? -> Create an issue!

Help us improve Jimmi by giving your voice to the project. There's also a
discussions section if you have further questions :)

If you like the project please consider giving Jimmi a Star or even watch the project, so you stay
up-to-date and are notified about new features and activities

Container image jim:2.1.0 not working

[2021-05-21 12:22:11] [backend] [οΏ½[32mINFOοΏ½[39m]: joining conference XXXXXXX
node:fs:1072
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, scandir '/app/dist/commands/local'
    at Object.readdirSync (node:fs:1072:3)
    at registerDirectory (/app/dist/command.service.js:38:14)
    at Function.init (/app/dist/command.service.js:43:13)
    at Function.init (/app/dist/jitsi-bot.js:47:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async startBrowser (/app/dist/index.js:24:5) {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: '/app/dist/commands/local'
}

πŸ› Private messages break chat functionality

How to reproduce:

  • Start in Headful mode (useful for debugging)
  • Write some private messages to Jim
  • Trigger some command, eg !help

Now an interactive popup will be shown to Jim, asking whether he wants to send this message to the group or privately, which ultimately breaks his chatting functionality

Error when running with npm run start

npm run start

> [email protected] start /home/musicbot/jim
> ts-node ./src/index.ts

/home/musicbot/jim/src/jitsi-bot.ts:164
        if (!track?.formats?.length) {
                   ^

SyntaxError: Unexpected token .
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Module.m._compile (/home/musicbot/jim/node_modules/ts-node/src/index.ts:1056:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/home/musicbot/jim/node_modules/ts-node/src/index.ts:1059:12)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/musicbot/jim/src/index.ts:2:1)

Also, any chance a docker container for arm could be made?

πŸ› Messages overlap

Description

Since the 'send_message' functionality isn't provided by the jitsi api and has been worked around by letting puppeteer type in the input field, messages may overlap if executed directly after each other.

How to fix

Some kind of Mutex/Semaphor functionality should be implemented to fix this issue.

Starting muted

Hello!

Thanks for this amazing project. Is it possible to add that he unmutes as soon as a track starts? I got enabled that everyone starts muted.

Also, is a possibility planned to let him join from the browser?

Thanks, I really love it!

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.