public async Task KickAsync( [Description("Member to ban")] SkeletonUser user, [Description("Reason of the ban")][Remainder] string reason) { await Context.Guild.BanMemberAsync(user.Id, reason); await RespondEmbedAsync($"{user.FullName()} was banned. ({reason})"); }
public async Task HackbanAsync(SkeletonUser target, [Description("Reason of the ban.")][Remainder] string reason = null) { if (Context.Guild.Members.Any(x => x.Id == target.Id)) { throw new FoxException($"You can't hackban that target because they're on this guild. Please use `{Context.Prefix}ban <target> [reason]` instead."); } await Context.Guild.BanMemberAsync(target.Id, 7, reason); await SimpleEmbedAsync($"{target.FormatUser()} has been hackbanned from the guild. Reason: {reason ?? "Not specified."}"); }
public async Task AvatarAsync(SkeletonUser user = null) { user ??= new SkeletonUser(Context.User); var embed = new LocalEmbedBuilder { Color = Color.Goldenrod, ImageUrl = user.AvatarUrl } .WithAuthor($"{user.FullName} | {user.Id}"); await RespondAsync(embed.Build()); }
public async Task UnbanAsync([Description("Member to unban")] SkeletonUser target, [Description("Reason of the unban")][Remainder] string reason = null) { try { await Context.Guild.UnbanMemberAsync(target.Id, reason ?? "Not specified."); await SimpleEmbedAsync($"{target.FormatUser()} has been unbanned from this guild. Reason: {reason ?? "Not specified."}"); } catch (NotFoundException) { await SimpleEmbedAsync($"{target.FormatUser()} is not banned yet."); } }
public Task UserIdAsync([Remainder] SkeletonUser user = null) { user = user ?? new SkeletonUser(Context.User); return(RespondAsync($"Id of the user: `{user.FormatUser()}`: {user.Id}")); }
public Task AvatarAsync([Remainder] SkeletonUser user = null) { user = user ?? new SkeletonUser(Context.User); return(RespondAsync(embed: new DiscordEmbedBuilder().WithImageUrl(user.AvatarUrl))); }
public Task LookupAsync(SkeletonUser skeleton) { return(RespondAsync("Skeleton found: " + skeleton.FullName)); }
public static string FullName(this SkeletonUser user) { return($"{user.Username}#{user.Discriminator}"); }
public static string FormatUser(this SkeletonUser user) { return(user.Username + "#" + user.Discriminator); }