GithubHelp home page GithubHelp logo

leonardssh / coc-discord-rpc Goto Github PK

View Code? Open in Web Editor NEW
152.0 4.0 7.0 3.48 MB

๐Ÿ˜Ž An awesome and fully customizable coc-extension to get Discord Rich Presence integration with NeoVim.

Home Page: https://www.npmjs.com/package/coc-discord-rpc

License: MIT License

TypeScript 100.00%
rpc coc neovim discord rich-presence nvim discord-rpc custom-rpc discord-status coc-extension

coc-discord-rpc's Introduction

โš ๏ธ Maintenance Mode Notice โš ๏ธ

Important: This project is currently in "Maintenance Mode Only." This means that the development of new features has been put on hold, and the focus will solely be on bug fixes and ensuring the extension remains compatible with NeoVim and Discord Rich Presence.

Maintenance Mode

Due to time constraints and other commitments, the primary contributors of this project, leonardssh and xhayper, have decided to put coc-discord-rpc into "Maintenance Mode Only." This means that while we deeply appreciate the support and interest in the extension, we will not be actively developing new features at this time.

Bug Fixes

While new feature development is on hold, we are committed to addressing any bugs or issues that arise to ensure the extension remains functional and reliable. We encourage you to report any bugs or problems you encounter by creating an issue in the GitHub repository. Please provide as much information as possible to help us reproduce and resolve the issue.

Community Support

While we may not be actively developing new features, we welcome contributions from the community. If you're interested in helping with bug fixes, submitting patches, or improving documentation, we encourage you to fork the repository, make your changes, and submit a pull request. We'll do our best to review and merge the contributions in a timely manner.

Contact

If you have any questions, concerns, or suggestions regarding coc-discord-rpc, please feel free to reach out to us through the GitHub repository's issue tracker or by contacting leonardssh and xhayper directly. While we may not be able to provide immediate support, we'll do our best to assist you.

Thank you for your understanding and continued support.

Happy coding!


Icon

๐Ÿ˜Ž An awesome and fully customizable coc-extension to get Discord Rich Presence integration with Neovim / Vim


Remember to ๐ŸŒŸ this Github if you ๐Ÿ’– it.

For something in between a dakyskye/coc-cord, iCrawl/discord-vscode and a Satoqz/vscode-discord.

This may not be the best discord rpc, but it is a discord rpc. ๐Ÿ˜

๐Ÿ“Œ Features

  • Highly customizable in using the extension settings
  • Shows what you're working on in Neovim / Vim
  • Shows the amount of problems in your workspace
  • Shows the number of lines in your file and which line you're editing
  • Respects Discord's 15sec limit when it comes to updating your status
  • Support for over 130+ of the most popular languages
  • Enable/Disable RPC for individual workspaces
  • Custom string support
  • Easily manually reconnect to Discord Gateway
  • Idle indication when you tab out for a while
  • Support flatpak/snapstore version of Discord

All texts is fully customizable using variables and a multitude of config options

1 2 3

๐Ÿ“„ Wiki

Checkout wiki for more details:

๐Ÿ‘จโ€๐Ÿ’ป Contributing

To contribute to this repository, feel free to create a new fork of the repository and submit a pull request.

  1. Fork / Clone and select the main branch.
  2. Create a new branch in your fork.
  3. Make your changes.
  4. Commit your changes, and push them.
  5. Submit a Pull Request here!

๐Ÿ“‹ License

This project is licensed under the MIT License - see the LICENSE file for details.

coc-discord-rpc's People

Contributors

allcontributors[bot] avatar benricheson101 avatar bwkam avatar depfu[bot] avatar excalios avatar leonardssh avatar sevenc-nanashi avatar unrealapex avatar vendicated avatar xhayper avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

coc-discord-rpc's Issues

macOS fix doesn't work

I'm on macOS 11.1, and I found the fix from #15 to make coc-discord-rpc work. However, when I run

find /private/var/folders -name "*discord-ipc*" 2> /dev/null

I get no results. I also tried searching within /tmp, /private and /var, to no avail. Any ideas?

Neovim is not NeoVim

Operating system

Windows 10

Neovim/Vim version

Neovim 0.8.1

CoC version

0.0.82

Discord version

official

Reproduce step

  1. Launch neovim
  2. Check discord status

Expected result

Application name is Neovim

Actual result

Application name is NeoVim

Relevant log output

No response

Unable to connect to discord after installation

I was unable to connect I installed it and when I opened up NeoVim it printed out: [coc.nvim] RPC: Could not connect
I also tried to enable with [coc.nvim]: Error on notification "runCommand": Could not connect
And reconnect as well [coc.nvim] RPC: Could not connect

TypeError: Cannot read property 'toString' of undefined

coc-discord-rpc keeps on throwing the following error:

[coc.nvim]: UnhandledRejection: TypeError: Cannot read property 'toString' of undefined.

Was working till a few days back, have no idea what broke it. Tried reinstalling multiple times only to arrive at the same conclusion.

uname -a:

Linux ArchBox 5.13.9-arch1-1 #1 SMP PREEMPT Sun, 08 Aug 2021 11:25:35 +0000 x86_64 GNU/Linux

Button

#67 need to be merged before this will be worked on

Disable warning if it couldn't connect

Hello,

I like this problem, however I don't have discord open all the time on my pc. So whenever I open vim I get this bright error:
image
Which I don't really care about as it works as long as I have discord open.

Is there any option to disable this warning?

Thanks in advance.

State of the repository

Hello everyone,

I am hayper, open source developer, i will be taking leonardssh's place in maintaining this repository, and leonardssh will be stepping down, he's very busy in real life.


What does this mean?
It means that i will try my best to actively maintain this project EVEN if i am really busy.

Now, you may ask "Will 'Cannot read properties of null reading 'write'' finally be fixed?"?
"Will 'e.forEach is not a function error' finally be fixed"?

The answer is.... ๐Ÿฅ๐Ÿฅ๐Ÿฅ YES!

I have open a PR that will fix both issue and make coc-discord-rpc work with flatpak, snapstore macOS and linux version of Discord, and most importantly, latest version of coc.nvim.

#67

I will be needing some tester to test if the PR work, once it's all tested i will publish the new version.


If you really wanted to use the new version anyways, the build-dev branch contains the compiled version that is guaranteed to work on macOS and Windows on latest version of coc.nvim.

Repository URL not appearing because "git@" or "http(s)" is hardcoded in matching logic

If the repository URL isn't formatted to a very hardcoded format, the "View repository" button won't appear.

The issue is around here in utils.ts:

		const matched =
			/^(?:git@|https?:\/\/)(?<provider>[a-zA-Z_.~-]+\.[a-z]{2,})(?::|\/)(?<user>.*?)\/(?<repo>.*)$/.exec(
				remoteUrl.stdout.trim()
			);

It is not always applicable that the SSH user is git, or that the SSH user is specified in the URL on the machine. Namely, you can configure in your SSH config:

Host mygithost.com
   HostName mygithost.com
   User gitolite
   Port 4022

and then use mygithost.com:user/repo (or /repo.git) in the config of the local repository.

It is still highly likely that http://mygithost.com/user/repo is still valid in this context and leads to the repository.

Alternatively, a config option (on a per-repo level) where you could specify which URL to open, side-stepping the entire problem.

Discord not showing anything as RP.

Operating system

Arch Linux x86_64, Linux kernal 6.1.1-arch1-1

Neovim/Vim version

Neovim 0.8.2

CoC version

0.0.82

Discord version

flatpak

Reproduce step

  • Install coc-discord-rpc
  • Launch Discord
  • coc.nvim connects to Discord Gateway
  • Nothing happens in Discord

Expected result

Get Neovim as Discord RP.

Actual result

Discord doesn't show anything.

Relevant log output

No response

Where does the config go?

Hi there,
I know this might seem like a very stupid question that might have an extremely trivial answer, but where do I set the variables?
I simply can't seem to figure it out, as I've been messing around in my init.vim for the past 15 minutes to no avail.
Mind helping me out?

Doesn't work on MacOS

The extension works properly on my Linux devices. However, it could not connect to Discord RPC on MacOS.

Need a permission or setting? Or, is it a problem about the extension?
I've checked it in privacy settings but no missing or incorrect thing appears.

image

Config option detailsInExplorer showing unexpected behavior

