Beispiel #1
0
        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})");
        }
Beispiel #2
0
        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."}");
        }
Beispiel #3
0
        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());
        }
Beispiel #4
0
 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.");
     }
 }
Beispiel #5
0
 public Task UserIdAsync([Remainder] SkeletonUser user = null)
 {
     user = user ?? new SkeletonUser(Context.User);
     return(RespondAsync($"Id of the user: `{user.FormatUser()}`: {user.Id}"));
 }
Beispiel #6
0
 public Task AvatarAsync([Remainder] SkeletonUser user = null)
 {
     user = user ?? new SkeletonUser(Context.User);
     return(RespondAsync(embed: new DiscordEmbedBuilder().WithImageUrl(user.AvatarUrl)));
 }
Beispiel #7
0
 public Task LookupAsync(SkeletonUser skeleton)
 {
     return(RespondAsync("Skeleton found: " + skeleton.FullName));
 }
Beispiel #8
0
 public static string FullName(this SkeletonUser user)
 {
     return($"{user.Username}#{user.Discriminator}");
 }
 public static string FormatUser(this SkeletonUser user)
 {
     return(user.Username + "#" + user.Discriminator);
 }