'Discord Bot - The input text has too few parameters
When I execute my command I got the error
"The input text has too few parameters"
all I want to do is an info command. I already know that "socketMessage.Author" is causing the error but not exactly why.
Can someone could tell me how to correct the error "The input text has too few parameters " given by "socketMessage.Author" ?
btw I use Discord.NET
Here's what I have for the info command :
[Command("info")]
[Alias("userinfo")]
public async Task InfoAsync(SocketMessage socketMessage, SocketGuildUser? socketGuildUser = null)
{
if (socketGuildUser == null)
{
socketGuildUser = Context.User as SocketGuildUser;
}
var embed = new EmbedBuilder()
.WithTitle($"Info of {socketGuildUser.Username}#{socketGuildUser.Discriminator}")
.AddField("ID :", $"`{ socketGuildUser.Id}`", true)
.AddField("Name :", $"`{socketGuildUser.Username}#{socketGuildUser.Discriminator}`", true)
.AddField("Created at :", $"`{socketGuildUser.CreatedAt}`", true)
.AddField("Joined at :", $"`{socketGuildUser.JoinedAt}`")
.AddField("Voice info", "`>>>`")
.AddField("Voice channel :", $"`{socketGuildUser.VoiceChannel}`", true)
.AddField("Voice session ID :", $"`{socketGuildUser.VoiceSessionId}`", true)
.WithThumbnailUrl(socketGuildUser.GetAvatarUrl() ?? socketGuildUser.GetDefaultAvatarUrl())
.WithFooter("Information requested by :", $"{socketMessage.Author}")
.WithCurrentTimestamp()
.WithColor(new Color(41, 129, 207))
.Build();
await ReplyAsync(embed: embed);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
