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

Typo & false warning condition check in ChatClient.whisper() #247

Closed
Rydann opened this issue Mar 29, 2021 · 1 comment
Closed

Typo & false warning condition check in ChatClient.whisper() #247

Rydann opened this issue Mar 29, 2021 · 1 comment
Labels

Comments

@Rydann
Copy link
Contributor

Rydann commented Mar 29, 2021

Bug Report

Code

async whisper(user: string, message: string): Promise<void> {
	if (!this._needToShowWhisperWarning) {
		this._needToShowWhisperWarning = false;
		this._chatLogger.warn(
			`You did not set a botLevel option.
Pleasae note that your whispers might not arrive reliably if your bot is not a known or verified bot.`
		);
	}
	return this._whisperRateLimiter.request({
		target: toUserName(user),
		message
	});
}

Expected behavior

When a correct botLevel is set _needToShowWhisperWarning will have a value of false.
The condition check above should therefore only become true if the value of _needToShowWhisperWarning is also true.

Also there's a typo: Pleasae should be Please.

Actual Behavior

The exact opposite happens, which causes a warning to be issued when a correct botLevel is set.

Environment

  • Version: 4.5.2
@d-fischer
Copy link
Member

PR merged, thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants