Code Monkey home page Code Monkey logo

ken's Issues

Delete RespondEmbed?

Hello,

With a RespondEmbed I don’t see that DeleteAfter is available nor do I see a way to delete it in general. Is it still possible to delete it somehow?

Thank you

add new guild scope to slash commands

add new guild scope to slash commands

As we discussed, this project needs an implementation for guild scoped slash commands, especially for faster testing commands.

As the documentation says.

Global commands are cached for 1 hour. That means that new global commands will fan out slowly across all guilds, and will be guaranteed to be updated in an hour.
read more

and

Guild commands update instantly. We recommend you use guild commands for quick testing, and global commands when they're ready for public use.
read more

as it seems, they differ only by the URL

url = "https://discord.com/api/v8/applications/<my_application_id>/commands"
url = "https://discord.com/api/v8/applications/<my_application_id>/guilds/<guild_id>/commands"

and in the official discord-go library it's also just a small change

// ApplicationCommandCreate creates a global application command and returns it.
// appID       : The application ID.
// guildID     : Guild ID to create guild-specific application command. If empty - creates global application command.
// cmd         : New application command data.
func (s *Session) ApplicationCommandCreate(appID string, guildID string, cmd *ApplicationCommand) (ccmd *ApplicationCommand, err error) {

read more

so as I see, we need only replace the default value right here, to a guild-id to register commands in a smaller scope

ccmd, err = s.ApplicationCommandCreate(e.User.ID, "", toApplicationCommand(cmd))

read more

Things we need to observe

  • backward compatibility to older ken versions, so we should keep the old names RegisterCommands and registerCommand and rename the new version to something like RegisterCommandsByGuildID and registerCommandByGuildID

FollowUp Messages sometimes lead to `interaction failed` error

Sending Ctx#FollowUp after Ctx#Defer sometimes lead to an interaction failed error.

image

This might be cause by waiting for server response.

ken/context.go

Lines 71 to 75 in 281f024

return c.FollowUp(true, &discordgo.WebhookParams{
Embeds: []*discordgo.MessageEmbed{
emb,
},
})

It might also be a timing issue that the follow up arrives at the server earlier than the defer. This might be tested further.

Message Component Bindings

  • Add message component bindings to command interaction responses and follow up messages.
  • Add event handlers for message component interactions.

Use ken with discordgo.InteractionCreate

Hi, I'm starting to use Ken on a new project. But when I register a listener to discordgo.InteractionCreate events I got panic: MessageComponentData called on interaction of type ApplicationCommand. There is any way to continue using ken and also listen to InteractionCreate?

Add message components on message creation

Currently, message components are added after the message has been sent by editing the message. Unfortunately, this does not work with ephemeral messages, so it should be possible to send a follow-up message with message components already attached on sending the message.

This issue is related to zekroTJA/shinpuru#394.

Support for user apps

Short description

Hello,

Recently, discord rolled out a new feature allowing bots to be linked to a user and used in DM's upon other things. Discordgo currently has an open pull request to adapt this feature, but I assume it will be merged soon. It would be very nice to have ken also able to support these commands in direct messages.

Attachments

No response

Updating Application Commands instead of deleting/creating them

Because only 200 commands can be created at one day, it would be better for development if commands registered could be temporarily saved and then updated instead of deleted and re-created.

This would require some kind of temporary command store to save to and read commands from.

Provide endpoint to get all registered commands with their details

There should be an endpoint on Ken like GetCommandInfo() which returns a list of all registered commands with their details.

It should also be possible to pass custom info parsers to ensure availability of additional fields added via custom command implementations.

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.