Created
July 25, 2019 15:19
-
-
Save KiroMusic/34d55fe8a155e6605d15f0d78c35faa4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Command("remove")] | |
public async Task HasRemoved(SocketGuildUser user) | |
{ | |
var account = GuildAccounts.GetAccount(Context.Guild.Id); | |
if (account.hostlist.Contains(Context.User.Id)) | |
{ | |
if (account.Queue.Contains(user.Id)) | |
{ | |
account.Queue.RemoveAll(r => r == user.Id); | |
var embed = new EmbedBuilder(); | |
embed.WithAuthor(author => | |
{ | |
author | |
.WithIconUrl(Context.User.GetAvatarUrl()) | |
.WithName(Context.User.Username); | |
}); | |
embed.WithTitle("Gone!"); | |
embed.WithDescription($"{user.Mention} has been removed from the queue!"); | |
embed.WithColor(okcolor); | |
embed.WithThumbnailUrl(user.GetAvatarUrl()); | |
await Context.Channel.SendMessageAsync("", false, embed.Build()); | |
GuildAccounts.SaveAccounts(); | |
} | |
else | |
{ | |
await Context.Channel.SendMessageAsync($"{ Program.Client.GetGuild(81680075119931392).Emotes.FirstOrDefault(x => x.Name == "xmark")} {Context.Guild.GetUser(id).Mention} isn't in the queue."); | |
} | |
} | |
else | |
{ | |
await Context.Channel.SendMessageAsync($"{ Program.Client.GetGuild(563857280227999754).Emotes.FirstOrDefault(x => x.Name == "xmark")} You aren't a host!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment