Giter VIP home page Giter VIP logo

nvicord's Introduction

Nvicord

demo

demo ss

At this point in time, this is more of a demonstration of an idea than a fully functional client library

However it does have the bare minimum to be able to interact with any channel in any server.

Sending dms is currently not possible, however if you are sent a dm, it will notify you

Install

I recommend also installing nvicord-ui which contains some bare bones ui for this library

Requirements

  • Python 3.10+

Python modules

No lua modules are required.


This should work with a plugin manager

This is how I have it setup

After cloning add the following to your init.lua

local discordui = require"discord-ui"
discordui.setup{
    token = "YOUR DISCORD TOKEN HERE" --optional, if not provided, a prompt to login will be given
    user_id = "YOUR USER ID" --obtained by right clicking on your user in discord and clicking "copy user id", developer mode needs to be enabled for this
}

It is possible to use nvicord without the ui plugin

But it's just not meant for user interaction, and so it will be left undocumented here

If you really want to know, checkout the functions in lua/discord/_discord.lua

Using

  1. To open the client (if you are using nvicord-ui) run
nvim "discord://Server name here/Channel name here"

or

nvim "discord://id=server-id-here/id=channel-id-here"
  1. After neovim opens, 2 buffers will be created, an /input buffer, and an /output buffer.
    • To see the buffers, use the :ls command
  2. Only the /ouput buffer will be shown by default, to open the input buffer run :lua require"discord-ui".display_channel()
    • Select any buffer that contains the channel name/id you want to open
    • this will open a new tab with a split, top buffer containing the output, bottom buffer containing the input
  3. To send a message, put something in the input buffer, and do :lua require "discord".send_message_bind()
    • I recommend binding this to a key (hence why the function has bind in the name)
    • this function makes sure you're in a discord:// input buffer, and sends the contents of the buffer to the channel you're in

Messages can also be sent by doing:

require"discord".send_message({content = "Text to send"}, "channel_id")

The first argument is a message object documented here, the second argument is the id of the channel to send the message to

More ui documentation will be at nvicord-ui

Goals

  • Ability to delete messages in output buffer
  • Ability to send attachments
  • Ability to reply to messages
  • Proper documentation
  • Sending dms / ability to be in a dm channel
  • Add highlights for output text (somewhat complete, usernames are highlighted)
  • Support a plain discord:// uri
    • This would allow running nvim discord:// which would open a server selection screen, then a channel selection screen
  • Server selection screen
  • Channel selection screen
  • Ability to login with username/password
  • Support server names/ channel names in discord:// uri

Non-goals

  • Stylistic interface
    • the goal is to create a minimal functional client where certain functions can be overwriten by the user that would give it a better interface
  • Voice chat
    • I do not want to deal with this lol

nvicord's People

Contributors

euro20179 avatar

Watchers

 avatar

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.