MODiX icon indicating copy to clipboard operation
MODiX copied to clipboard

multiple commands in the same message do not work

Open cap5lut opened this issue 1 year ago • 2 comments

given the discord message "some initial resources would be $helloworld and $projects" it will execute the comand for helloworld, but completely ignores the latter (this was experienced in the C# discord server, where then each "mention" would cause the bot to provide some links(

expectation: the bot would provide messages for both invocations ($helloworld and $projects)

actual behavior: the bot provides the message for $helloworld and completely ignores $projects

cap5lut avatar Jun 18 '23 22:06 cap5lut

Culprit: TagService.cs

This would have to be changed to fetch a list and loop over to send multiple messages

            var tags = await _modixContext
                .Set<TagEntity>()
                .Where(x => x.GuildId == guildId)
                .Where(x => x.DeleteActionId == null)
                .Where(x => x.Name == name)
                .ToListAsync();

            foreach (var tag in tags)
            {
                    if (tag is null)
                        continue;

                    await messageChannel.SendMessageAsync(tag.Content, messageReference: new(invokingMessage.Id), allowedMentions: AllowedMentions.None);
            }

Edit: I don't know what I think about this however, seeing as some of the tags are humongous (see: $tryparse)

calledude avatar Jun 19 '23 17:06 calledude

From my perspective, the current behavior is the desired behavior. Otherwise, it'd be very easy to spam tags and overwhelm both the conversation and the bot. Like, 2 short tags in one message is generally totally reasonable, but consider 10 or 50 or 100, especially when some of these tags are already super long. And if we're going to have a limit, then 1 is at least an obvious, easy to explain number.

I'm open to increasing the limit if there's enough demand, though.

Scott-Caldwell avatar Jun 19 '23 19:06 Scott-Caldwell