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

add first bits of jinja template support #50

Merged
merged 8 commits into from Dec 23, 2022
Merged

add first bits of jinja template support #50

merged 8 commits into from Dec 23, 2022

Conversation

andreaskoepf
Copy link
Collaborator

@andreaskoepf andreaskoepf commented Dec 21, 2022

[WIP]

Notes:

  • had to change the exclude configuration in .pre-commit-config.yaml to exclude: "build|stubs|^bot/templates/" because chat message templates should not be reformatted and some should not have a newline before EOF.

@andreaskoepf andreaskoepf marked this pull request as ready for review December 22, 2022 17:42
@andreaskoepf
Copy link
Collaborator Author

andreaskoepf commented Dec 22, 2022

This PR is growing too fast. Initially I only wanted to add some jinja templates .. but now it became half a bot framework. ;-)

Copy link
Collaborator

@yk yk left a comment

Choose a reason for hiding this comment

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

looks really nice, thank you :)

expiry_time = discord_timestamp(self.expiry_date, DiscordTimestampStyle.long_time)
expiry_relatve = discord_timestamp(self.expiry_date, DiscordTimestampStyle.relative_time)
return await self.bot.post_template(
template_name, task=self.task, expiry_time=expiry_time, expiry_relatve=expiry_relatve
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

;-) good catch, thx

@andreaskoepf andreaskoepf merged commit b4cdced into main Dec 23, 2022
@andreaskoepf andreaskoepf deleted the bot_dev branch December 23, 2022 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants