GithubHelp home page GithubHelp logo

dimscmd's People

Contributors

chitatofish avatar ire4ever1190 avatar izawey479 avatar krisppurg avatar williamhatcher 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

Watchers

 avatar  avatar  avatar  avatar

dimscmd's Issues

Slash commands support

It could look like this, not too sure about multiple options

proc foo(bar: string) {.slash_command.} =
    ## Foo some bars
   discard await discord.api.sendMessage(m.channel_id, "Foo be spitting dem bars tho.")

Help message for normal commands

Currently I have a proc which generates a help message but it's unused

Biggest issue is coming up with a nice layout so it looks good. Will most likely copy how other libs do it

Add error messages when scanning parameters

Return an error message to the user if they entered a command incorrectly e.g.

cmd.addChat("square") do (num: int):
    # square the number and send back

user: $$square seven
bot: Expected number but got "seven"

Memory leak in devel

For some reason devel runs into either a memory leak or infinite loop when deleting memory

Example

 /home/runner/work/dimscmd/dimscmd/tests/testCommands.nim(317) testCommands
/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/asyncdispatch.nim(2022) waitFor
/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/asyncdispatch.nim(1711) poll
/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/asyncdispatch.nim(1452) runOnce
/home/runner/.choosenim/toolchains/nim-#devel/lib/system.nim(27) processPendingCallbacks
/home/runner/.choosenim/toolchains/nim-#devel/lib/system/arc.nim(179) nimDestroyAndDispose
/home/runner/.choosenim/toolchains/nim-#devel/lib/system/arc.nim(179) nimDestroyAndDispose
/home/runner/.choosenim/toolchains/nim-#devel/lib/system/arc.nim(179) nimDestroyAndDispose
...

Add autocomplete

Add easy syntax to support autocomplete. Current idea at the moment is

proc nameComplete(i: Interaction, current: string) {.async.} =
  discard

cmd.addSlash("ping") do (name {.complete: nameComplete.}: string) {.async.} =
  echo name

I think its a bit verbose though so might improve it once I play around with auto complete for a bit

Slash command needs description, but addSlash not provide argument

Describe the bug

As reading source, this line
in addCommand needs description, but addSlash (link) doesn't provide argument for description.

Steps to reproduce

From example of dimscmd provides the code: cmd.addSlash("add") do (a: int, b: int):

Expected behavior

we should be able to add argument for description or make description is not required.

Screenshots

image

Additional context

Maybe am I missing something or I have to provide description via parameters? Sorry if I didn't understand it correctly.

Add more typed parameters to commands

From

## Currently it only supports int and string parameter types
it looks like only int and string are the supported types. Lets see if we can't add User/Member, Role, Channel, and Guild types.

it would parse full names (eg: William_CTO#5415), pings/mentions @William_CTO (which is really <@!ID>), etc
This could then return the id of the user/role/channel, etc or a User object, etc fetched from the Discord API

addChat failing to parse user id

Describe the bug

Using a function such as cmd.addChat("hello") do (user: Option[User]) may output "$id is not a proper userID" even though the ID is correct.
Some of my own logic showed that user.isNone == true.

Steps to reproduce

Try to run a command on any User ID with 19 digits (ex: 1002133811397656709)

Expected behavior

Commands run as expected on 19 digits ids.

Additional Context

Have been discussing this issue on the Dimscord server as ieltan#5830.

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.