--Lazy setup
{
'osteensco/discordStatus.nvim',
dependencies = { "osteensco/dotenv.nvim" },
},
-- Defaults
require('discordStatus').setup({
--Default behavior is status only changes when first neovim instance is started on your machine or last neovim instance is closed.
persistAcrossInstances = true, --Set to false if you want your status updated every time a neovim instance is opened/closed.
discordEnvVariable = "DISCORDTOKEN", --The environment variable name of your discord token.
discordAuthToken = nil, --Alternatively provide the auth token directly.
openStatus = { --Status(es) to set when neovim is opened.
"Neovim BTW"
},
closeStatus = { nil }, --Status(es) to set when neovim is closed.
})
Apart from setting an environment variable normally, you can add a .env file in your neovim config's root directory and discordStatus.nvim will look for it here if not found otherwise.
If you are providing your auth token directly, you will need to read it in yourself.
In openStatus
and closeStatus
fields, if the length is > 1 a random status from this table will be chosen. A value of nil
will simply clear out your status.
An easy way to get an auth token is via browser dev tools. Go to discord.com, login, and navigate to the network tab. For a more detailed explaination, click here.