rad
rad
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by rad on 8/4/2024 in #djs-questions
Issues editing automod
for (const module of serverRecord.modules) {
try {
const rule = await autoModManager.fetch(module.id);
const newActions = [
{
type: AutoModerationActionType.Timeout,
metadata: { durationSeconds: duration },
},
];
for (const module of serverRecord.modules) {
try {
const rule = await autoModManager.fetch(module.id);
const newActions = [
{
type: AutoModerationActionType.Timeout,
metadata: { durationSeconds: duration },
},
];
If I leave it like this, without the splitting, it'll just turn off block messages and alert, and only turn on timeout duration yk
4 replies
DIAdiscord.js - Imagine an app
Created by rad on 8/4/2024 in #djs-questions
Issues editing automod
And i'm not really sure why, here is my code that deals with editing it, the code that goes below this is for managing the database
const autoModManager = interaction.guild?.autoModerationRules;
if (!autoModManager) return;

for (const module of serverRecord.modules) {
try {
const rule = await autoModManager.fetch(module.id);
console.log('Current Rule actions:', rule.actions);

let actionUpdated = false;
const newActions = rule.actions.map((action) => {
if (action.type === AutoModerationActionType.Timeout) {
actionUpdated = true;
return {
type: AutoModerationActionType.Timeout,
metadata: { durationSeconds: duration },
};
}
return action;
});

if (!actionUpdated) {
newActions.push({
type: AutoModerationActionType.Timeout,
metadata: { durationSeconds: duration },
});
}

const editOptions: AutoModerationRuleEditOptions = { actions: newActions };

console.log('Sending the following edit options to Discord:', JSON.stringify(editOptions, null, 2));

await rule.edit(editOptions);
const autoModManager = interaction.guild?.autoModerationRules;
if (!autoModManager) return;

for (const module of serverRecord.modules) {
try {
const rule = await autoModManager.fetch(module.id);
console.log('Current Rule actions:', rule.actions);

let actionUpdated = false;
const newActions = rule.actions.map((action) => {
if (action.type === AutoModerationActionType.Timeout) {
actionUpdated = true;
return {
type: AutoModerationActionType.Timeout,
metadata: { durationSeconds: duration },
};
}
return action;
});

if (!actionUpdated) {
newActions.push({
type: AutoModerationActionType.Timeout,
metadata: { durationSeconds: duration },
});
}

const editOptions: AutoModerationRuleEditOptions = { actions: newActions };

console.log('Sending the following edit options to Discord:', JSON.stringify(editOptions, null, 2));

await rule.edit(editOptions);
4 replies
HHomarr
Created by rad on 3/15/2024 in #💬・get-help
On update, it makes me re-make a user account
LOL my original db was v2
9 replies
HHomarr
Created by rad on 3/15/2024 in #💬・get-help
On update, it makes me re-make a user account
thank you
9 replies
HHomarr
Created by rad on 3/15/2024 in #💬・get-help
On update, it makes me re-make a user account
ah shit
9 replies
DIAdiscord.js - Imagine an app
Created by rad on 11/13/2023 in #djs-questions
ActivityType not setting correctly
thank you for your help
14 replies
DIAdiscord.js - Imagine an app
Created by rad on 11/13/2023 in #djs-questions
ActivityType not setting correctly
i probably did something wrong somewhere else or discord is jut choosing to not abide by their own docs maybe the bot just isn't losing it's status from what it was originally ill see tomorrow
14 replies
DIAdiscord.js - Imagine an app
Created by rad on 11/13/2023 in #djs-questions
ActivityType not setting correctly
competing works
14 replies
DIAdiscord.js - Imagine an app
Created by rad on 11/13/2023 in #djs-questions
ActivityType not setting correctly
unless you can jsut do that with integers
14 replies
DIAdiscord.js - Imagine an app
Created by rad on 11/13/2023 in #djs-questions
ActivityType not setting correctly
14 replies
DIAdiscord.js - Imagine an app
Created by rad on 11/13/2023 in #djs-questions
ActivityType not setting correctly
i also tried doing this
let activityType = ActivityType.Custom;
if (statusType) {
switch (statusType.toLowerCase()) {
case 'playing':
activityType = ActivityType.Playing;
break;
case 'watching':
activityType = ActivityType.Watching;
break;
case 'listening':
activityType = ActivityType.Listening;
break;
case 'streaming':
activityType = ActivityType.Streaming;
break;
case 'competing':
activityType = ActivityType.Competing;
break;
default:
activityType = ActivityType.Custom;
break;
}
}
let activityType = ActivityType.Custom;
if (statusType) {
switch (statusType.toLowerCase()) {
case 'playing':
activityType = ActivityType.Playing;
break;
case 'watching':
activityType = ActivityType.Watching;
break;
case 'listening':
activityType = ActivityType.Listening;
break;
case 'streaming':
activityType = ActivityType.Streaming;
break;
case 'competing':
activityType = ActivityType.Competing;
break;
default:
activityType = ActivityType.Custom;
break;
}
}
14 replies
HHomarr
Created by rad on 10/26/2023 in #💬・get-help
All external stuff giving Ping timed out
Huh, the issue was that I had
{
"iptables" : false
}
{
"iptables" : false
}
in /etc/docker/daemon.json This seemed to break it somehow
6 replies
HHomarr
Created by rad on 10/26/2023 in #💬・get-help
All external stuff giving Ping timed out
It's all on the same networks as it used to be, same machine as everything else, and it's only isolated to homarr
6 replies
DIAdiscord.js - Imagine an app
Created by !𝓩𝓮𝓴𝓱𝓪𝓹 on 10/12/2023 in #djs-questions
Vertical & Horizontal Scale question
Each shard will be connected to one central redis and mongo
8 replies
DIAdiscord.js - Imagine an app
Created by !𝓩𝓮𝓴𝓱𝓪𝓹 on 10/12/2023 in #djs-questions
Vertical & Horizontal Scale question
Yes that's what it would do
8 replies
DIAdiscord.js - Imagine an app
Created by !𝓩𝓮𝓴𝓱𝓪𝓹 on 10/12/2023 in #djs-questions
Vertical & Horizontal Scale question
Or docker swarm
8 replies
DIAdiscord.js - Imagine an app
Created by !𝓩𝓮𝓴𝓱𝓪𝓹 on 10/12/2023 in #djs-questions
Vertical & Horizontal Scale question
Kubernetes may be for you
8 replies
DIAdiscord.js - Imagine an app
Created by Wiktor. on 9/29/2023 in #djs-questions
Command Handler Not Working??
intents? does the bot have the right perms?
21 replies
HHomarr
Created by rad on 9/2/2023 in #💬・get-help
Integrations in Widgets rather than apps
Homarr is running in docker on 192.168.1.156 and pihole is on 192.168.1.11
7 replies