mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -4,9 +4,7 @@ const assert = require('assert');
|
||||
const { token } = require('./auth');
|
||||
const { Client, Intents } = require('../src');
|
||||
|
||||
const client = new Client({
|
||||
intents: Intents.NON_PRIVILEGED,
|
||||
});
|
||||
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
|
||||
|
||||
client.on('ready', async () => {
|
||||
try {
|
||||
|
||||
@@ -5,13 +5,11 @@
|
||||
const request = require('superagent');
|
||||
const ytdl = require('ytdl-core');
|
||||
const { token, song } = require('./auth.js');
|
||||
const Discord = require('../src');
|
||||
const { Client, Intents } = require('../src');
|
||||
|
||||
console.time('magic');
|
||||
|
||||
const client = new Discord.Client({
|
||||
intents: Discord.Intents.NON_PRIVILEGED
|
||||
});
|
||||
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS, Intents.FLAGS.GUILD_MEMBERS] });
|
||||
|
||||
client
|
||||
.login(token)
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
const { token, guildId, channelId, messageId } = require('./auth.js');
|
||||
const { Client, ReactionCollector } = require('../src');
|
||||
const { Client, Intents, ReactionCollector } = require('../src');
|
||||
|
||||
const client = new Client();
|
||||
const client = new Client({
|
||||
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS],
|
||||
});
|
||||
|
||||
client.on('ready', async () => {
|
||||
const guild = client.guilds.cache.get(guildId);
|
||||
|
||||
@@ -5,11 +5,9 @@ const path = require('path');
|
||||
const util = require('util');
|
||||
const fetch = require('node-fetch');
|
||||
const { owner, token } = require('./auth.js');
|
||||
const Discord = require('../src');
|
||||
const { Client, Intents, MessageAttachment, MessageEmbed } = require('../src');
|
||||
|
||||
const client = new Discord.Client({
|
||||
intents: Discord.Intents.NON_PRIVILEGED,
|
||||
});
|
||||
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
|
||||
|
||||
const fill = c => Array(4).fill(c.repeat(1000));
|
||||
const buffer = l => fetch(l).then(res => res.buffer());
|
||||
@@ -21,8 +19,8 @@ const linkA = 'https://lolisafe.moe/iiDMtAXA.png';
|
||||
const linkB = 'https://lolisafe.moe/9hSpedPh.png';
|
||||
const fileA = path.join(__dirname, 'blobReach.png');
|
||||
|
||||
const embed = () => new Discord.MessageEmbed();
|
||||
const attach = (attachment, name) => new Discord.MessageAttachment(attachment, name);
|
||||
const embed = () => new MessageEmbed();
|
||||
const attach = (attachment, name) => new MessageAttachment(attachment, name);
|
||||
|
||||
const tests = [
|
||||
m => m.channel.send('x'),
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
const { token } = require('./auth.json');
|
||||
const Discord = require('../src');
|
||||
const { Client, Intents } = require('../src');
|
||||
|
||||
const client = new Discord.Client({
|
||||
const client = new Client({
|
||||
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
|
||||
shards: process.argv[2],
|
||||
shardCount: process.argv[3],
|
||||
intents: Discord.Intents.NON_PRIVILEGED,
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
const { token, prefix, owner } = require('./auth.js');
|
||||
const Discord = require('../src');
|
||||
const { Client, Intents } = require('../src');
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
const log = (...args) => console.log(process.uptime().toFixed(3), ...args);
|
||||
|
||||
const client = new Discord.Client({
|
||||
const client = new Client({
|
||||
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
|
||||
shardCount: 2,
|
||||
intents: Discord.Intents.NON_PRIVILEGED,
|
||||
});
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
|
||||
const ytdl = require('ytdl-core');
|
||||
const auth = require('./auth.js');
|
||||
const Discord = require('../src');
|
||||
const { Client, Intents } = require('../src');
|
||||
|
||||
const client = new Discord.Client({
|
||||
const client = new Client({
|
||||
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_PRESENCES],
|
||||
partials: [],
|
||||
intents: Discord.Intents.NON_PRIVILEGED,
|
||||
});
|
||||
|
||||
client
|
||||
|
||||
@@ -5,11 +5,9 @@ const path = require('path');
|
||||
const util = require('util');
|
||||
const fetch = require('node-fetch');
|
||||
const { owner, token, webhookChannel, webhookToken } = require('./auth.js');
|
||||
const Discord = require('../src');
|
||||
const { Client, Intents, MessageAttachment, MessageEmbed, WebhookClient } = require('../src');
|
||||
|
||||
const client = new Discord.Client({
|
||||
intents: Discord.Intents.NON_PRIVILEGED,
|
||||
});
|
||||
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
|
||||
|
||||
const fill = c => Array(4).fill(c.repeat(1000));
|
||||
const buffer = l => fetch(l).then(res => res.buffer());
|
||||
@@ -21,8 +19,8 @@ const linkA = 'https://lolisafe.moe/iiDMtAXA.png';
|
||||
const linkB = 'https://lolisafe.moe/9hSpedPh.png';
|
||||
const fileA = path.join(__dirname, 'blobReach.png');
|
||||
|
||||
const embed = () => new Discord.MessageEmbed();
|
||||
const attach = (attachment, name) => new Discord.MessageAttachment(attachment, name);
|
||||
const embed = () => new MessageEmbed();
|
||||
const attach = (attachment, name) => new MessageAttachment(attachment, name);
|
||||
|
||||
const tests = [
|
||||
(m, hook) => hook.send('x'),
|
||||
@@ -121,7 +119,7 @@ client.on('message', async message => {
|
||||
if (message.author.id !== owner) return;
|
||||
const match = message.content.match(/^do (.+)$/);
|
||||
const hooks = [
|
||||
{ type: 'WebhookClient', hook: new Discord.WebhookClient(webhookChannel, webhookToken) },
|
||||
{ type: 'WebhookClient', hook: new WebhookClient(webhookChannel, webhookToken) },
|
||||
{ type: 'TextChannel#fetchWebhooks', hook: await message.channel.fetchWebhooks().then(x => x.first()) },
|
||||
{ type: 'Guild#fetchWebhooks', hook: await message.guild.fetchWebhooks().then(x => x.first()) },
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user