Code Monkey home page Code Monkey logo

companion-module-discord-api's Introduction

companion-module-discord-api

This module is in a BETA state, there is still work to be done on reconnection logic to prevent duplicate connections or listeners.

Tthe full release version of this module will use a dedicated Companion app associated with Discord and not require every user to create their own individual apps in the Discord Developer Console. This is still waiting on Discord Developer Relations staff to respond to approving of the Companion app.

Changelog

V1.3.1

  • Added button options for Rich Presence action

V1.3.0

  • Added Rich Presence action. When used it will show the user as playing whatever the name of the app is, as well as optionally show image assets that have been uploaded to the Discord Developer console.

V1.2.3

  • Fixed crash when disconnecting from a chat channel while users are speaking

V1.2.2

  • Fixed variables bug crashing new Discord instances

V1.2.1

  • Fixed variables bug blocking feedback updating

V1.2.0

  • Added new variables voice_user_X_volume, voice_user_X_mute, voice_user_X_self_mute, voice_user_X_self_deaf, voice_user_X_speaking, where X is the users index, nick, or ID
  • Added new variables for the current speaker voice_current_speaker_id, voice_current_speaker_nick, voice_current_speaker_number
  • Added config option for Speaker Delay between 0ms and 10000ms (default 0ms)
  • The new Current Speaker system will update voice_current_speaker_number with the most recent speaker if they've been speaking for at least the set delay. voice_user_X_speaking also uses this same delay.

V1.1.3

  • Fixed an issue with errors not correctly logging
  • Fixed an issue with packaging by switching to a forked discord-rpc module

V1.1.2

  • Fixed an issue creating a new Instance without existing config

companion-module-discord-api's People

Contributors

companion-module-bot avatar dependabot[bot] avatar jmlutra avatar josephdadams avatar julusian avatar thedist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

travmason jmlutra

companion-module-discord-api's Issues

Join Direct Message

Describe the feature
The current implementation has a Join Channel. Please add a Join Direct Message for both Text and Voice.

Usecases
I use a DM group to chat with friends and associates on occasion... would be great to be able to automate the Join process.

Module not connecting to discord

Describe the bug
When adding the discord module and entering the Client ID/Secret the status stays on "conencting"
upon adding the module i do get the discord prompt to allow access to bifcous but approving this doesnt change the connecting state and bitfocus does not appear in the list of authorised apps.

Have included the logs below

Screenshots
image
image
image

System (please complete the following information):
Win 11 - 21H2
Companion 2.4.1

Retry connection

Describe the feature
It would be nice to retry to reconnect.

Usecases
The StreamDeck starts faster than Discord app, so it fails to connect to it. Every time I reboot/start the PC I need to go to connections disable -> enable the module to be able to connect it to Discord app.

"Failed to create connection"

Describe the bug
Trying to add the connection fails.

To Reproduce
Steps to reproduce the behaviour:

  1. Click "Add"
  2. Wait 5 seconds
  3. See error

Expected behaviour
The module would get added successfully

System (please complete the following information):

  • Companion Version: 2.3.0+4465-beta-01d4bab8
  • Operating System: Linux 5.18.2-arch1-1 #1 SMP PREEMPT_DYNAMIC

Additional Information:

Error:

module(discord-api): Error loading module: Error: Cannot find module './png64' Require stack: 
- /opt/companion/resources/app.asar/node_modules/companion-module-discord-api/dist/feedback.js 
- /opt/companion/resources/app.asar/node_modules/companion-module-discord-api/dist/index.js 
- /opt/companion/resources/app.asar/lib/instance.js 
- /opt/companion/resources/app.asar/app.js 
- /opt/companion/resources/app.asar/electron.js - 

[Bug] Connection failure on new config

Describe the bug
After the configuration of the instance and connection to Discord with the login prompt, the instance displays Connection Failure

To Reproduce
Steps to reproduce the behaviour:

  1. From a fresh install, create a discord instance
  2. Enter credentials
  3. Save and enable
  4. Accept connection in the Discord app
  5. Connection Failure

I made a new app on Discord Dev Portal to get new credentials as the console says "Login err" but it is not the solution

System (please complete the following information):

  • Companion ver. 3.0.0 (3.0.0+6014-beta-c62d68b4)
  • Discord module v 1.1.2

