Skip to content

Commit

Permalink
1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelcmtd committed Feb 29, 2024
1 parent 0738364 commit c057a20
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.5.3

- Use the time of startup minus one day for the publish time check
- Fix check for webhooks (they're now called `WebhookAuthor`)

## 1.5.2

- Print an error and `exit(1)` instead of crashing when no token is provided
Expand Down Expand Up @@ -28,7 +33,7 @@
- Fixed YouTube descriptions being empty (the channel page doesn't have them)
- `checkYoutube` now makes sure videos weren't published before IED'23
(which is a stopgap measure for stopping it from telling people about old videos
in certain edge cases, that have happened btw)
in certain edge cases, [that have happened btw](https://discord.com/channels/551138620665495554/551908144641605642/1167108161531027526))

## 1.3.0

Expand Down
6 changes: 3 additions & 3 deletions bin/jana.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ late final TextChannel internal;
final newsId = Snowflake(551908144641605642);
late final TextChannel news;
final yt = YoutubeExplode();
final startupTime = DateTime.now().subtract(Duration(days: 1));

Stream<Video> getVideos() => yt.channels.getUploads('UCZs3FO5nPvK9VveqJLIvv_w');
Map videoToJson(Video v) => {
Expand Down Expand Up @@ -80,7 +81,7 @@ void main(List<String> argv) async {
bot.onMessageCreate.listen((event) async {
final msg = event.message;
final channel = await msg.channel.get() as TextChannel;
if (msg.author is Webhook || (msg.author as User).isBot) return;
if (msg.author is WebhookAuthor || (msg.author as User).isBot) return;
log.info(
'Msg from ${msg.author.username}: ${msg.content} (${await msg.url})');
if (msg.content == '!ping') {
Expand Down Expand Up @@ -126,8 +127,7 @@ void checkYoutube(NyxxGateway bot, List<String> sent) async {
ids.add(vid.id.value);

if ((vid.publishDate ?? vid.uploadDate ?? DateTime.now())
// TODO: proper replacement for this
.isBefore(DateTime(2023, 12, 13))) {
.isBefore(startupTime)) {
log.warning('[yt] is an old video');
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: jana
description: A Discord bot
version: 1.5.2
version: 1.5.3
homepage: https://github.com/chrissxMedia/jana

environment:
Expand Down

0 comments on commit c057a20

Please sign in to comment.