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

BETA VERSION 0.67.0 #1775

Merged
merged 39 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
300d54a
chore(deps): bump nconf from 0.12.0 to 0.12.1
dependabot[bot] Oct 23, 2023
a4129fa
chore(deps): bump nconf from 0.12.0 to 0.12.1 (#1754)
Mittelblut9 Oct 23, 2023
97bcf83
chore(deps): bump undici from 5.26.4 to 5.26.5
dependabot[bot] Oct 24, 2023
b9d2b1f
chore(deps): bump @sentry/node from 7.74.1 to 7.75.0
dependabot[bot] Oct 25, 2023
7cd46a2
chore(deps): bump @sentry/node from 7.74.1 to 7.75.0 (#1757)
Mittelblut9 Oct 25, 2023
efa80b9
chore(deps): bump undici from 5.26.4 to 5.26.5 (#1756)
Mittelblut9 Oct 25, 2023
acedb1b
chore(deps): bump discord-player from 6.6.4 to 6.6.5
dependabot[bot] Oct 26, 2023
00c922d
chore(deps): bump @sentry/node from 7.75.0 to 7.75.1
dependabot[bot] Oct 26, 2023
13d2493
chore(deps): bump @sentry/node from 7.75.0 to 7.75.1 (#1760)
Mittelblut9 Oct 26, 2023
0ec3b88
chore(deps): bump discord-player from 6.6.4 to 6.6.5 (#1758)
Mittelblut9 Oct 26, 2023
6fe4677
chore(deps): bump discord-player from 6.6.5 to 6.6.6
dependabot[bot] Oct 27, 2023
8a5eff7
chore(deps): bump axios from 1.5.1 to 1.6.0
dependabot[bot] Oct 27, 2023
f28458b
chore(deps): bump undici from 5.26.5 to 5.27.0
dependabot[bot] Oct 27, 2023
6ed3c45
chore(deps): bump undici from 5.26.5 to 5.27.0 (#1763)
Mittelblut9 Oct 27, 2023
866e8fb
chore(deps): bump axios from 1.5.1 to 1.6.0 (#1762)
Mittelblut9 Oct 27, 2023
9c75474
chore(deps): bump discord-player from 6.6.5 to 6.6.6 (#1761)
Mittelblut9 Oct 27, 2023
98fdc49
chore(deps): bump @sentry/node from 7.75.1 to 7.76.0
dependabot[bot] Oct 30, 2023
ed462b5
chore(deps): bump @sentry/node from 7.75.1 to 7.76.0 (#1764)
Mittelblut9 Oct 30, 2023
d81962b
chore(deps): bump @sentry/profiling-node from 1.2.1 to 1.2.3
dependabot[bot] Oct 31, 2023
5790079
chore(deps): bump @sentry/profiling-node from 1.2.1 to 1.2.3 (#1765)
Mittelblut9 Nov 1, 2023
a248245
chore(deps): bump @sentry/node from 7.76.0 to 7.77.0
dependabot[bot] Nov 1, 2023
c925eaf
chore(deps): bump @sentry/node from 7.76.0 to 7.77.0 (#1767)
Mittelblut9 Nov 1, 2023
fecbc9f
chore(deps): bump @sentry/profiling-node from 1.2.3 to 1.2.5
dependabot[bot] Nov 1, 2023
ea86629
chore(deps): bump @sentry/profiling-node from 1.2.3 to 1.2.5 (#1766)
Mittelblut9 Nov 1, 2023
f6ad626
chore(deps): bump @sentry/profiling-node from 1.2.5 to 1.2.6
dependabot[bot] Nov 2, 2023
b588f21
chore(deps): bump @sentry/profiling-node from 1.2.5 to 1.2.6 (#1768)
Mittelblut9 Nov 2, 2023
5be0042
chore(deps): bump mysql2 from 3.6.2 to 3.6.3
dependabot[bot] Nov 3, 2023
2a76ebc
chore(deps): bump mysql2 from 3.6.2 to 3.6.3 (#1770)
Mittelblut9 Nov 3, 2023
7d0103a
chore(deps): bump @twurple/api from 7.0.4 to 7.0.5
dependabot[bot] Nov 6, 2023
c2e90b4
chore(deps): bump undici from 5.27.0 to 5.27.2
dependabot[bot] Nov 6, 2023
4a6eced
chore(deps): bump sequelize from 6.33.0 to 6.34.0
dependabot[bot] Nov 6, 2023
f427fa3
chore(deps): bump @twurple/api from 7.0.4 to 7.0.5 (#1771)
Mittelblut9 Nov 8, 2023
6992776
chore(deps): bump undici from 5.27.0 to 5.27.2 (#1772)
Mittelblut9 Nov 8, 2023
55de419
chore(deps): bump sequelize from 6.33.0 to 6.34.0 (#1773)
Mittelblut9 Nov 8, 2023
2ab6914
fix: remove permissions when the bot has no permissions in the channel
Mittelblut9 Nov 8, 2023
53f7d58
fix: add missing reject function
Mittelblut9 Nov 8, 2023
d4664e3
fix: remove permissions when the bot has no permissions in the channe…
Mittelblut9 Nov 8, 2023
a3ca265
chore: remove sentry anr detection
Mittelblut9 Nov 8, 2023
983fe7c
chore: 0.67.0
Mittelblut9 Nov 8, 2023
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
4 changes: 0 additions & 4 deletions bot/core/sentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,4 @@ module.exports.sentryInit = async () => {
profilesSampleRate: 0.8,
integrations: [new ProfilingIntegration()],
});

if (process.env.NODE_ENV === 'production') {
await Sentry.enableAnrDetection({ captureStackTrace: true });
}
};
623 changes: 269 additions & 354 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mittelbot",
"version": "0.66.5",
"version": "0.67.0",
"description": "A Discord Bot written in Node.js",
"main": "bot/core/shard.js",
"private": true,
Expand Down Expand Up @@ -57,17 +57,17 @@
"@distube/ytdl-core": "^4.13.2",
"@ffmpeg-installer/ffmpeg": "^1.1.0",
"@napi-rs/canvas": "^0.1.44",
"@sentry/node": "^7.74.1",
"@sentry/profiling-node": "^1.2.1",
"@sentry/node": "^7.77.0",
"@sentry/profiling-node": "^1.2.6",
"@stdlib/assert-is-uri": "^0.1.1",
"@twurple/api": "^7.0.4",
"@twurple/api": "^7.0.5",
"@twurple/auth": "^7.0.0",
"axios": "^1.5.1",
"axios": "^1.6.0",
"caller-id": "^0.1.0",
"canvacord": "5.4.10",
"discord-html-transcripts": "^3.2.0",
"discord-logs": "^2.2.1",
"discord-player": "^6.6.4",
"discord-player": "^6.6.6",
"discord.js": "^14.13.0",
"dotenv": "^16.3.1",
"extends-classes": "^1.0.5",
Expand All @@ -79,17 +79,17 @@
"link-module-alias": "^1.2.0",
"module-alias": "^2.2.3",
"moment-timezone": "^0.5.43",
"mysql2": "^3.6.2",
"nconf": "^0.12.0",
"mysql2": "^3.6.3",
"nconf": "^0.12.1",
"patch-package": "^8.0.0",
"random-animals-api": "^1.2.6",
"rss-parser": "^3.13.0",
"sequelize": "^6.33.0",
"sequelize": "^6.34.0",
"simple-node-logger": "^21.8.12",
"string-mismatch": "^2.1.1",
"translatte": "^3.0.1",
"underscore": "^1.13.6",
"undici": "^5.26.4",
"undici": "^5.27.2",
"validator": "^13.11.0",
"ytdl-core": "npm:@distube/ytdl-core@^4.11.10"
},
Expand Down
27 changes: 26 additions & 1 deletion utils/classes/Notifications/Notifications.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
const { Message } = require('discord.js');
const { EmbedBuilder } = require('discord.js');
const YouTubeSettings = require('./YouTube/YouTubeSettings');
const TwitchNotifier = require('./Twitch/TwitchLogic');

module.exports = class Notification {
constructor() {}

async sendNotification({ channel, content = null, embed = null, components = null }) {
async sendNotification({
channel,
content = null,
embed = null,
components = null,
channel_id = null,
type = '',
}) {
return new Promise(async (resolve, reject) => {
if (!channel) reject('No channel provided.');
if (!content && !embed) reject('No content or embed provided.');
Expand All @@ -18,6 +27,22 @@ module.exports = class Notification {
const msg = await channel.send(options);
return resolve(msg);
} catch (err) {
if (channel_id && err.status === 403) {
if (type === 'yt') {
new YouTubeSettings(channel.guild.id).remove({
guild_id: channel.guild.id,
channel_id: channel_id,
});
return reject(
'I do not have permission to send messages in that channel. I have removed the channel from the YouTube settings.'
);
} else if (type === 'twitch') {
new TwitchNotifier().delete(channel.guild.id, channel_id);
return reject(
'I do not have permission to send messages in that channel. I have removed the channel from the Twitch settings.'
);
}
}
return reject(err);
}
});
Expand Down
2 changes: 1 addition & 1 deletion utils/classes/Notifications/Twitch/TwitchLogic.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ module.exports = class TwitchNotifier {
.then(() => {
resolve(global.t.trans(['success.notifications.twitch.removed'], guild_id));
})
.catch((err) => {
.catch(() => {
reject(global.t.trans(['error.notifications.twitch.removeChannel'], guild_id));
});
});
Expand Down
5 changes: 4 additions & 1 deletion utils/classes/Notifications/Twitch/TwitchNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ module.exports = class TwitchNotification extends TwitchNotifier {
message = await this.sendTwitchNotification(messageContent, embed, {
dc_channel: dcChannel,
link: `https://twitch.tv/${stream.userDisplayName}`,
twitch_id: data.twitch_id,
});
}
if (!(message instanceof Message)) {
Expand Down Expand Up @@ -248,7 +249,7 @@ module.exports = class TwitchNotification extends TwitchNotifier {
});
}

sendTwitchNotification(content, embed, { dc_channel, link }) {
sendTwitchNotification(content, embed, { dc_channel, link, twitch_id }) {
return new Promise(async (resolve, reject) => {
this.notificationApi
.sendNotification({
Expand All @@ -264,6 +265,8 @@ module.exports = class TwitchNotification extends TwitchNotifier {
.setEmoji('🔴')
),
],
channel_id: twitch_id,
type: 'twitch',
})
.then((message) => {
console.info(`🔎 Twitch stream handler checked streamer: ${link}...`);
Expand Down
2 changes: 2 additions & 0 deletions utils/classes/Notifications/YouTube/YouTubeNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ module.exports = class YouTubeNotification extends YouTubeLogic {
channel,
content: embedContent,
embed: embed,
channel_id: upload.channel_id,
type: 'yt',
});

if (!message || !message.id) continue;
Expand Down