Console log
system: ** Starting Connection from "C:\Program Files\Companion\resources\bundled-modules\discord-api\main.js" **
system: ** Connection started **
Starting up module class: c
Sentry disabled
Module-host accepted registration
debug: Initializing Discord client
warn: Login err: {}
error: [object Object]`

A way to access the current Voicechannel in a leave action

Describe the feature
Adding a Variable which reflects the Voicechannel the Client is currently connected to. Also splitting the joining and leaving of Voicechannel into two different actions, and making the leave channel action either accepting variables, or having a selection for "current channel".

Usecases
Having a button to leave the current Voicechannel without having to set it up by hand.

[Bug] Reconnect logic memory leak

Reconnecting logic needs to be fixed, as currently the module works fine if the instance starts and Discord is already running, but if Discord starts up after the Companion instance, or is closed and reopened, this can result in duplicate connections and a memory leak. As such reconnecting has been temporarily disabled until a clean solution can be made

[Feat] Dedicated Discord app for Companion

Currently to use this module requires the user create an app in the Discord Developer Console, as only verified apps or apps created by the user can connect to that users own Discord client.

We've been waiting on Discords Developer team to respond to a ticket to verify the Companion app since Feb 2022, when they eventually get around to that we'll be able to use a single app for all Companion users (much like the Discord addon for Elgato's StreamDeck software just uses a single app).

Login err: {}

Describe the bug
I can't activate connection. Discord instance is running on machine, I created new application and pasted Client ID and Client Secret in configuration. I added "http://localhost" to the discord application settings.

To Reproduce

  1. Open discord on your machine
  2. Add connection to "Connections" tab in Companion
  3. Create discord application and follow the installing steps
  4. Open the Companion tab "Log" and see the error: "24.01.29 20:18:20 Instance/Wrapper/discord: Login err: {}"

Expected behaviour
Connection will connect to discord and start working

Screenshots
image

System (please complete the following information):

  • Companion Version 3.2.0 (3.2.0+6663-stable-b83f412f)

Additional context
...

Start/Stop Video

Describe the feature
Once in a Voice Channel, start Video
(and possibly to choose video source also?)

Usecases
I would like to be able to control a camera feed on a remote computer. Once I join the voice channel, I'd like to be able to have the camera go on with a separate button press.

Module fails to load

Describe the bug

It looks like the png64 folder is not being handled by typescript properly, resulting in the module being unimportable.

To Reproduce

julus@julus-thinkpad:~/Projects/companion-22$ node
Welcome to Node.js v14.19.2.
Type ".help" for more information.
> require('companion-module-discord-api')
Uncaught Error: Cannot find module './png64'
Require stack:
- /home/julus/Projects/companion-22/node_modules/companion-module-discord-api/dist/feedback.js
- /home/julus/Projects/companion-22/node_modules/companion-module-discord-api/dist/index.js
- <repl>

The same is also happening on my ubuntu-server installation of companion.

Expected behaviour
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

System (please complete the following information):

  • Companion Version [e.g. 2.2.0 (70d5207-2717)]

Additional context
Add any other context about the problem here.

Connection config unavailable

Describe the bug
Just trying to install and configure here but I can't find any reference to how to do that. I've got an App setup in Discord for this ready to go with keys but where do I configure the module? Right now I'm getting a "Connection config unavailable" message with a retry set to 1sec just looping away.

To Reproduce
Add the module. No configuration available. goes straight into the "Connection config unavailable" loop.

Expected behaviour
Provide an interface to add the Discord application keys?

Screenshots
image

System (please complete the following information):

Additional context
Need some more into the Readme.md. I'm happy to write some word for people if you can point me at what that should be.

test Error: Could not connect

Describe the bug
It gives an error on connecting

To Reproduce
Steps to reproduce the behaviour:

Install the plugin on the lastest beta
Fill in the client id and secret
That's all.

Expected behaviour
It would connect

Screenshots
Logging information, in text, as screenshot is more work

system: ** Starting Connection from "/home/name/path/companion-linux-x64-3.1.0+6087-beta-5a13ecf5/companion-x64/resources/bundled-modules/discord-api/main.js" **
system: ** Connection started **
Starting up module class: d
Sentry disabled
debug: Initializing Discord client
Module-host accepted registration
test Error: Could not connect
    at Socket.r (/home/name/path/companion-linux-x64-3.1.0+6087-beta-5a13ecf5/companion-x64/resources/bundled-modules/discord-api/main.js:2:200510)
    at Object.onceWrapper (node:events:628:26)
    at Socket.emit (node:events:513:28)
    at Socket.emit (node:domain:489:12)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
warn: Login err: {}

System (please complete the following information):

  • companion-linux-x64-3.1.0+6087-beta-5a13ecf5
  • Ubuntu 20.04

Toggle between all users in the discord call

Describe the feature
Building upon the connected users variables in the discord integration, add a way to be able to toggle between all the connected users at the click of a button.

Usecases
-- Have volume buttons above and below the suggested button, and use the middle button to be able to change the user.
image

Soundboard buttons through bitfocus

Describe the feature
A user should be able to bind a soundboard sound to a bitfocus button and play it

Usecases
Annoy your friends while having the ability to play multiple soundboard items at the same time, i have 10 fingers, my streamdeck has 15 buttons, should be fun.

Issue with changing volume of other users

Describe the bug
Decreasing selected user volume below 100% isn't possible when the volume is already above 100% and the step size is smaller than 10.

To Reproduce
Steps to reproduce the behaviour:

  1. Create a Decrease selected user volume button from the presets
  2. Edit the button to decrease the volume with a value smaller than 10. (I found that I also needed to change from "label}" to "discord" under user).
  3. In Discord, set another users volume above 100%
  4. Attempt to decrease volume using the created button
  5. The other users volume will decrease by the step size but will not go below 100%

Expected behaviour
The volume of the other user should continue to decrease as it does when the step size is equal or bigger than 10.

System (please complete the following information):

  • Companion Version 3.0.0 (3.0.0+6025-beta-8499d4ad)

[Feat] Toggle Streamer mode

Describe the feature
I would like to be able to toggle streamer mode on and off. This should also include a feedback with the status of discords streamer mode

Usecases
Sometimes I would like to mute all notifications without deafening myself. Also I do stream so I need to pop into discord and toggle the setting each time.

How to install 1.1.3?

Hey. I downloaded the source code for 1.1.3 because companion only shows me 1.1.2.

How / where do i install 1.1.3 ?

--- Got it. I installed the experimental version. I have to use the Beta-Companion in order for this to work. ---

Start and stop streaming current game in voice channel

Describe the feature
Add the option to start and stop streaming of your current game in discord. Add the current status as a feedback option to change the button status.

Usecases
The main use case is not having to close the game to start streaming to your friends. Very handy if you are playing racing games and your keyboard is a but further away.

warn: Login err: {} on Companion RaspberryPi

Describe the bug
Adding Client ID and Client secret (followed the tutorial from the module info)

To Reproduce
Steps to reproduce the behaviour:

  1. Configure the app with the credentials, save, and check logs

Expected behaviour
Should authenticate

Screenshots
image

System (please complete the following information):

  • Companion Version 3.0.0 (3.0.0+6000-beta-52f8eec5)

Additional context
I even added the actual RPi IP to redirects (not sure is needed)
image

[feature requests] Send variable for latest user to chat in a voice channel

I would like to program companion to select a button to switch OBS scenes whenever a specified user chats in the discord.

So for example how I'd use this variable -

Dave is speaking for over 1 seconds, companion then triggers OBS to switch to Dave Talking scene
Wesley starts speaking in response to Dave for over 1 second, companion triggers OBS to switch to Wesley talking scene.
etc..

You could also use this variable to create cool custom animations within obs for whatever. I wish we had this already!

[Bug] Crashed on Companion v3.0 RC1&RC2

When adding the Discord module, it keeps crashing on Companion v3.0.

The module cannot display any config info, as its initialization seems to fail.

Here is the log :
error: Failed to init: Error: Call timed out Error: Call timed out at t.IpcWrapper.sendWithCb (C:\Program Files\Companion\resources\main.js:2:2362159) at Object.init (C:\Program Files\Companion\resources\main.js:2:8087748) at l.<anonymous> (C:\Program Files\Companion\resources\main.js:2:8096617) at l.emit (node:events:513:28) at l.emit (node:domain:489:12) at ChildProcess.<anonymous> (C:\Program Files\Companion\resources\main.js:2:2349720) at ChildProcess.emit (node:events:513:28) at ChildProcess.emit (node:domain:489:12) at emit (node:internal/child_process:937:14) at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

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.