andweeb / presence.nvim

Discord Rich Presence for Neovim
793 stars 68 forks source link

Presence just doesnt work for some reason. #111

Closed haShinui closed 1 year ago

haShinui commented 1 year ago

Description

I am using nvchad with lazy.nvim. I can see that it is loaded in Lazy and its not working. I use hyprland, arch and installed discord with pacman. Discord is on the newest version and and I loaded the plugin with, this code here, same as my other plugins that work

{
    "andweeb/presence.nvim",
    event = "VeryLazy",
    config = function()
      require("presence").setup{
    -- General options
    auto_update         = true,                       -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
    neovim_image_text   = "The One True Text Editor", -- Text displayed when hovered over the Neovim image
    main_image          = "neovim",                   -- Main image display (either "neovim" or "file")
    client_id           = "793271441293967371",       -- Use your own Discord application client id (not recommended)
    log_level           = nil,                        -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
    debounce_timeout    = 10,                         -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
    enable_line_number  = false,                      -- Displays the current line number instead of the current project
    blacklist           = {},                         -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
    buttons             = true,                       -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
    file_assets         = {},                         -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
    show_time           = true,                       -- Show the timer
    -- Rich Presence text options
    editing_text        = "Editing %s",               -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
    file_explorer_text  = "Browsing %s",              -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
    git_commit_text     = "Committing changes",       -- Format string rendered when committing changes in git (either string or function(filename: string): string)
    plugin_manager_text = "Managing plugins",         -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
    reading_text        = "Reading %s",               -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): string)
    workspace_text      = "Working on %s",            -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
    line_number_text    = "Line %s out of %s",        -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
}
    end,
  }

I reinstalled discord and I just the plugin solo, dienstalled the rest and still didnt work, other people with nvchad dont have the problem. I went thorught the log files, its mostly gibberish, but I found this in the %home%_USER_%.local%share%nvim%lazy%presence.nvim%lua%presence%discord.luac; file

Received unexpected nonce - %s (expected %s)NIL
nonce(Received error event - %s (code %s)   data
ERROReventsevtinspectvim!Failed to decode payload: %s   warnlog    codemessageformatstring.Received unexpected opcode - %s (code %s)

I also attached the init.lua file becuase I cant really copy the errors, tried. Also renames it to initlua.txt because .lua does not work. initlua.txt

Neovim version

NVIM v0.9.1
Build type: Release
LuaJIT 2.1.0-beta3

OS information

Hyprland, Arch

Steps to reproduce

Highly unlikly that can be reproduced, becuase I am only one with problem

  1. Use lazy.nvim and nvchad
  2. Load plugin
  3. Thats what I had done and did not work for me

Logs

Already explained and show above with the file.

haShinui commented 1 year ago

Solved it my, my display current activity as status message was disabled for some unknown reason. I have it enabled on windows and never disabled it here. MY bad guys

EsamLasheen commented 3 months ago

yout put this where ?

{
    "andweeb/presence.nvim",
    event = "VeryLazy",
    config = function()
      require("presence").setup{
    -- General options
    auto_update         = true,                       -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
    neovim_image_text   = "The One True Text Editor", -- Text displayed when hovered over the Neovim image
    main_image          = "neovim",                   -- Main image display (either "neovim" or "file")
    client_id           = "793271441293967371",       -- Use your own Discord application client id (not recommended)
    log_level           = nil,                        -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
    debounce_timeout    = 10,                         -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
    enable_line_number  = false,                      -- Displays the current line number instead of the current project
    blacklist           = {},                         -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
    buttons             = true,                       -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
    file_assets         = {},                         -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
    show_time           = true,                       -- Show the timer
    -- Rich Presence text options
    editing_text        = "Editing %s",               -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
    file_explorer_text  = "Browsing %s",              -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
    git_commit_text     = "Committing changes",       -- Format string rendered when committing changes in git (either string or function(filename: string): string)
    plugin_manager_text = "Managing plugins",         -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
    reading_text        = "Reading %s",               -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): string)
    workspace_text      = "Working on %s",            -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
    line_number_text    = "Line %s out of %s",        -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
}
    end,
  }