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

1.22.0 broke existing code type check #562

Closed
EdJoPaTo opened this issue Apr 18, 2024 · 7 comments · Fixed by #578
Closed

1.22.0 broke existing code type check #562

EdJoPaTo opened this issue Apr 18, 2024 · 7 comments · Fixed by #578
Labels
bug Something isn't working

Comments

@EdJoPaTo
Copy link
Member

Existing code stopped working with 1.22.0, to be exact #553.

bot.on(
	'edited_message',
	async ctx =>
		ctx.reply(
			'Edited!',
			{reply_to_message_id: ctx.editedMessage.message_id},
		),
);
error TS18048: 'ctx.editedMessage' is possibly 'undefined'.

This looks like a mistake and should be fixed.

@EdJoPaTo EdJoPaTo added the bug Something isn't working label Apr 18, 2024
@AB-70
Copy link

AB-70 commented Apr 18, 2024

Facing the same issue after updating. Getting so many errors in my project because of type errors.

@KnorpelSenf
Copy link
Member

I am waiting for a review of #555.

@KnorpelSenf
Copy link
Member

#555 was merged and fixed this

@EdJoPaTo
Copy link
Member Author

EdJoPaTo commented May 9, 2024

Nope. npm it grammyjs/grammy#main'ctx.editedMessage' is possibly 'undefined'

Edit: same with npm it grammy@1.23

For someone wanting to look into it:

https://github.com/HAWHHCalendarBot/TelegramBot/blob/869cc0518443fe59f5334e62e61fa782678b0e45/source/parts/easter-eggs.ts#L6-L13

@EdJoPaTo EdJoPaTo reopened this May 9, 2024
@KnorpelSenf
Copy link
Member

Fascinating, investigating

@KnorpelSenf
Copy link
Member

@EdJoPaTo please check out #578

@EdJoPaTo
Copy link
Member Author

EdJoPaTo commented May 9, 2024

npm it grammyjs/grammy#main works now ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants