Skip to content

Commit 48fab42

Browse files
committed
Update set_channel_restriction.js
1 parent 72c8e1b commit 48fab42

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

bot/actions/set_channel_restriction.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = {
2525

2626
meta: {
2727
version: "4.0.0",
28-
modVersion: "1.0.0",
28+
modVersion: "1.0.1",
2929
preciseCheck: true,
3030
author: "Shadow",
3131
help: "https://dc.dbm-poland.site",
@@ -44,7 +44,7 @@ module.exports = {
4444
//region # Action HTML
4545
//≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
4646

47-
html(isEvent, data) {
47+
html() {
4848
const mod = `<dbm-mod><info style="opacity: 0.2; transition: opacity 0.3s; font-weight: 900; font-size: 16px; padding: 5px; border-radius: 5px; background: rgba(0, 0, 0, 0.49); border:1px solid rgba(132, 132, 132, 1); position: fixed; bottom: 0; left: 0; z-index: 999999;" onmouseover="this.style.opacity='1'" onmouseout="this.style.opacity='0.2'">Author: <a href="#" style="color:#07f;text-decoration:none;" onclick="require('electron').shell.openExternal('${this.meta.authorUrl}')">${this.meta.author}</a><br>Help: <a href="#" style="color:#07f;text-decoration:none;" onclick="require('electron').shell.openExternal('${this.meta.help}')">click here</a></info><version style="opacity: 0.2; transition: opacity 0.3s; font-weight: 900; font-size: 16px; padding: 5px; border-radius: 5px; background: rgba(0, 0, 0, 0.49); border:1px solid rgba(132, 132, 132, 1); position: fixed; bottom: 0; right: 0; z-index: 999999;" onmouseover="this.style.opacity='1'" onmouseout="this.style.opacity='0.2'"><a href="#" style="color:#07f;text-decoration:none;" onclick="require('electron').shell.openExternal('${this.meta.downloadUrl}')">${this.meta.modVersion}</a></version></dbm-mod>`;
4949
return (
5050
mod +
@@ -78,7 +78,15 @@ module.exports = {
7878
cache,
7979
);
8080
let result;
81-
if (interaction.channel.id === channel.id) {
81+
let sourceChannelId;
82+
if (interaction.channel) {
83+
sourceChannelId = interaction.channel.id;
84+
} else if (cache.msg) {
85+
sourceChannelId = cache.msg.channelId;
86+
} else {
87+
this.displayError(data, cache, "Source channel not found!");
88+
}
89+
if (sourceChannelId === channel.id) {
8290
result = true;
8391
} else {
8492
result = false;

0 commit comments

Comments
 (0)