jimiwtf
jimiwtf
DIAdiscord.js - Imagine a boo! 👻
Created by jimiwtf on 9/9/2024 in #djs-questions
how do i send a private message via @discordjs/rest
Sorry i couldn't find any route for that
5 replies
DIAdiscord.js - Imagine a boo! 👻
Created by jimiwtf on 7/27/2024 in #djs-questions
DiscordAPIError[0]: 401: Unauthorized even though im authorized and the access token is brand new?
I want to get user's @me info with access token, but it says im unauthorized?
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v10');
const rest = new REST({ version: '10', authPrefix:'Bearer' }).setToken(req.cookies.__access_token__);

const info = await rest.get(Routes.user())
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v10');
const rest = new REST({ version: '10', authPrefix:'Bearer' }).setToken(req.cookies.__access_token__);

const info = await rest.get(Routes.user())
18 replies
DIAdiscord.js - Imagine a boo! 👻
Created by jimiwtf on 4/26/2024 in #djs-voice
Bot joins the vc but audio doesn't play
yes the path is correct.
var { voice } = message.member
if(!voice.channelId) return message.reply({content:`This command requires you to join a vc in this server. [Get help](<https://discord.gg/steamhappy>)`})

const connection = joinVoiceChannel({
channelId: voice.channel.id,
guildId: voice.channel.guild.id,
adapterCreator: voice.channel.guild.voiceAdapterCreator,
});

if(!connection) return message.reply({content:`Couldn't connect to the voice channel. [Get help](<https://discord.gg/steamhappy>)`})

message.reply({content:`Successfully joined ${voice.channel}`})

const player = createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Pause,
},
});

const resource = createAudioResource(path.join(__dirname + 'sounds/meow.mp3'));
player.play(resource);

connection.subscribe(player)
var { voice } = message.member
if(!voice.channelId) return message.reply({content:`This command requires you to join a vc in this server. [Get help](<https://discord.gg/steamhappy>)`})

const connection = joinVoiceChannel({
channelId: voice.channel.id,
guildId: voice.channel.guild.id,
adapterCreator: voice.channel.guild.voiceAdapterCreator,
});

if(!connection) return message.reply({content:`Couldn't connect to the voice channel. [Get help](<https://discord.gg/steamhappy>)`})

message.reply({content:`Successfully joined ${voice.channel}`})

const player = createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Pause,
},
});

const resource = createAudioResource(path.join(__dirname + 'sounds/meow.mp3'));
player.play(resource);

connection.subscribe(player)
8 replies
DIAdiscord.js - Imagine a boo! 👻
Created by jimiwtf on 1/6/2024 in #djs-questions
How do i get user's guilds with @discordjs/rest
I got the access token and i want to fetch user's guilds
9 replies
DIAdiscord.js - Imagine a boo! 👻
Created by jimiwtf on 1/3/2024 in #djs-questions
How do i set a custom status, not a "Playing" one.
No description
8 replies