Edr0b0t
DIAdiscord.js - Imagine an app
•Created by Edr0b0t on 1/28/2024 in #djs-questions
problem with BASE_TYPE_REQUIRED
Hello, here's my code :
and when i launched the bot the console reply with this error:
9 replies
DIAdiscord.js - Imagine an app
•Created by Edr0b0t on 1/23/2024 in #djs-questions
problem with ChannelType.GuildText
when i type this command the console respond me:
TypeError: ChannelType.GuildText is not a function
9 replies
DIAdiscord.js - Imagine an app
•Created by Edr0b0t on 1/23/2024 in #djs-questions
problem with timestamp
when I type the command unmute the console reply DiscordAPIError[50035]: Invalid Form Body
communication_disabled_until[INVALID_COMMUNICATION_DISABLED_TIMESTAMP]: Invalid communication disabled timestamp
unmute.js
3 replies
DIAdiscord.js - Imagine an app
•Created by Edr0b0t on 1/20/2024 in #djs-questions
Problem with Reddit API
When I run the /meme command, the console replies
Unexpected token '<', "<!doctype "... is not a valid JSON
(PS: I use a hosting company)
Here's my meme.js
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'meme',
description: 'Donne un meme!',
callback: async (client, interaction) => {
async function meme() { try { const response = await fetch('https://www.reddit.com/r/memes/random/.json'); const memeData = await response.json(); const title = memeData[0].data.children[0].data.title; const image = memeData[0].data.children[0].data.url; const author = memeData[0].data.children[0].data.author; const embed = new EmbedBuilder() .setColor("Random") .setTitle(title) .setImage(image) .setURL(image) .setFooter(author); await interaction.reply({ embeds: [embed] }); } catch (error) { console.error('Erreur lors de la récupération du meme:', error.message); await interaction.reply("Une erreur s'est produite lors de la récupération du meme."); } } meme(); }, };
async function meme() { try { const response = await fetch('https://www.reddit.com/r/memes/random/.json'); const memeData = await response.json(); const title = memeData[0].data.children[0].data.title; const image = memeData[0].data.children[0].data.url; const author = memeData[0].data.children[0].data.author; const embed = new EmbedBuilder() .setColor("Random") .setTitle(title) .setImage(image) .setURL(image) .setFooter(author); await interaction.reply({ embeds: [embed] }); } catch (error) { console.error('Erreur lors de la récupération du meme:', error.message); await interaction.reply("Une erreur s'est produite lors de la récupération du meme."); } } meme(); }, };
7 replies