I've been trying to make a timeout command but it won't work.
I've seen youtube tutorials doing the same thing, but for some reason it doesn't work for me. Here's the code:
public async Task TimeOut(CommandContext ctx, DiscordMember m)
{
if (ctx.Member.Permissions.HasPermission(Permissions.Administrator))
{
await m.TimeoutAsync(DateTime.Now + TimeSpan.FromSeconds(60));
await ctx.Channel.SendMessageAsync("User has been successfully timed out");
}
}
Adding the command error event just gives me the "Unauthorized 403" error, and from what i saw, that means that the requestor is not authorized tho im the owner of the server and have given myself the role of admin. Also the intents are set to DiscordIntents.All. The bot has admin perms. Thanks for reading!