Zarchical
Zarchical
Explore posts from servers
CC#
Created by Zarchical on 5/12/2024 in #help
2D Position to Relative ImageBox Position
Basically, to help you visualise, I'm making a management system for my racing game and I have my track map on my Windows Form. In my game, my track positions for my corners are: Bottom Left: 145, -160 Bottom Right: -155, -160 Top Left: 145, 150 Top Right: -155, 150 and my Windows Form ImageBox’s details: Location: 1622, 9 (my form is 1920x1080) Margin: 3, 3, 3, 3 Size: 286x297 Anchor: Top Left With these details, is there a way I could do this easily (for example, with a func/formula which i could turn into a func?)
1 replies
DIAdiscord.js - Imagine an app
Created by Zarchical on 7/31/2023 in #djs-questions
How do I send a message in a seperate channel from a slash command?
I've been trying to do this but can't seem to figure out how to get the client into the slash command. Any help would be greatly appreciated. Below is a snippet of my imports and some code which is trying to send the message, however failing because client is undefined. Imports:
const { EmbedBuilder, SlashCommandBuilder, ButtonStyle, ButtonBuilder } = require('discord.js');
const path = require('path');
const config = require(path.join(__dirname, '..', '..', 'configuration.json'));
const { EmbedBuilder, SlashCommandBuilder, ButtonStyle, ButtonBuilder } = require('discord.js');
const path = require('path');
const config = require(path.join(__dirname, '..', '..', 'configuration.json'));
Code:
const channelID = '1135231042287042561';
const channel = client.channels.cache.get(channelID);

if (channel && channel.isText()) {
const exampleEmbed = new EmbedBuilder()
.setColor('5865F2')
.setTitle("New Script")
.setDescription(`A new script has been posted by <@${interaction.user.id}>!`)
.addFields(
{"name": "Script URL", "value": "[Open the script here](https://raw.githubusercontent.com/" + DataURL + ")", "inline": true,},
{"name": "Script Name", "value": data.name, "inline": true,},
{"name": "Script ID", "value": random})
const confirm = new ButtonBuilder()
.setCustomId('delete')
.setLabel('Delete Script')
.setStyle(ButtonStyle.Danger);

const row = new MessageActionRow()
.addComponents(confirm)

channel.send({ embeds: [exampleEmbed], components: [row] })
.then(() => console.log('Message sent with the "delete" button!'))
.catch(console.error);
}
const channelID = '1135231042287042561';
const channel = client.channels.cache.get(channelID);

if (channel && channel.isText()) {
const exampleEmbed = new EmbedBuilder()
.setColor('5865F2')
.setTitle("New Script")
.setDescription(`A new script has been posted by <@${interaction.user.id}>!`)
.addFields(
{"name": "Script URL", "value": "[Open the script here](https://raw.githubusercontent.com/" + DataURL + ")", "inline": true,},
{"name": "Script Name", "value": data.name, "inline": true,},
{"name": "Script ID", "value": random})
const confirm = new ButtonBuilder()
.setCustomId('delete')
.setLabel('Delete Script')
.setStyle(ButtonStyle.Danger);

const row = new MessageActionRow()
.addComponents(confirm)

channel.send({ embeds: [exampleEmbed], components: [row] })
.then(() => console.log('Message sent with the "delete" button!'))
.catch(console.error);
}
3 replies
CC#
Created by Zarchical on 5/14/2023 in #help
❔ How do I get item values from an array?
Basically, this is the array i have stored in a var: [{"Example":{"updated":false,},] (i shortened it to make it more readable) I want to get Example.updated and return it, how would i do that?
108 replies