Configuration:
"rpc.detailsInExplorer": "Workspace: {workspace}",
Expected Behavior:
Workspace: workspaceName in explorer of rich presence
Behavior Found:
Defaults to WorksnameName and Problems found

Issue:
The rpc.detailsInExplorer picks the default configuration ignoring the config string passed.
When the rpc.showProblems is used, it ignores the problems, but still doesn't shows the configured string pattern.

Environment:
CocInfo:

vim version: NVIM v0.4.4
node version: v15.5.1
coc.nvim version: 0.0.80-a112e6621b
coc.nvim directory: /home/abi/.config/nvim/plugged/coc.nvim
term: st-256color
platform: linux

coc-discord-rpc: v3.0,9

RPC: RPC_COULD_NOT_CONNECT: Could not connect

Operating system

WSL2 Ubuntu 20.04 LTS

Neovim/Vim version

Neovim 0.8.3

CoC version

0.0.82

Discord version

official

Reproduce step

I installed coc-discord-rpc using :CocInstall. It installed successfully but it instantly gave an error. I tried restarted nvim but it still didnt work

Expected result

I expected it to connect to discord

Actual result

Error message: `RPC: RPC_COULD_NOT_CONNECT: Could not connect

Relevant log output

No response

RPC isn't showing up

cot-discord-rpc says it's connected to Discord Gateway, but the game isn't showing up.
image
I checked the Display currently running games as status message box
image

Add workspaceText config option

Currently, there is a config option lowerDetailsNotFound which customises the text for if the workspace was not found.
However, if you set your lowerDetails to something like In workspace {workspace}, it looks silly when there is no workspace. It would be very useful if there was an option workspaceText to customise what {workspace} gets expanded to

Then you would simply set your lowerDetails to {workspace} and if there is a workspace it will expand to whatever your workspaceText is set to, otherwise it will expand to whatever lowerDetailsNotFound is expanded to

Discord Presence not changing.

Using Nvim in archlinux,
installed coc-nvim through spacevim custom plugins, all my coc extensions work so i dont think spacevim is the problem,
i see the discord connection message and when i run rpc.enable it says that discord rich was enabled for this workspace whoever i dont see any changes in discord nor do i get any error message.

[coc.nvim] RPC: TypeError: e.forEach is not a function error

I recently saw another issue opened with the same error and it was flagged as resolved and so I reinstalled the coc-discord-rpc extension on coc.nvim but the error still pops up everytime I open up neovim.

The error:
[coc.nvim] RPC: TypeError: e.forEach is not a function

Displaying the wrong app name

Operating system

ArcoLinux 5.17.6-arch1-1

Neovim/Vim version

Vim 9.0.910

CoC version

5.4.4

Discord version

official

Reproduce step

  • Install coc-discord-rpc and
  • open Vim

Expected result

The app name displayed on discord be Vim

Actual result

The app name displayed is NeoVim
image

Relevant log output

No response

Extension not parsing my options

Extension is not parsing eg. {workspace} or {filename}. It just left it as it is.

There is how it looks like
image

There is my coc config

{
    "rpc.checkIdle": false,
    "rpc.detailsViewing": "In {workspace}",
    "rpc.detailsEditing": "In {workspace}",
    "rpc.lowerDetailsEditing": "{filename}",
    "rpc.lowerDetailsViewing": "{filename}"
}

Feel free to ask for additional informations.

Workspace never found

NVim version:
v0.4.4 Release

OS
GNU/Linux Debian 11 x86_64, kernel 5.10.0-9-amd64

Steps to reproduce

mkdir temp-test
cd temp-test
nvim .

Expected result
The RPC shows "temp-test" as workspace_folder.

Actual result
"No workspace" is shown instead.

Configuration

{
"rpc.enabled": true,
"rpc.ignoreWorkspaces": [],
"rpc.workspaceElapsedTime": true,
"rpc.checkIdle": true,
"rpc.idleTimeout": 300,
"rpc.idleText": "๐Ÿ˜ด Idling...",
"rpc.problemsText": "{count} problems found",
"rpc.detailsEditing": "๐Ÿ“‚ {workspace_folder}",
"rpc.detailsViewing": "๐Ÿ“‚ {workspace_folder}",
"rpc.lowerDetailsViewing": "๐Ÿ“„ {file_name} โ€ข {total_lines} lines",
"rpc.lowerDetailsEditing": "๐Ÿ“„ {file_name} โ€ข {total_lines} lines",
"rpc.largeImage": "Editing a {Lang} file"
}

Additional context
Your VSCode extension works perfectly fine with the same settings (except of course with VSCode instead of NVim), which is quite strange??

rpc.idleText doesn't work?

I wanted to have a sarcastic little message for when I'm idle, so I gave it a value, and also set rpc.checkIdle to 10 seconds so I could easily see if the change worked. I unfocused my terminal, switched to Discord, waited 10 seconds... nothing. Waited a bit longer... nothing. Tried to find a coc command that could help me figure out the issue but I didn't find anything. Didn't see anything important in :CocOpenLog either.

Here's my coc-settings.json. Pretty bare, I know.

{
	// 0_coc
	"coc.preferences.extensionUpdateCheck": "daily",

	// 1_java
	"java.clean.workspace": true,
	"java.completion.enabled": true,
	"java.codeGeneration.generateComments": true,

	// 2_discord
	"rpc.workspaceElapsedTime": true,
	"rpc.checkIdle": 10,
	"rpc.idleText": "Zแดขz",

	"": ""
}

I originally tried a much longer string by the way, but after it didn't work I thought maybe there was a character limit so I set it to the Zzz, but obviously it still didn't work.
rpc

Link to images used in the app?

Just curious, but is it possible to link the images used in this extension? like the language images, since they're pretty good!

Idle Mode Doesn't Work

Operating system

Xubuntu 22.10 with Linux 5.19 kernel

Neovim/Vim version

Neovim 0.7.2

CoC version

0.0.82

Discord version

official

Reproduce step

I set the rpc.checkIdle to true and i waited for 10 seconds and nothing happens on discord. Is this a bug? Here's my CocConfig:
image

Expected result

Expecting the neovim icon changed to moon emoji or something but nothing happens.

Actual result

This is what it shows:
image
I minimized my terminal but the icon still using the wrench emoji which I set if I'm still editing a file.

Relevant log output

No response

cannot read property 'write' of null

im using m1 mac

this is my init.vim right now
Screen Shot 2021-09-02 at 10 04 57 PM

and the error is
[coc.nvim] Error on activate extension coc-discord-rpc: Cannot read property 'write' of null

Wiki for configuration variables uses wrong values

Unfortunately the Wiki cannot be pull requested against, so I have to just detail the issues and can't submit a fix.

  • The Wiki page shows that {appname} and {appversion} will get replaced with the Vim flavour, however, the code searches for {app_name} and {app_version} instead.
  • The code contains searches for {empty}, while the documentation mentions {null}.
  • It seems that largeImageIdle is no longer used, but the documentation still mentions it.
  • #54

In addition, Discord has potentially changed the API and added an assertion which I can't find in the plugin's code. If you set largeImage to be just {lang} (or any flavour thereof) and you work on a C file, the RPC call sends large_image: "C" to which Discord replies

"child "activity" fails because [child "assets" fails because [child "large_text" fails because ["large_text" length must be at least 2 characters long]]]"

This message is visible both in Vim and in the Discord binary's console, so it is a rejection on Discord's end.

Cannot enable the extension

I just installed this coc extension and its not working. When I try to enable the extension, it throws this error.

Error:

[coc.nvim]: UnhandledRejection: TypeError: Cannot read property 'write' of null
UnhandledRejection: TypeError: Cannot read propery 'write' of null

Live Linting shows editing Text File not the file it self on discord ?

A slight issue occurred recently though im not sure why . Is if you have ALE Live linting enabled , discord states that you are editing a text file , though im not all to sure why , i did try messing around to no eval , i had to disable live linting for the time, any ideas ?
image

though this should just be a python file and the only two buffers open is the quick fix list and the file it self .

Il be happy to help if i can that is : ) just let me know .

Rich presence not properly stopping

Every once in a while the rich presence will get stuck and not properly stop when exiting nvim and show you as idling until you kill the nvim background process

I am not sure what's causing this and it doesnt seem to be reproducable :/

Feature Request - Quiet Mode

Add something like rpc.quietMode so that it will suppress the message (see screenshot) if it cannot connect to Discord-RPC.
image

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.