Matt
Matt
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
Slash commands can be registered either globally or for a certain guild. However, if you try to register them globally, they can take up to an hour to cache across all guilds. So, it is recommended that you only register them for a certain guild for testing, and only register them globally once they're ready to be used.
Slash commands can be registered either globally or for a certain guild. However, if you try to register them globally, they can take up to an hour to cache across all guilds. So, it is recommended that you only register them for a certain guild for testing, and only register them globally once they're ready to be used.
D#+ has the same thing in their docs https://dsharpplus.github.io/DSharpPlus/articles/slash_commands.html#setup
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
I use Disnake for my bots and when developing slash commands I always add the guild ID as that updates a lot faster than no guild ID... doubt that's the issue here though
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
yeah I'm not sure why your first Console.WriteLine isn't being hit 😅
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
so maybe passing it blank is not expected, idk though
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
any reason why you create a blank config here?
var slashConfig = new SlashCommandsConfiguration {};
var slashConfig = new SlashCommandsConfiguration {};
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
yeah me too lol
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
Discord client is showing that command in lowercase too
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
can you try changing SlashCommand("ToggleTest" to SlashCommand("toggletest"?
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
silly thing... the docs always use [SlashCommand] with lowercase name - maybe that's a requirement?
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
I don't think that would be the cause of the issue though, as the command shows in your Discord client
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
Slash commands can be registered either globally or for a certain guild. However, if you try to register them globally, they can take up to an hour to cache across all guilds. So, it is recommended that you only register them for a certain guild for testing, and only register them globally once they're ready to be used.
Slash commands can be registered either globally or for a certain guild. However, if you try to register them globally, they can take up to an hour to cache across all guilds. So, it is recommended that you only register them for a certain guild for testing, and only register them globally once they're ready to be used.
from https://dsharpplus.github.io/DSharpPlus/articles/slash_commands.html
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
I didn't spot anything wrong with your code 🤔
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
alright I'll look into it then
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
perhaps your bot doesn't have the permission to send messages?
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
does Discord give you that option?
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
hmmm... when doing /toggletest are you passing an user?
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
can you add a Console.WriteLine call to your code to check if your Toggle function is being run?
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
should that check be inside the other if?
if (IsOn==false)
{
await ctx.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, new DiscordInteractionResponseBuilder().WithContent("Test toggle shutting down"));
_clientInstance.MessageCreated += TestMessage;
}
if (IsOn==false)
{
await ctx.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, new DiscordInteractionResponseBuilder().WithContent("Test toggle shutting down"));
_clientInstance.MessageCreated += TestMessage;
}
133 replies
CC#
Created by Immortal on 6/19/2023 in #help
❔ Need help with discord command to toggle a task
yeah that's fine in my opinion
133 replies