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

Update LoginService login format #22

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions DiscordBot.App/Services/LoginService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,22 @@
if (trimmed.StartsWith("!login"))
{
var input = trimmed.Remove(0, 7);
var index = input.IndexOf(' ');
var parts = input.Split(', ');

Check failure on line 61 in DiscordBot.App/Services/LoginService.cs

View workflow job for this annotation

GitHub Actions / build

Too many characters in character literal

Check failure on line 61 in DiscordBot.App/Services/LoginService.cs

View workflow job for this annotation

GitHub Actions / build

Too many characters in character literal

if (index == -1)
if (parts.Length < 2)
{
await e.Message.RespondAsync("Incorrect format! Write **!login USERNAME PASSWORD**");
await e.Message.RespondAsync("Incorrect format! Write **!login USERNAME, PASSWORD**");
return;
}

var accountName = input[..index];
var password = input.Substring(index + 1, input.Length - index - 1);
var accountName = parts[0];
var password = parts[1];

await HandleLoginCommand(e, accountName, password);
}
else
{
await e.Message.RespondAsync("Incorrect format! Write **!login USERNAME PASSWORD**");
await e.Message.RespondAsync("Incorrect format! Write **!login USERNAME, PASSWORD**");
}
}
}
Loading