TRKako
TRKako
DIAdiscord.js - Imagine an app
Created by TRKako on 3/17/2024 in #djs-questions
What Im doing wrong?
im trying to make a request trough API but instead I got 403 error everytime I try
const { get, post } = require('axios');
let { data } = await get(`https://discord.com/api/users/${message.author.id}/profile?guild_id=${message.guild.id}`,
{
headers:
{
"Authorization": "Bot " + TOKEN,
"Content-Type": "application/json"
}
});
message.reply(data);
const { get, post } = require('axios');
let { data } = await get(`https://discord.com/api/users/${message.author.id}/profile?guild_id=${message.guild.id}`,
{
headers:
{
"Authorization": "Bot " + TOKEN,
"Content-Type": "application/json"
}
});
message.reply(data);
5 replies
DIAdiscord.js - Imagine an app
Created by TRKako on 9/20/2023 in #djs-questions
'message.content.toUpperCase().includes()' it's wrong? or Im missing something
help <:9_:1087454815384248393>
client.on("messageCreate", async (message) => {

switch (message.content.toUpperCase().includes()) {

case `CRAZY`:

message.reply("Crazy? I Was Crazy Once. They Locked Me In A Room. A Rubber Room. A Rubber Room With Rats. And Rats Make Me Crazy.")

break;
}
})
client.on("messageCreate", async (message) => {

switch (message.content.toUpperCase().includes()) {

case `CRAZY`:

message.reply("Crazy? I Was Crazy Once. They Locked Me In A Room. A Rubber Room. A Rubber Room With Rats. And Rats Make Me Crazy.")

break;
}
})
7 replies
DIAdiscord.js - Imagine an app
Created by TRKako on 8/28/2023 in #djs-questions
help with console time
6 replies
DIAdiscord.js - Imagine an app
Created by TRKako on 5/28/2023 in #djs-questions
Is there a way to check if server banner is just an static picture or animated?
8 replies
DIAdiscord.js - Imagine an app
Created by TRKako on 3/29/2023 in #djs-questions
Suddenly I got this error on every Interaction
16 replies
DIAdiscord.js - Imagine an app
Created by TRKako on 3/24/2023 in #djs-questions
Is there a way to get a Discord video (attachment) thumbnail?
hii, is there a way to get a Discord video (attachment) thumbnail, I found something that maybe can work but it didn't work so I'm here, here's my current code:
client.on('messageCreate', async message => {
const prefix = "tr.";
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(message.content.toLowerCase().startsWith(prefix))
{
if(command === "test"){

const videoUrl = 'https://cdn.discordapp.com/attachments/882020253129928744/1088897611584520262/images_1.mp4';

VideoResolver.resolve(videoUrl).then(videoInfo => {
const embed = new MessageEmbed()
.setTitle('video')
.setImage(videoInfo.thumbnail.url)
.setURL(videoUrl);
message.channel.send({ embeds: [embed] });
}).catch(error => {
console.error(error);
});
}
}
})
client.on('messageCreate', async message => {
const prefix = "tr.";
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(message.content.toLowerCase().startsWith(prefix))
{
if(command === "test"){

const videoUrl = 'https://cdn.discordapp.com/attachments/882020253129928744/1088897611584520262/images_1.mp4';

VideoResolver.resolve(videoUrl).then(videoInfo => {
const embed = new MessageEmbed()
.setTitle('video')
.setImage(videoInfo.thumbnail.url)
.setURL(videoUrl);
message.channel.send({ embeds: [embed] });
}).catch(error => {
console.error(error);
});
}
}
})
sorry if my question doesn't seem to make sense
16 replies
DIAdiscord.js - Imagine an app
Created by TRKako on 2/20/2023 in #djs-questions
can't get avatar per server with user.ID
29 replies
DIAdiscord.js - Imagine an app
Created by TRKako on 12/30/2022 in #djs-questions
problem displaying avatar per server
Hi guys, Im trying to make an Avatar command that Displays both avatar per server, this means 1- default avatar 2-Server Avatar (nitro) I already made it works, but doesn't seems to work with mentions or ID's mentions, what im doing wrong? here an example:
10 replies
DIAdiscord.js - Imagine an app
Created by TRKako on 9/28/2022 in #djs-questions
How to catch 'DiscordAPIError Unknown Message'
I recently realized that if you insta-delete a message command that bot reply with message.reply("something") bot will crash with error DiscordAPIError: Unknown Message and I dont know how to catch it, I tried with try and .catch(null); but doesnt work, someone can help me pls dogeHaHa
4 replies
DIAdiscord.js - Imagine an app
Created by TRKako on 9/23/2022 in #djs-questions
help with discord cdn link
Im working on a emoji command that displays that emoji as an image, I want to make a button that automatically starts to download that image when user press, I know that with https://images-ext-1.discordapp.net/external/(character_set_unknown_to_me)/%3Fsize%3D4096/https/cdn.discordapp.com/avatars/${user.id}/${avatar.name}.png I can do that but i don't know what i'm supposed to type in some parts, can someone help me?
9 replies
DIAdiscord.js - Imagine an app
Created by TRKako on 9/9/2022 in #djs-questions
Emoji collection doesn't work
hi, I was trying to make a emoji collector but when I react to message both responses come instead of one, here's the code:
4 replies
DIAdiscord.js - Imagine an app
Created by TRKako on 7/27/2022 in #djs-questions
how can I check if member has avatar by server or normal avatar?
I have an avatar command that works fine except with people with avatar by server, what can I do? trroxyynoladefnafsecuritybreach here's the code
if (command === "avatar"){

let member = message.mentions.users.first() || await message.guild.members.fetch(args[0]).catch(() => null) || message.author;
let avatar = member.displayAvatarURL({ size: 4096, dynamic: true });

const embed = new Discord.MessageEmbed()
.setTitle('Avatar 👍')
.setColor(`0x2F3136`)
.setDescription(`Avatar de <@${member.id}>`)
.setImage(avatar)
message.reply({embeds: [embed]})
}
if (command === "avatar"){

let member = message.mentions.users.first() || await message.guild.members.fetch(args[0]).catch(() => null) || message.author;
let avatar = member.displayAvatarURL({ size: 4096, dynamic: true });

const embed = new Discord.MessageEmbed()
.setTitle('Avatar 👍')
.setColor(`0x2F3136`)
.setDescription(`Avatar de <@${member.id}>`)
.setImage(avatar)
message.reply({embeds: [embed]})
}
10 replies
DIAdiscord.js - Imagine an app
Created by TRKako on 7/26/2022 in #djs-questions
how can I catch this?
Im working in a avatar command that works with ID and mentions, but when a type something like "!avatar hello" didn't catch nothing and dies :(
12 replies
DIAdiscord.js - Imagine an app
Created by TRKako on 7/1/2022 in #djs-questions
modal don't show
8 replies
DIAdiscord.js - Imagine an app
Created by TRKako on 6/20/2022 in #djs-questions
My bot can't show 2 modals
I was trying to make a bugcommand and bot suggestion command with a button that shows a modal and then send the content to a specific channel in my bot support server, but only works if one of those 2 commands are disabled; when I test those 2 commands without turning off one of these, they mix and bot dies. what can I do :(
24 replies