Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Command("wrongchannel")]
- public async Task WrongChannel(SocketGuildUser user, SocketGuildChannel chan)
- {
- var correctChannel = chan as ISocketMessageChannel;
- var pastMessages = Context.Channel.GetMessagesAsync(5).FlattenAsync()
- var userMessage = pastMessages.Result.FirstOrDefault(m => m.Author == user as IUser);
- await ReplyAsync($"Sorry {user.Mention}, that's the incorect channel. Please goto <#{correctChannel.Id}>.");
- await correctChannel.SendMessageAsync($"{user.Mention}'s Message: {userMessage}");
- await userMessage.DeleteAsync();
- }
Add Comment
Please, Sign In to add comment