mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 21:13:30 +01:00
chore(deps): update discord-api-types and /voice (#7934)
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
"@discordjs/rest": "workspace:^",
|
||||
"@sapphire/snowflake": "^3.2.1",
|
||||
"@types/ws": "^8.5.3",
|
||||
"discord-api-types": "^0.32.1",
|
||||
"discord-api-types": "^0.33.0",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"lodash.snakecase": "^4.1.1",
|
||||
"tslib": "^2.3.1",
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const request = require('superagent');
|
||||
const ytdl = require('ytdl-core');
|
||||
const { token, song } = require('./auth.js');
|
||||
const { token } = require('./auth.js');
|
||||
const { Client } = require('../src');
|
||||
const { ChannelType, GatewayIntentBits } = require('discord-api-types/v10');
|
||||
|
||||
@@ -32,7 +30,7 @@ client.on('guildCreate', guild =>
|
||||
// Fetch all members in a newly available guild
|
||||
client.on('guildUpdate', (oldGuild, newGuild) =>
|
||||
!oldGuild.available && newGuild.available
|
||||
? guild.members.fetch().catch(err => console.log(`Failed to fetch all members: ${err}\n${err.stack}`))
|
||||
? newGuild.members.fetch().catch(err => console.log(`Failed to fetch all members: ${err}\n${err.stack}`))
|
||||
: Promise.resolve(),
|
||||
);
|
||||
|
||||
@@ -99,12 +97,10 @@ client.on('messageCreate', message => {
|
||||
}
|
||||
|
||||
if (message.content.startsWith('botavatar')) {
|
||||
request.get('url').end((err, res) => {
|
||||
client.user
|
||||
.setAvatar(res.body)
|
||||
.catch(console.error)
|
||||
.then(user => message.channel.send('Done!'));
|
||||
});
|
||||
fetch('url')
|
||||
.then(result => result.arrayBuffer())
|
||||
.then(buffer => client.user.setAvatar(buffer))
|
||||
.then(() => message.channel.send('Done!'), console.error);
|
||||
}
|
||||
|
||||
if (message.content.startsWith('gn')) {
|
||||
@@ -200,34 +196,6 @@ client.on('messageCreate', msg => {
|
||||
}
|
||||
});
|
||||
|
||||
let disp, con;
|
||||
|
||||
client.on('messageCreate', msg => {
|
||||
if (msg.content.startsWith('/play')) {
|
||||
console.log('I am now going to play', msg.content);
|
||||
const chan = msg.content.split(' ').slice(1).join(' ');
|
||||
const s = ytdl(chan, { filter: 'audioonly' }, { passes: 3 });
|
||||
s.on('error', e => console.log(`e w stream 1 ${e}`));
|
||||
con.play(s);
|
||||
}
|
||||
if (msg.content.startsWith('/join')) {
|
||||
const chan = msg.content.split(' ').slice(1).join(' ');
|
||||
msg.channel.guild.channels.cache
|
||||
.get(chan)
|
||||
.join()
|
||||
.then(conn => {
|
||||
con = conn;
|
||||
msg.channel.send('done');
|
||||
const s = ytdl(song, { filter: 'audioonly' }, { passes: 3 });
|
||||
s.on('error', e => console.log(`e w stream 2 ${e}`));
|
||||
disp = conn.playStream(s);
|
||||
conn.player.on('debug', console.log);
|
||||
conn.player.on('error', err => console.log(123, err));
|
||||
})
|
||||
.catch(console.error);
|
||||
}
|
||||
});
|
||||
|
||||
client.on('messageReactionAdd', (reaction, user) => {
|
||||
if (reaction.message.channelId !== '222086648706498562') return;
|
||||
reaction.message.channel.send(`${user.username} added reaction ${reaction.emoji}, count is now ${reaction.count}`);
|
||||
|
||||
Reference in New Issue
Block a user