Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing and improving helpers #125

Open
91 tasks
nayr7 opened this issue Jun 27, 2024 · 2 comments · May be fixed by #126
Open
91 tasks

Fixing and improving helpers #125

nayr7 opened this issue Jun 27, 2024 · 2 comments · May be fixed by #126
Assignees
Labels
bug Something isn't working. enhancement New feature or request

Comments

@nayr7
Copy link
Contributor

nayr7 commented Jun 27, 2024

Abstract

This issue is to serve as a tracking list for issues related to the new helpers feature (bugs, library api, implementation details, ...).

Description

Each individual helpers must be thoroughly tested to ensure they work as intended and can be used correctly.

By order of priority, bugs should be fixed first, then we should seek to improve the api so that it's easier to read code that use them, and then the rest can come later.

Bug fixing

helpers/guild

  • beginPrune()
  • getPruneCount()
  • edit() (editGuildMFALevel)
  • delete()
  • edit() (editGuild)
  • getAuditLogs()
  • deleteRole()
  • editRole()
  • getInvites()
  • getVanity()
  • editMember()
  • removeMember()
  • getBan()
  • getBans()
  • ban()
  • removeBan()
  • getIntegrations()
  • getWebhooks()
  • deleteIntegration()
  • preview()
  • searchMembers()
  • editEmoji()
  • deleteEmoji()
  • getRegions()
  • editSticker()
  • deleteSticker()
  • getScheduledEvent()
  • getScheduledEvents()
  • edit() (editScheduledEvent)
  • delete() (deleteScheduledEvent)
  • getEventUsers()
  • getRules()
  • getRule()
  • deleteRule()
  • editRule()

helpers/message

  • send()
  • reply()
  • edit()
  • delete()
  • getMessages()
  • getMessage()
  • react()
  • removeReaction()
  • removeReactionEmoji()
  • getReactions()
  • clearReactions()
  • getThreadMember()
  • getThreadMembers()
  • remove() (removeThreadMember)
  • addThreadMember()
  • leaveThread()
  • joinThread()
  • startThread()

helpers/user

  • getMember()
  • getMembers()
  • setNickname()
  • addRole()
  • removeRole()
  • leave()
  • getSelf()
  • getCommands()
  • getCommand()
  • registerCommand()
  • bulkRegisterCommands()
  • edit()
  • delete()
  • reply()
  • update()
  • followup()
  • edit()
  • getResponse()
  • delete() (deleteInteractionResponse)
  • deferResponse()
  • suggest()
  • sendModal()

helpers/channel

  • pin() (addChannelMessagePin)
  • removePin() (deleteChannelMessagePin)
  • getPins()
  • edit()
  • createChannel()
  • deleteChannel()
  • createInvite()
  • delete() (deleteInvite)
  • getInvites()
  • getWebhooks()
  • deleteWebhook()
  • edit() (editWebhook)
  • newThread()
  • createStageInstance()
  • editStageInstance()
  • deleteStageInstance()

API Improvements

TODO

Implementation details

Reminder

Currently the helpers API rely on "magic" macros getClient and mainClient in order to access a user-made DiscordClient. This method has the benefit to avoid relying on global variables. The drawback is that we are at the mercy of the Nim's compiler evaluation order which can be brittle and unreliable and often throws the compile-time error "Client not registered' when the order is wrong. We use templates to defer evaluating the getClient generated symbol but this means implementing and testing helpers become harder since we have to watch out for template specific quirks. We should probably study a better way to do this internally.

@krisppurg
Copy link
Owner

any updates?

@krisppurg krisppurg added enhancement New feature or request bug Something isn't working. labels Jul 15, 2024
@nayr7
Copy link
Contributor Author

nayr7 commented Aug 9, 2024

helpers fix: #126

@krisppurg krisppurg self-assigned this Aug 10, 2024
@krisppurg krisppurg linked a pull request Aug 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants