profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/SpaceEEC/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

SpaceEEC/crux 6

Repository creating the umbrella documentation for all crux libraries

SpaceEEC/crux_gateway 6

A flexible elixir gateway for the Discord API

SpaceEEC/crux_rest 6

A Discord API rest library

SpaceEEC/crux_structs 6

A library providing Discord API structures

SpaceEEC/crux_base 4

An example / base implemention of crux' components

SpaceEEC/crux_cache 3

A library providing a cache for Discord API structures

SpaceEEC/crispy-system 2

Discord bot doing things written in elixir using crux

SpaceEEC/DiscordRichPresence 2

A C# Discord rich presence client

SpaceEEC/ex_link 2

A Lavalink client for elixir

PullRequestReviewEvent
PullRequestReviewEvent

issue commentdiscordjs/discord.js

Bug: Bot doesn't message

You seem to be missing the GUILD_MESSAGES and/or DIRECT_MESSAGES intent.

Simonek-loki

comment created time in 9 hours

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

issue closeddiscordjs/discord.js

Bug: TypeError: fn is not a function

Issue description

this code is executed on messageCreate. I was unable to figure out when exactly the program terminates but this is the error stack:

C:\code\js\kciw-remake\node_modules\@discordjs\collection\dist\index.js:191
            return fn(value, key, this);
                   ^

TypeError: fn is not a function
    at C:\code\js\kciw-remake\node_modules\@discordjs\collection\dist\index.js:191:20
    at Function.from (<anonymous>)
    at Map.map (C:\code\js\kciw-remake\node_modules\@discordjs\collection\dist\index.js:189:22)
    at Object.execute (C:\code\js\kciw-remake\events\messageCreate.js:18:40)
    at Client.<anonymous> (C:\code\js\kciw-remake\index.js:42:45)
    at Client.emit (node:events:394:28)
    at MessageCreateAction.handle (C:\code\js\kciw-remake\node_modules\discord.js\src\client\actions\MessageCreate.js:23:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\code\js\kciw-remake\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\code\js\kciw-remake\node_modules\discord.js\src\client\websocket\WebSocketManager.js:350:31)
    at WebSocketShard.onPacket (C:\code\js\kciw-remake\node_modules\discord.js\src\client\websocket\WebSocketShard.js:443:22)

the code at at Object.execute (C:\code\js\kciw-remake\events\messageCreate.js:18:40) is this: const afks = message.mentions.users.map();

the code at at Client.<anonymous> (C:\code\js\kciw-remake\index.js:42:45) is this: client.on(event.name, (...args) => event.execute(...args, client)); <-- this is executing normally so the problem isn't there

Codesample

const Discord = require('discord.js');
const db = require('quick.db');

module.exports = {
name: 'messageCreate',
async execute(message, client) {
if(message.mentions.users.map(i => i.id).length > 0) {
			const afks = message.mentions.users.map();
			const embedList = [];
			const afkList = [];

			afks.forEach(i => {
				afkList.push(db.get(`afk.${i.id}`));
			});

			afks.forEach(afkFun);

			function afkFun(value, index) {
				if(Object.keys(db.get('afk').includes(value.id))) {
					embedList.push(
						new Discord.MessageEmbed().setTitle(`${value.username} is AFK!`)
							.setDescription(
								`Reason: ${afkList[index].reason}\n<t:${Math.round(afkList[index].time / 1000)}:R>`,
							)
							.setColor(color.red),
					);
				}
				db.has(`afk.${value.id}.pings`)
					? db.push(`afk.${value.id}.pings`, {
						time: Date.now(),
						user: message.author.id,
						link: message.url,
						channel: message.channel.id,
					})
					: db.set(`afk.${value.id}.pings`, {
						time: Date.now(),
						user: message.author.id,
						link: message.url,
						channel: message.channel.id,
					});

				message.channel.send({ embeds: embedList });
			}}
			const pingEmbed = new Discord.MessageEmbed().setDescription(
				db.has(`afk.${message.author.id}.pings`)
					? db
						.get(`afk.${message.author.id}.pings`)
						.map(
							i =>
								`[<t:${Math.round(i.time / 1000)}:R>](${i.link}) <@${
									i.user
								}> - <#${i.channel}>`,
						)
						.join('\n')
					: 'You have no pings!',
			);
			message.channel.send({
				embeds: [mainEmbed, pingEmbed],
			});
			db.delete(`afk.${message.author.id}`);
		}
},
};

discord.js version

13.1.0

Node.js version

16.9.1

Operating system

Windows

Priority this issue should have

Medium (should be fixed soon)

Which partials do you have configured?

No Partials

Which gateway intents are you subscribing to?

GUILDS, GUILD_MEMBERS, GUILD_WEBHOOKS, GUILD_PRESENCES, GUILD_MESSAGES, DIRECT_MESSAGES

I have tested this issue on a development release

discord.js@13.2.0-dev.1632312194.92f6471

closed time in 2 days

xMaxximum

issue closeddiscordjs/discord.js

Bug: Ephemeral embeds do not load image attachments properly

Issue description

For ephemeral interaction replies, images loaded through MessageAttachments do not display properly. The images are displayed properly if ephemeral is set to false.

Steps to reproduce:

  1. Create a bot application and add it to a server with bot, application.commands, view channels, and send messages permissions
  2. Copy the code sample below into a new js file
  3. Open a terminal window in the project folder and run node index.js
  4. Type test in the Discord server. An ephemeral embed should come up but the image doesn't load

Codesample

const { Client, Intents, MessageAttachment, MessageEmbed } = require('discord.js');
const { SlashCommandBuilder } = require('@discordjs/builders');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');

const client = new Client({ intents: [Intents.FLAGS.GUILDS] });

const token = 'TOKEN HERE';
const guildId = 'GUILD ID HERE';
const clientId = 'CLIENT ID HERE';

const command = new SlashCommandBuilder().setName('test').setDescription('test').toJSON()
const rest = new REST({ version: '9' }).setToken(token);
(async () => {
	await rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: [command] });
})();

client.on('interactionCreate', async interaction => {
	if (!interaction.isCommand()) return;
	const { commandName } = interaction;

	if (commandName === 'test') {
		const icon = new MessageAttachment('https://i.ibb.co/YkRLWG8/down.png', 'icon.png')
		const embed = new MessageEmbed()
			.setTitle('Test')
			.setImage('attachment://icon.png')
		await interaction.reply({ embeds: [embed], files: [icon], ephemeral: true });
	}
});

client.login(token);

discord.js version

13.1.0

Node.js version

16.8.0

Operating system

Windows

Priority this issue should have

Low (slightly annoying)

Which partials do you have configured?

No Partials

Which gateway intents are you subscribing to?

GUILDS

I have tested this issue on a development release

92f6471

closed time in 4 days

thedjchi

issue commentdiscordjs/discord.js

Bug: Ephemeral embeds do not load image attachments properly

Thanks for the info, this seems to be working now! 🎉

thedjchi

comment created time in 4 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentdiscordjs/discord.js

Creates the fetchGuildTimeout amount client option

  * [User Agent](https://discord.com/developers/docs/reference#user-agent) header  * @property {PresenceData} [presence={}] Presence data to use upon login  * @property {IntentsResolvable} intents Intents to enable for this connection+ * @property {number} [fetchGuildTimeout=15000] Time in milliseconds that bots with the `GUILDS` intent should hang+ * and wait for missing guilds to be received before starting the bot+ * If not specified, the default is 15 seconds.+ * (0 to skip this timeout)

A few non-binding rephrasing suggestions:

  • hang and wait: seems redundant
  • missing: feels a bit misleading (might just be me)
  • starting the bot: Client#login starts it. It's just not ready yet, a small nit.
  • skip this timeout: not wait seems to be a bit more concise
 * @property {number} [waitGuildTimeout=15000] Time in milliseconds that bots with the `GUILDS` intent should wait for
 * initial guild's data to be received before emitting ready. (0 to not wait)
kylerchin

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentdiscordjs/discord-utils-bot

tags: 429 and 429-gateway

 You only need to convert it to an array if you need the index of an entry: • You can transform a Collection to an array with [`Collection#map`](<https://discord.js.org/#/docs/collection/main/class/Collection?scrollTo=map>) • If you need indices, you can get the array using [`[...collection.values()]`](<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/values>) """++[429]+keywords = ["429"]+content = """+• You have been rate limited by discord.+• For most endpoints, this shouldn't happen, because djs handles them for you. If it does, it means you are spamming an endpoint and discord put a very long rate limit for you on that specific endpoint.+"""++[429-gateway]+keywords = ["429-gateway"]+content = """+Getting a 429 on `/gateway/bot`?

Just as a general note: We now emit more info there, this is hopefully going go to help troubleshooting these issues. https://github.com/discordjs/discord.js/blob/92f6471e8e37e5f852d2c310e7c1b43cd42bc44d/src/rest/RequestHandler.js#L269-L279

Nciklol

comment created time in 6 days

PullRequestReviewEvent

Pull request review commentdiscordjs/discord-utils-bot

tags: 429 and 429-gateway

 You only need to convert it to an array if you need the index of an entry: • You can transform a Collection to an array with [`Collection#map`](<https://discord.js.org/#/docs/collection/main/class/Collection?scrollTo=map>) • If you need indices, you can get the array using [`[...collection.values()]`](<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/values>) """++[429]+keywords = ["429"]+content = """+• You have been rate limited by discord.+• For most endpoints, this shouldn't happen, because djs handles them for you. If it does, it means you are spamming an endpoint and discord put a very long rate limit for you on that specific endpoint.

This is probably incorrect (at best unfounded, see below).

This will happen happen if:

  • There was no prior rate limit info available and the client makes a request that exceeds the limit. (e.g. shard 1 exhausts the bucket, shard 2 makes another request -> 429, or by being globally rate limited and the client not being aware of that)
  • Discord does not provide accurate headers. (e.g. sub-limits, managing emoji endpoints)

discord put a very long rate limit for you on that specific endpoint

I have yet to hear anything reliable about this actually happening, as far as I am aware Discord only reserves the right to do that. (Maybe they do the opposite for big bots, but same goes here. Both claims seem quite unfounded.)

Nciklol

comment created time in 6 days

PullRequestReviewEvent

Pull request review commentdiscordjs/discord-utils-bot

tags: 429 and 429-gateway

 You only need to convert it to an array if you need the index of an entry: • You can transform a Collection to an array with [`Collection#map`](<https://discord.js.org/#/docs/collection/main/class/Collection?scrollTo=map>) • If you need indices, you can get the array using [`[...collection.values()]`](<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/values>) """++[429]+keywords = ["429"]+content = """+• You have been rate limited by discord.+• For most endpoints, this shouldn't happen, because djs handles them for you. If it does, it means you are spamming an endpoint and discord put a very long rate limit for you on that specific endpoint.+"""++[429-gateway]+keywords = ["429-gateway"]+content = """+Getting a 429 on `/gateway/bot`?+• You (or someone else) logged in 1000+ times in 24 hours. If you have auto restart on for your code upon crash, you know the culprit.

Identifying more than 1000 times within the 24h bucket causes your token to be invalidated and a system DM sent to the owner(s). There is no REST rate limit to hit here.

Nciklol

comment created time in 6 days

issue commentdiscordjs/discord.js

Bug: Ephemeral embeds do not load image attachments properly

I can reproduce this, this seems to be a Discord bug however: The embed is using the incorrect URL for the attachment.

thedjchi

comment created time in 6 days

PullRequestReviewEvent
PullRequestReviewEvent