Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to see join date of other users #48

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 2 additions & 10 deletions DiscordBot/Modules/UserModule.cs
Expand Up @@ -209,19 +209,11 @@ private async Task DisplayProfile(IUser user)
await Task.Delay(TimeSpan.FromMinutes(3d));
await profile.DeleteAsync();
}

[Command("joindate"), Summary("Display your join date. Syntax : !joindate")]
private async Task JoinDate()
{
var userId = Context.User.Id;
DateTime.TryParse(_databaseService.GetUserJoinDate(userId), out DateTime joinDate);
await ReplyAsync($"{Context.User.Mention} you joined **{joinDate:dddd dd/MM/yyy HH:mm:ss}**");
await Context.Message.DeleteAsync();
}

[Command("joindate"), Summary("Display join date of mentioned user. Syntax : !joindate @user")]
[Command("joindate"), Summary("Display your join date or join date of mentioned user. Syntax : !joindate @user")]
private async Task JoinDate(IUser user)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private async Task JoinDate(IUser user = null)

You're bad

{
user = user ?? Context.User;
var userId = user.Id;
DateTime.TryParse(_databaseService.GetUserJoinDate(userId), out DateTime joinDate);
await ReplyAsync($"{Context.User.Mention} you joined **{joinDate:dddd dd/MM/yyy HH:mm:ss}**");
Expand Down