#Commands aren't executing for some reason

1 messages · Page 1 of 1 (latest)

crimson otter
#

I've tried a lot of debugging stuff but none of them worked...
It was working about 2-ish hours ago but then it just kinda stopped working for some reason. I added a command it just doesn't work anymore for some reason. Even if i deleted that command it still doesn't work.

My code is as follows:

public InteractionHandler(IServiceProvider provider, DiscordSocketClient discord, InteractionService interactions, IConfigurationRoot config)
{
    Provider = provider;
    Discord = discord;
    Interactions = interactions;
    Config = config;

    Discord.InteractionCreated += OnInteractionCreated;
    Interactions.SlashCommandExecuted += OnSlashCommandExecuted;
}

public async Task InitAsync()
{
  await Interactions.AddModulesAsync(System.Reflection.Assembly.GetEntryAssembly(), Provider);
}

private async Task OnInteractionCreated(SocketInteraction interaction)
{
  SocketInteractionContext context = new SocketInteractionContext(Discord, interaction);

    try
    {
        await Interactions.ExecuteCommandAsync(context, Provider);
    }
    catch (Exception e)
    {
        // logging stuff (omitted cuz message limits)
    }
}```
I am running `InitAsync()` very early on, before the bot goes online at all.

I've checked it with the debug log level, and it DID show me that it was receiving the events fine so (screenshot)... I dunno what's going on here. There's no indication that anything is getting blocked either.

I also set a breakpoint inside of `OnInteractionCreated` and confirmed it was firing, and that it even got past the `ExecuteCommandAsync();` call. It just didn't run the code i guess? Through another breakpoint I also determined that the modules are getting installed correctly. There's nothing that leads me to solving this problem at all.

I also tested it on the latest MyGet release (`3.9.0-20230302.10`) and it has the same problem.

To reiterate: there is no error, there is no problems in installing the commands, there is no problem firing the event. It is specifically the `ExecuteCommandAsync();` just not working for some reason.
#

I just tested some more theories and found that it is actually running ExecuteCommandAsync() it's just not... responding?

#

i made sure all the commands are pushed too so that shouldn't be a problem

#

tried it with a defer and follow up, that doesn't work either.

#

and now i've restarted my whole computer and it works again