andweeb / presence.nvim

Discord Rich Presence for Neovim
845 stars 67 forks source link

Allow configuring a custom main image with a custom Discord app client id #60

Open CantCode023 opened 2 years ago

CantCode023 commented 2 years ago

Description

I don't know what's wrong, I changed the Client ID and the main image and stuff but the image doesn't load on the presence. I already uploaded an image with the same name as the main image and the image size is 512x512 (the minimum file size) but it still didn't work.

Client ID: 940986515591417917 Main Image: largeshino

I don't know if I'm doing it wrong but I use the VimL

let g:presence_auto_update         = 1
let g:presence_neovim_image_text   = "Coding"
let g:presence_main_image          = "largeshino"
let g:presence_client_id           = "940986515591417917"
let g:presence_debounce_timeout    = 10
let g:presence_enable_line_number  = 0
let g:presence_blacklist           = []
let g:presence_buttons             = 1
let g:presence_file_assets         = {}

" Rich Presence text options
let g:presence_editing_text        = "Editing %s"
let g:presence_file_explorer_text  = "Browsing %s"
let g:presence_git_commit_text     = "Committing changes"
let g:presence_plugin_manager_text = "Managing plugins"
let g:presence_reading_text        = "Reading %s"
let g:presence_workspace_text      = "Working on %s"
let g:presence_line_number_text    = "Line %s out of %s"

I put this inside my nvim config file because I don't know where to put it. Other things works like the title and stuff but the image doesn't.

Neovim version

NVIM v0.7.0-dev+1018-g8215c0594
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

OS information

Windows 11 Home Insider Preview 22543.1000

Steps to reproduce

  1. Make new application in https://discord.com/developers/applications
  2. Upload Image
  3. Copy Client Id
  4. Go to neovim config file (~/AppData/Local/nvim/init.vim)
  5. Paste let g:presence_auto_update = 1 let g:presence_neovim_image_text = "Coding" let g:presence_main_image = "largeshino" let g:presence_client_id = "940986515591417917" let g:presence_debounce_timeout = 10 let g:presence_enable_line_number = 0 let g:presence_blacklist = [] let g:presence_buttons = 1 let g:presence_file_assets = {}

    " Rich Presence text options let g:presence_editing_text = "Editing %s" let g:presence_file_explorer_text = "Browsing %s" let g:presence_git_commit_text = "Committing changes" let g:presence_plugin_manager_text = "Managing plugins" let g:presence_reading_text = "Reading %s" let g:presence_workspace_text = "Working on %s" let g:presence_line_number_text = "Line %s out of %s"

  6. Save and close
  7. Run a file with nvim
  8. Check Discord

Logs

I'm sorry but where do I check logs?

I don't quite understand the prompt: The full list of :messages from one or more nvim instances

andweeb commented 2 years ago

Hi @CantCode023! Oo interesting, so you're looking to configure the actual main Neovim image with a custom one?

The g:presence_main_image option is only intended to configure presence.nvim to use the file icon as the main image instead of the default Neovim logo, which is why the option expects only "neovim" or "file". It currently doesn't support a custom asset key to use as the main image.

I can convert this issue into a feature request but I'll have to think about how to add support for this since if we were to support a config like g:presence_main_image = "largeshino", it's unclear whether what the secondary image should be (would it be the Neovim logo or the file icon?).

I've added a card here so you can track the progress on this. I've been quite busy lately but I'll report back when I've gotten around to it!