#development

1 messages · Page 1925 of 1

slender wagon
#

yeah that's what i did

#

buttons better

#

haven't used discord.js in a longg long time

earnest phoenix
#

discord.js sucs

#

detritus is betetr

#

jjxukrehr

slender wagon
#

eh

quartz kindle
#

both suck, raw api best

#

:^)

earnest phoenix
#

it's easy for you cuz you're a discord api god

quartz kindle
#

well i made it easy for you peeps

earnest phoenix
#
How can I restrict my bot to send 18+ reddit memes

Python

lyric mountain
#

usually the api returns whether the result is flagged as nsfw or not

earnest phoenix
#

for nsfw posts jsonResponse.data.over_18 === true

royal pumice
#

@earnest phoenix hey help

earnest phoenix
#

I don't do python

#

but hopefully someone can help you

lyric mountain
#

that's another guy

royal pumice
#

Ok

#

I made a command for my bot to join vc but have problems will make command for disconnect

#

Help me

dull plume
#

i just got pinged here

earnest phoenix
#

I think I know who did it

smoky herald
#

Hello 👋 //djs v12 btw
Anybody knows what is meant by those "lines of communication" between master and child process that the docs mention? Is it the broadcast/fetch methods?
Those methods unfortunately fail with rejection while shards are still being spawned so I thought I'd make a centralized object for server side cooldown check on that (hopefully shared?) index file with ShardingManager pika_think
Can't figure out how to reach it from the individual shards tho ConfusedShock

blissful falcon
#

how would i make my bot have j! and J! as prefix?

earnest phoenix
blissful falcon
#

right under where my lower case prefix is?

earnest phoenix
#

can you show the code

blissful falcon
solemn latch
#

I'd just look at the djs github tbh

earnest phoenix
# blissful falcon

convert message to lower case or something and then compare it to prefix

earnest phoenix
smoky herald
blissful falcon
#

k

earnest phoenix
#

but why the interval 😄

#

maybe they want to set their guild count

#

which changes frequently

#

why is this happening..
when embeds.js is called from console, it works
but calling it from another file, say main.js gives this error

var commands = funcs.getCommands();
TypeError: funcs.getCommands is not a function

Its a function btw

#

check embeds.js module.exports

#

check for what.. funcs.getCommands() is a function and it works
but funcs.getCommands() cant be called in embeds.js from another file

#

exports are just embeds

delicate zephyr
earnest phoenix
#

other lines are just exports

#

it works when logged, but only when called from console ;d

west stag
#

yes

lyric mountain
earnest phoenix
#

How to make npm work

#

: (

lyric mountain
#

also, always prefer for (e of elements) { instead of forEach(e => {

west stag
earnest phoenix
#

Ok

#

Npm -v then ?

wheat mesa
#

<Guild>.roles.create(Role)

earnest phoenix
#

npm -v install module ?

wheat mesa
#
earnest phoenix
earnest phoenix
#
Hmm
wheat mesa
lyric mountain
#

then see if it works

earnest phoenix
lyric mountain
earnest phoenix
#
npm -v install <module>
earnest phoenix
#

I am

#

Thinking

#

To learn

#

Java

#

Also

#

: (

#

Ok

lyric mountain
earnest phoenix
lyric mountain
#

it's not

earnest phoenix
#

K idk 😂

lyric mountain
#

java is an entire different language

earnest phoenix
#

look at this thing

#

makes no sense

#

Cant we use java

lyric mountain
#

it's like car and carpet

earnest phoenix
#

Oh

#

Whats for java

lyric mountain
#

java is java

earnest phoenix
#

Npm is for javascript

#

Then what's for java

#

xd

#

I forgot

wheat mesa
#

Java is nothing like javascript except in maybe naming conventions

earnest phoenix
#

😂

lyric mountain
#

maven, gradle, spring, sbt, etc etc

lyric mountain
earnest phoenix
#

i did

#

didnt work

lyric mountain
#

you didn't

earnest phoenix
#

in embeds and main

lyric mountain
earnest phoenix
#

thats an old screensot

#

here

lyric mountain
#

show where u define funcs

earnest phoenix
#

oh funcs is just an import

lyric mountain
#

try using es6 imports

#

import * from './funcs'

earnest phoenix
#

..

lyric mountain
#

show ur whole file

earnest phoenix
#

I have a problem, the log return me undefined, but idk why...
Code:

const channels = [interaction.guild.channels.cache.filter(channel => channel.type === 'GUILD_TEXT').values()];
backupData.channels = {};
for (const TextChannel in channels) {
     const channelData = channels[TextChannel];
     console.log(channelData.name)
};```

channelData object :
```json
[Map Iterator] {
  <ref *1> TextChannel {
    type: 'GUILD_TEXT',
    deleted: false,
    guild: Guild {
      id: '910856243709620284',
      name: 'backup test',
      icon: null,
      features: [],
      commands: [GuildApplicationCommandManager],
      members: [GuildMemberManager],
      channels: [GuildChannelManager],
      bans: [GuildBanManager],
      roles: [RoleManager],
      presences: PresenceManager {},
      voiceStates: [VoiceStateManager],
      stageInstances: [StageInstanceManager],
      invites: [GuildInviteManager],
      deleted: false,
      available: true,
      shardId: 0,
      splash: null,
      banner: null,
      description: null,
      verificationLevel: 'NONE',
      vanityURLCode: null,
      nsfwLevel: 'DEFAULT',
      discoverySplash: null,
      memberCount: 3,
      large: false,
      applicationId: null,
      afkTimeout: 300,
      afkChannelId: null,
      systemChannelId: '910856243709620287',
      premiumTier: 'NONE',
      premiumSubscriptionCount: 0,
      explicitContentFilter: 'DISABLED',
      mfaLevel: 'NONE',
      joinedTimestamp: 1637235486191,
      defaultMessageNotifications: 'ALL_MESSAGES',
      systemChannelFlags: [SystemChannelFlags],
      maximumMembers: 250000,
      maximumPresences: null,
      approximateMemberCount: null,
      approximatePresenceCount: null,
      vanityURLUses: null,
      rulesChannelId: null,
      publicUpdatesChannelId: null,
      preferredLocale: 'en-US',
      ownerId: '605371484046884865',
      emojis: [GuildEmojiManager],
      stickers: [GuildStickerManager]
    },
    guildId: '910856243709620284',
    parentId: '910856243709620285',
    permissionOverwrites: PermissionOverwriteManager { channel: [Circular *1] },
    messages: MessageManager { channel: [Circular *1] },
    threads: ThreadManager { channel: [Circular *1] },
    nsfw: false,
    id: '910856243709620287',
    name: 'général',
    rawPosition: 0,
    topic: null,
    lastMessageId: '911288282153881640',
    rateLimitPerUser: 0
  }
}```

He return me undefined, why
lyric mountain
#

idk why

earnest phoenix
#

ok

#

undefined @earnest phoenix

#

what is message pls ?

lyric mountain
earnest phoenix
#

channelData["guild"]["name"];

lyric mountain
#

in returns the index, of returns the object itself

earnest phoenix
#

idk what ur even logging

#

we never know

#

so u have the error bc your are in DM

#

i know

#

and dm != guild

#

ok

#

i declare war on javascript, fuck you

#

Don't ask for help, I bring solutions

#

This is not wrong because you did not give your code, just the error, so when you ask for help make a full request. Thank you

lyric mountain
#

try```js
if (message?.guild?.id !== "840225836028395520") return;

earnest phoenix
#

It was therefore irrelevant, if guild is not defined, go back to the root, either message and see what you defined

#

but, np

earnest phoenix
lyric mountain
lyric mountain
#
const channels = [interaction.guild.channels.cache.filter(channel => channel.type === 'GUILD_TEXT').values()];
backupData.channels = {};
for (const channelData of channels) {
     console.log(channelData.name)
}
earnest phoenix
#

yes i do this

#

but channelData doesn't define

#

return undefined

lyric mountain
#

channelData or name?

earnest phoenix
#

console.log(funcs)

earnest phoenix
#

i try log TextChannel and it's return log me json [Map Iterator] { <ref *1> TextChannel { type: 'GUILD_TEXT', deleted: false, guild: Guild { id: '910856243709620284', name: 'backup test', icon: null, features: [], commands: [GuildApplicationCommandManager], members: [GuildMemberManager], channels: [GuildChannelManager], bans: [GuildBanManager], roles: [RoleManager], presences: PresenceManager {}, voiceStates: [VoiceStateManager], stageInstances: [StageInstanceManager], invites: [GuildInviteManager], deleted: false, available: true, shardId: 0, splash: null, banner: null, description: null, verificationLevel: 'NONE', vanityURLCode: null, nsfwLevel: 'DEFAULT', discoverySplash: null, memberCount: 3, large: false, applicationId: null, afkTimeout: 300, afkChannelId: null, systemChannelId: '910856243709620287', premiumTier: 'NONE', premiumSubscriptionCount: 0, explicitContentFilter: 'DISABLED', mfaLevel: 'NONE', joinedTimestamp: 1637235486191, defaultMessageNotifications: 'ALL_MESSAGES', systemChannelFlags: [SystemChannelFlags], maximumMembers: 250000, maximumPresences: null, approximateMemberCount: null, approximatePresenceCount: null, vanityURLUses: null, rulesChannelId: null, publicUpdatesChannelId: null, preferredLocale: 'en-US', ownerId: '605371484046884865', emojis: [GuildEmojiManager], stickers: [GuildStickerManager] }, guildId: '910856243709620284', parentId: '910856243709620285', permissionOverwrites: PermissionOverwriteManager { channel: [Circular *1] }, messages: MessageManager { channel: [Circular *1] }, threads: ThreadManager { channel: [Circular *1] }, nsfw: false, id: '910856243709620287', name: 'général', rawPosition: 0, topic: null, lastMessageId: '911288282153881640', rateLimitPerUser: 0 } }

lyric mountain
#

show current code

earnest phoenix
lyric mountain
earnest phoenix
#

and TextChannel return the Map Iterator

earnest phoenix
#

and .name undefined

#

but doesnt work when called from another file 😄

lyric mountain
#

if u try to use it where u shouldn't it might be called before even importing the function

lyric mountain
earnest phoenix
lyric mountain
#

u defined channels as an array with arrays

lyric mountain
earnest phoenix
#

when embeds is required from another file it shows that

lyric mountain
#

where would u use that function?

earnest phoenix
#

eyestrain

lyric mountain
#

send that code here

#

I can't read it that way, it's too messy

earnest phoenix
#

its perfect, it works btw xd

#

its not the problem

#

defining commands = funcs.getCommands() is the problem

#
Object.keys(commands).forEach(command => {
    const obj = Object(commands)[command];
    cmdForm+=`${obj["admin"] === true ? "*" : ""}\`${command}\` ${ obj["usage"] !== null ? obj["usage"] : ""}\n`;
});

be gentle

lyric mountain
#

regex

earnest phoenix
#

c# got me good

wheat mesa
#

Bro if you’re doing that from C# then you’re smoking the good C#

#

The worst thing I’ve written for my bot so far is like

export enum AnimalTypes {
  'capybara',
  'bird',
  'cat',
  'dog',
  'lizard',
}

export function animalPayload() {
  return (value: string): string | null => {
    const result = Object.values(AnimalTypes)
      .find(x => x === value)
      ?.toString();
    if (result) {
      return result;
    } else {
      return null;
    }
  };
}
#

And that’s overcomplicating it

lyric mountain
#

here, a bit better

#

my guess is that you have a scope issue

pale vessel
#

const [name, command]

earnest phoenix
#

im just gonna get rid of this cancer language

#

thanks for help ;d

lyric mountain
#

yk, you could always work with a class-based structure if u hate functional programming that much

#

since u said u came from c#

#

imo classes were always easier to work with than functions

#

well, yeah since that'll lock anything below

#

if true return else return

#

there's no chance the runtime will ever get to the next line since both true and false return

#

also, you could just convert string to int using base 16

wheat mesa
#

Regex is cringe

lyric mountain
#

parseInt(<character>, 16)

#

very, very bad

#

redis was not created with long term storage as a goal

#

while it might be fast it stores the whole thing in memory

#

if going for in-memo database just use sqlite which barely weights anything

west stag
#

I think I'm yeeting Typescript

feral aspen
#

Yoo.

#

My domain is expired, we shall celebrate. lmao (story: host doesn't have website license anymore, i can't transfer, problem for both of us)

misty sigil
#

here we can see, ben acquiring another domain

blissful falcon
#

how would i create another help page?

#

on nodejs

quartz kindle
#

pretty sure you cant

earnest phoenix
#

I do not want to say nonsense, but it seems to me that this is not possible, unless you have stored before in a database or the like

heavy marsh
#

I am using d.js v12
I am trying to find if a user has a role from a diffrent server I keep getting the error cache of undefined

client.on("guildMemberAdd", async (member) => {
if(member.guild.id == `864550299590983730`) {
let StaffRole = client.guilds.cache.get(`611881570202025986`).roles.cache.find(r => r.name === "Crew Member");
if(client.guilds.cache.get(`611881570202025986`).member.roles.cache.some(StaffRole)) { console.log(`Passed!`) }

return;
}
})
solemn latch
heavy marsh
#
if(client.guilds.cache.get(`611881570202025986`).member.roles.cache.some(StaffRole)) { console.log(`Passed!`) }```
#

says here

#
TypeError: Cannot read property 'cache' of undefined
    at Client.<anonymous> (/home/container/events/guildMemberAdd.js:14:62)
    at Client.emit (node:events:394:28)
    at Object.module.exports [as GUILD_MEMBER_ADD] (/home/container/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_ADD.js:16:14)
    at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (node:events:394:28)
    at Receiver.receiverOnMessage (/home/container/node_modules/ws/lib/websocket.js:983:20)
    at Receiver.emit (node:events:394:28)
#

@solemn latch^

solemn latch
#

Does the member have a role? Roles can be empty

heavy marsh
#

Like I am checking if the user a the x role in the main server

solemn latch
#

Op, seems the property member of a guild doesn't exist

heavy marsh
#

The guild is aviable

solemn latch
#

Sure, but it doesn't seem to have .member

heavy marsh
#

Is there another way to do this

solemn latch
#

Just to clarify, you want to check on guild member add if someone's in a specific guild, and if they have a specific role right?

heavy marsh
#

Event guildMemberAdd

solemn latch
#

Or well depending on how you want it to work specifically

#

If you want it to be if they join any guild check the original guild you'll need to perform a get of that guild

heavy marsh
#

member.roles.cache how can i use this to check from a diffrent server

solemn latch
#

Ah OK then no to the previous question

heavy marsh
#

yep

#
client.guilds.cache.get(`611881570202025986`).
solemn latch
#

You'll want to get the guild like you are doing, then get the member using Guild.members.cache.get
https://discord.js.org/#/docs/main/12.5.3/class/Guild?scrollTo=members

You'll probably actually want to fetch it just incase they are not cached

heavy marsh
solemn latch
#

Yep, I would suggest using variables and some basic checks to make sure they are actually in the server and have roles there so it doesn't error/fail. I'd also suggest fetching the member if possible

heavy marsh
solemn latch
#

Ah fetch is a promise so you need to await that

heavy marsh
#

F forgot

#
let StaffMember = await client.guilds.cache.get(`611881570202025986`).members.fetch(member.user.id);
if(!StaffMember) member.kick(`Not a staff member!`);

if(StaffMember.roles.cache.some(r => r.name === "Crew Member")) { console.log(`Passed!`) }
#

@solemn latch ^ Will this work to check if the user is in the server or not

solemn latch
#

Yep should do, but just a note your kicking every member that joins any server the bots in that isn't in the staff server

heavy marsh
#

not I did a check

solemn latch
#

Ok

heavy marsh
heavy marsh
# solemn latch Ok

Do you known how to make the wait 10 - 30 seconds before running the code

#

on member join

#
setTimeout(function(){ 
    
 }, 30000);
solemn latch
#

Yeah

heavy marsh
#
if(member.guild.id == `864550299590983730`) {

setTimeout(function(){ 
let StaffMember = await client.guilds.cache.get(`611881570202025986`).members.fetch(member.user.id);
if(!StaffMember) member.kick(`Member is not a staff member!`);

if(StaffMember.roles.cache.some(r => r.name === "Crew Member")) {
member.roles.add(`910942702219173908`);
member.guild.channels.cache.get(`911228262489931797`).send(`**Welcome to the staff server ${member}!**`);
return;
} else {
member.kick(`Member is not a staff member!`);
return;
}
}, 30000);
    
return;
}
#

Looks good?

solemn latch
#

Yep

heavy marsh
#

Thank you!

tired panther
#

https://discord.js.org/#/docs/main/stable/class/MessageActionRow
Having a Issue, the Docs say it accepts multiply Components
Although I tried as documentated:

buttons.push(new Discord.MessageButton().setLabel(`⬅️`).setStyle(`PRIMARY`).setCustomId(`l|pe`));
buttons.push(new Discord.MessageButton().setLabel(`➡️`).setStyle(`PRIMARY`).setCustomId(`r|pe`));
            const row1 = new Discord.MessageActionRow().addComponents(buttons);

But it errors with the following Error:

lament stump
#

@earnest phoenix

#

sorry if you read it already

earnest phoenix
lament stump
#

i think it's outdated too, since body-parser is deprecated

#

so like ._.

earnest phoenix
lament stump
#

But that's using React, I'm using EJS ._.

#

ig time to rewrite everything in react then

lament rock
#

express has its own body-parser

earnest phoenix
earnest phoenix
stray seal
#

What sites can you find .xyz domains?

split hazel
#

literally every domain provider

stray seal
#

Someone is having a hard time seeing their Dashboard when their bot is down. Is this normal?

solemn latch
#

does their dashboard depend on the bot?

#

if so, yes

#

Ideally it would be independent in the event of the bot being offline

spark flint
#

namecheap is £0.74

stray seal
#

How do you become a Auctions Tester?

lyric mountain
stray seal
#

And what is that xD

tribal crow
#

Hey! I get this error (https://sourceb.in/M8dGp7payd) when using discord-canvas and canvacord, and i dont understand why. I googled it and tried what i found, but nothing helped. Does anyone know how to fix it?

I only get this error on repl.it and i use node v16.6.

split hazel
lament stump
cinder patio
lament stump
#

ah, was confused by the embed desc then

tribal crow
split hazel
#

usually fixes things like that

tribal crow
#

there is no node modules folder on repl.it

split hazel
#

right

#

one second

split hazel
#

then npm install

tribal crow
#

Still the same error

split hazel
#

oh wait i just seen the error

#

the node version is very outdated and mostly needs to be updated

#

i dont know too much about updating node on repl.it but @quartz kindle does

tribal crow
#

i use node v16.6

#

on repl

split hazel
#

did you confirm by running node --version

tribal crow
#

hmmm

#

that says its v12.22.6

#

but thats not possible

#

cus then djs v13 wouldnt work

#

wait

#

imma try to clear npm cache

quartz kindle
#

console.log(process.version)

split hazel
limber mica
#

In discord eris how do I setup gateway intents

lyric mountain
limber mica
#

Ive never used eris :/

tribal crow
split hazel
#

canvas isnt an easy library to work with

#

very weak and error prone node bindings

#

especially in a limited environment such as repl

lyric mountain
#

isn't canvas incompatible with repl?

#

like, I read somewhere that it's blocked there

quartz kindle
#

what matters is what the actual process is running on

lyric mountain
#

there it comes

quartz kindle
#

so run console.log(process.version) in your code

#

its the only surefire way to see which version your code is running on

#

also depends how you installed your packages

#

depending on how you run your node, the way to install packages is also different

tribal crow
#

ill try

#

returns v16.13.0

quartz kindle
#

alright

#

and which method did you use to run that version?

tribal crow
#

its a long one

#

npm init -y && npm i --save-dev node@16.13.0 && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH

quartz kindle
#

ok, so first thing is that PATH is not persistent in replit, no matter how you set it up it will always reset after a while

#

so if you want to use that method, you have to also install all dependencies at the same time in that code

heavy marsh
#

Simple question ... What is this wrong

if(message.channel.id !== `611882154065920020` || message.channel.id !== `611882231820058624`)
lyric mountain
#

ye using NOT with OR

#

and using template strings for static data

quartz kindle
#

currently the easiest method is to create a nix project

tribal crow
#

...

heavy marsh
quartz kindle
wheat mesa
wheat mesa
#

NOT OR NOT is logically invalid

lyric mountain
#

NON for short KEKW

wheat mesa
#

True

heavy marsh
#

Ahh that explains

#

why i get them mixed up

wheat mesa
#

No that should be fine

quartz kindle
#

that is correct if you want the channel id to be one of those two

wheat mesa
heavy marsh
#

So there is nothing to do to return if these 2 are not the channel ids

quartz kindle
#

you're looking for NOT AND NOT

tribal crow
#

Tim

#

I this get

#

Error: Cannot find module 'node:events'

heavy marsh
#

Like I am trying to onlt be able to run the commands on these 2 ids

wheat mesa
#

Then you should use NOT AND NOT

quartz kindle
#

if id is NOT this one, AND also NOT this one, return

wheat mesa
#

booleans are fun

heavy marsh
#

oor so use &&

quartz kindle
wheat mesa
#

!condition && !condition

tribal crow
#

huh?

quartz kindle
heavy marsh
#
if(message.channel.id !== `611882154065920020` && message.channel.id !== `611882231820058624`)
tribal crow
quartz kindle
#

did you run it?

#

the base code, without anything installed

tribal crow
tribal crow
quartz kindle
#

what did it log?

tribal crow
#

it logged error

quartz kindle
#

this code

tribal crow
#

it didnt log anything because of the error

quartz kindle
#

there cant be an error in that code

#

you added something else

heavy marsh
#

@wheat mesa@quartz kindle@lyric mountain - Thank you! cute

tribal crow
#
{ pkgs }: {
    deps = [
       pkgs.nodejs-16_x
    ];

}
#

run = "node index.js"

quartz kindle
#

again, did you fork the repl and created a new one?

tribal crow
#

i didnt create a new one

quartz kindle
#

or are you just trying to add those files to your existing one

quartz kindle
#

im telling you to create a new one by forking it

#

click on the fork button

tribal crow
#

got it

#

do i run it now?

quartz kindle
#

now run it to confirm that the node version is correct

tribal crow
#

v12.22.6

quartz kindle
#

are you sure?

#

i forked it, clicked the run button, and got this

tribal crow
#

im very sure

quartz kindle
lament stump
#

@earnest phoenix yet another issue is that both examples use passport-local and passport-local-mongoose .-.

tribal crow
quartz kindle
#

and you just forked it and nothing else?

#

that very weird

tribal crow
#

2 sec

lament stump
#

it works for me like that, so maybe it does for you (idk if this has been tried yet)

quartz kindle
#

so you have to run that again everytime it resets

tribal crow
#

still says v12

lament stump
quartz kindle
tribal crow
#

node.js

quartz kindle
#

you have to chose nix

#

not node

tribal crow
#

oh

quartz kindle
#

thats why i told you to fork lol

tribal crow
#

but i dont get that option when forking?

lament stump
#
  • with my example you can choose node
quartz kindle
#

it should stop working if the PATH variable gets reset

lament stump
#

idk how repl works ¯_(ツ)_/¯

quartz kindle
#

because it reverts to the default node

lament stump
#

it works for me without issues so c:

quartz kindle
#

well, as long as it keeps running, it wont reset

#

but if you stop your bot and leave it for like a day, it will likely not work when you start it again

tribal crow
#

there we go

#

v16.7.0

lament stump
#

but the chance that you stop your bot for a day is slim

quartz kindle
#

well yes

#

anyways, now you should be able to install stuff from npm using the shell and a package.json file

tribal crow
#

hawk

quartz kindle
#

the nix method is pretty much the "official" way to run node 16 on replit at the moment

tribal crow
#

i managed to drag my node modules folder to my repl

#

now its kinda slow

quartz kindle
#

dont do that

tribal crow
#

well

#

too late

quartz kindle
#

node_modules always have to be reinstalled

tribal crow
#

ik

quartz kindle
#

you cant copy and paste them between different node versions

tribal crow
#

ik

quartz kindle
#

yes

tribal crow
#

Error: libuuid.so.1: cannot open shared object file: No such file or directory

quartz kindle
#

whats the full error

tribal crow
quartz kindle
#

try adding pkgs.libuuid in your nix file deps

tribal crow
quartz kindle
#

try npm install canvas --build-from-source

tribal crow
quartz kindle
#

whats the log for that

tribal crow
#

the same

quartz kindle
#

i mean the npm install log

tribal crow
#
up to date, audited 159 packages in 3s

16 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
quartz kindle
#

then uninstall it first

#

and run again

tribal crow
#

i did

quartz kindle
#

then wheres the install log

tribal crow
#

install log?

quartz kindle
#

... i'll just do it myself

#

this log

eternal osprey
#

Hey!

#

Could anyone help me with a method how i can find links/apis/endpoints on a site to easily scrape?

#

https://www.solanadrops.art for example this site. How would i exactly get to scrape it

Solana NFT Drops

Don't miss any Upcoming Solana NFT Drops. With the best Solana NFT list. You will find only the most valuable projects on our list. Don't miss next Solana Blue Chip Mint.

solemn latch
eternal osprey
#

yeah i tried inspecting element + network inspecting

#

they don't use an api and completely hide the info's in the cache using hummingbird

quartz kindle
eternal osprey
#

i think that this website doesn't work?

quartz kindle
#
{ pkgs }: {
    deps = [
        pkgs.nodejs-16_x
        pkgs.python39
        pkgs.pkg-config
        pkgs.pixman
        pkgs.cairo
        pkgs.pango
        pkgs.libpng
        pkgs.libjpeg
        pkgs.librsvg
        pkgs.giflib
        pkgs.fontconfig
    ];
}
#

npm i canvas --build-from-source

eternal osprey
quartz kindle
#

just fetch the page and scrape it from the text

tribal crow
lament rock
#

html scraping is easy

eternal osprey
#

With axios for example

lament rock
#

It's the same with any http lib. The scraping is done with regular expressions

#

You would regex the elements you want and retrieve their value

quartz kindle
#

you dont even need regex

#

just string searching with str.indexOf and str.slice, or str.split for example

earnest phoenix
#

hi i would have a question whether it is worth writing slash commands or unnecessary?

wheat mesa
#

Huh?

earnest phoenix
#

let clay = message.guild.users.cache.find('694367588464984095')
const currentDate = new Date();


const on_status = new Discord.MessageEmbed()
.setAuthor(message.guild.name, message.guild.iconURL())
.setAuthor(`Bot Locked; Emergency Enabled.`)
.setDescription(`Bot was locked at ${currentDate} by ${message.author.tag}.\n\n> \`\`\`Use **nah emergency off** to disable it.\`\`\`  `)
clay.send({ embed:[on_status] })
#

djs v13 btw

wheat mesa
#

Guild doesn’t have a cache

earnest phoenix
#

o-o

#

I tried .find by itself

#

said (reading 'find')

quartz kindle
#

guild doesnt have .users

earnest phoenix
#

o-o

#

uh

wheat mesa
#

It has .members

earnest phoenix
#

message.guild.members.find?

quartz kindle
#

.cache.find

#

also

#

you have an id

#

so

#

.cache.get

#

not find

#

also

#

that only works if the member is cached

#

it wont work with offline members for example

wheat mesa
#

Doesn’t the guild object automatically have all members?

quartz kindle
#

no

wheat mesa
#

Odd

quartz kindle
#

if it did, everyone's bot would be using gbs of ram

delicate shore
#

Why am I getting thie error on Mozilla Firefox

#
{
    "name": "YT Dislikes viewer",
    "description": "Show the dislike count on YouTube videos.",
    "version": "1.5",
    "manifest_version": 2,
    "background": {
      "scripts": ["service.js"]
    },
   "browser_action": {
    "default_icon": {
      "16": "/icons/get_started16.png",
      "32": "/icons/get_started32.png",
      "48": "/icons/get_started48.png",
      "128": "/icons/get_started128.png"
    },
    "default_title": "Home Page",
    "default_popup": "popup/index.html"
  },
    "permissions": [
      "tabs",
       "webNavigation", "storage", "all_urls"
  ],
  "host_permissions": ["*://*.youtube.com/watch?*"],
    "icons": {
      "16": "/icons/get_started16.png",
      "32": "/icons/get_started32.png",
      "48": "/icons/get_started48.png",
      "128": "/icons/get_started128.png"
    }
  }
  

my manifest

earnest phoenix
#

I hate people who send screenshots of errors

#

Anyway what exactly are you doing tf I've never encountered an error like that

royal pumice
#

Can anyone gelp

delicate shore
royal pumice
#

Me

#

I want code for my .py bot to leave a vc

proven lantern
#

a single embed is limited to 25 fields right?

quartz kindle
royal pumice
#

It say client user don't have atterbute disconnect

#

@quartz kindle

quartz kindle
#

client user is not a VoiceClient object

#

you need to get the VoiceClient object

royal pumice
#

Ok

#

Let me try

#

@quartz kindle it say name voiceclient not defined

#

Any package need for it?

#

If need tell name

#

I will install

quartz kindle
#

no

#

you just need to find it

#

when you do VoiceChannel.connect()

#

the returned value is a VoiceClient object

royal pumice
#

Ok

quartz kindle
#

you can also access it through guild.voice_client

delicate shore
#

can anyone help me now well

#

I have been tryint to solve this for ages

proven lantern
#

can a message have unlimited embeds?

quartz kindle
#

i believe the limit is 10 embeds

proven lantern
#

dang

ripe prairie
#

maybe in an attempt to "bypass" message limits

#

xd

hybrid cargo
hybrid cargo
lament rock
#

all embed fields across all embeds must not exceed 6000 characters iirc

hybrid cargo
#

yup

#

normal message 2k and for embeds 6k across all the embeds in the same message

proven lantern
#

anyone see why this isn't working? i'm getting a 404 error

sage bobcat
#

One message removed from a suspended account.

proven lantern
#

it does exist

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

proven lantern
#

i made it

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

proven lantern
sage bobcat
#

One message removed from a suspended account.

proven lantern
sage bobcat
#

One message removed from a suspended account.

proven lantern
#

i'm using the id returned from this call

#

how is it malformed? that is just the path part of the url

sage bobcat
#

One message removed from a suspended account.

proven lantern
#

maybe it exists but they just cant find it

#

oh, do i need to use the same token from the original request?

#

that's wouldn't be good because the token expires after 15 minutes

earnest phoenix
#

Hi

#

I,m not Speak English

#

Poke two Abe?

fossil furnace
#

How to see my bot vote link?

proven lantern
#

dang

#

this will do it

fossil furnace
#

Where to coding the bot?

wheat mesa
#

Huh

proven lantern
#
const x = {abc:123, def:456}
const {abc, ...y} = x; // const {["abc"], ...y} = x; ???
console.log(y)```
is it possible to do this destructing with a dynamic value passed in?
#
const x = {abc:123, def:456};
const {["abc"]:z, ...y} = x;
console.log(y)
#

figured it out

earnest phoenix
#

is it possible to use the http interactions endpoint to host a bot on vercel? ikr bad idea but what goes in trying

earnest phoenix
#

noice

#

time to do some hackery

proven lantern
# earnest phoenix time to do some hackery

isAuthorized

const isValidSig = require("./isValidSig");
const keyMap = {
    "APPLICATION ID": "PUBLIC KEY"
}
module.exports = (req) => {
    const signature = req.headers["x-signature-ed25519"];
    const timestamp = req.headers["x-signature-timestamp"];
    if (!signature || !timestamp) {
        return false;
    }
    const key = keyMap[req.body.application_id];
    return isValidSig(key, JSON.stringify(req.body), timestamp, signature);
}

isValidSig

const {createPublicKey, verify} = require("crypto");

const isValidSig = (key, body, timestamp, signature) => {
    const keyDer = createPublicKey({
        key: Buffer.concat([Buffer.from("MCowBQYDK2VwAyEA", 'base64'), Buffer.from(key, "hex")]),
        format: 'der',
        type: 'spki'
    });

    const data = Buffer.from(timestamp + body);
    const sig = Buffer.from(signature, "hex");
    return verify(null, data, keyDer, sig);
}
module.exports = isValidSig;```
#

that might help

earnest phoenix
#

ok

proven lantern
earnest phoenix
#

I'm going to be using nextjs kek

#

aka express trial version

proven lantern
#

use export default instead of module.exports =

earnest phoenix
#

yup

proven lantern
#

Tim helped me with the authorization part

#

that was tricky stuff

#
    const keyDer = createPublicKey({
        key: Buffer.concat([Buffer.from("MCowBQYDK2VwAyEA", 'base64'), Buffer.from(key, "hex")]),
        format: 'der',
        type: 'spki'
    });
#

oof

#

why discord

earnest phoenix
#

if only the discord docs weren't written in the worst language the universe has ever seen

aka python

proven lantern
#

python is decent

#

almost as good as js

earnest phoenix
#

forced indentation sums it up

proven lantern
#

yeah

#

that's a mistake

#
    if (!isAuthorized(req)) {
        return res.status(401).send();
    }
    if (req.body.type === 1) {
        return res.json({type: 1});
    }```
#

you need these two conditions to get the webhook setup

earnest phoenix
#

the interpreter benefits from not having to parse extra {} but it makes it less human readable, especially with word wrap

proven lantern
#

application languages shouldn't worry about small optimizations like that

surreal sage
#

I have this script (kind of command manager but for redirects) and I want to make a script if it couldn't find anything with the same 'file.name'.
Is this possible and how would I have to do that?
Thanks in advance

surreal sage
#

Nevermind

loud tree
#

Can anyone tell me, How can I add Elements in the list so they are linked to each other, I mean

marks = int(input("Enter Marks")```

Now if I enter name = john & marks = 78, I want that when I lookup for John, his marks should appear
#

like - list = ["name" : marks]

slender thistle
#

Dictionaries

#

Or class instances

hybrid cargo
#

Do you have guild member intent specified?

#

Also make sure to turn on the member intents in developer portal

pearl trail
#

i don't think member mention requires guild member intent

eternal osprey
#

hey, i tried html scraping this website

#

but it sadly does not work at all:

#
ar fetchUrl = require("fetch").fetchUrl;
const cheerio = require('cheerio');
fetchUrl('https://www.solanadrops.art/', function(error, meta, body){
let result = body.toString()

const $ = cheerio.load(result);
let m = $.html()
console.log(m)

})
#

it just logs me its hummingbird cache file

earnest phoenix
#

WHAT THE FUCK IS THAT CSS

eternal osprey
#

ya look at that site

#

i am trying to scrape that fokcing site but it seems like they are hiding their info

earnest phoenix
#

bad design has its advantages ¯_(ツ)_/¯

eternal osprey
#

yeah i hope someone can help me with this

#

cuz it's totally fucking my ass

earnest phoenix
#

read that again

eternal osprey
#

what

earnest phoenix
#

Is it possible to run top.gg related servercount stuff when your using a discord.py fork? I'm using Disnake and running into some issues

Like this issue

ModuleNotFoundError: No module named 'discord.ext.commands.bot'```
earnest phoenix
#

Oops

earnest phoenix
#

But yeah, you can totally make raw requests yourself

#

Oh okay

drifting wedge
#

Ok so In nginx

#

Is there a way to add a subdomain as a proxy pass?

#

To another application?

#

Or the same even

#

What I'm asking is, HOW DO I CREATE A SUBDOMAIN

quartz kindle
#

subdomains are created in your registrar's dns settings

#

were you bought the domain

#

or the thing that manages your domain

drifting wedge
#

Oh I figured it out, thanks

#

Yeah I have to add the record

hybrid cargo
#

Cuz the member is not cached

#

and without the intent being turned on, i dont think your bot will get the member cache upon starting up

#

if u use .users it would work perfectly fine without the member intent

#

afaik that is the problem

#

remember user object wont contain many properties which a member object does, like the nicknames, member's roles and stuffs

lament rock
#

use first()?.id

hybrid cargo
#

guess you did not specify a mention?

royal pawn
#
@bot.command()
@commands.has_permissions(administrator=True)
async def gcreate(ctx):
    giveaway_questions = ['Which channel will I host the giveaway in?', 'What is the prize?', 'How long should the giveaway run for (in seconds)?\n**Note:** 1hr = 3600s | 1day = 86,400s | 1week = 604,800s',]
    giveaway_answers = []

    def check(m):
        return m.author == ctx.author and m.channel == ctx.channel

    for question in giveaway_questions:
        await ctx.send(question)
        try:
            message = await bot.wait_for('message', timeout= 30.0, check= check)
        except asyncio.TimeoutError:
            await ctx.send('You didn\'t answer in time.  Please try again and be sure to send your answer within 30 seconds of the question.')
            return
        else:
            giveaway_answers.append(message.content)

    try:
        c_id = int(giveaway_answers[0][2:-1])
    except:
        await ctx.send(f'You failed to mention the channel correctly.  Please do it like this: {ctx.channel.mention}')
        return

    channel = bot.get_channel(c_id)
    prize = str(giveaway_answers[1])
    time = int(giveaway_answers[2])

    await ctx.send(f'The giveaway for {prize} will begin shortly.\nPlease direct your attention to {channel.mention}, this giveaway will end in {time} seconds.')

    give = discord.Embed(title=f'{prize}', description=f'React with 🎉 to enter!\n Ends: {round(time/60/60/24)} Days!\nHosted by: {ctx.author.mention}', color = 0x37b2cb, timestamp=datetime.datetime.utcnow())
    give.set_footer(text = f'Winners: 1 | Hosted at')
    my_message = await channel.send(f":tada: **GIVEAWAY** :tada:", embed = give)``` 
How to make time in `<t:{}:R>` - Discord Epoch format?
hybrid cargo
#

did you turn your intents on?

lament rock
royal pawn
lament rock
#

sorry. I responded in js when you're python

hybrid cargo
#

💀

royal pawn
lament rock
#

idk py

royal pawn
lament rock
#

just whatever method it is to floor a float to an int

hybrid cargo
#

then im sure there is something else wrong, try to console log message.mentions and see what it is

chilly meteor
royal pawn
hybrid cargo
lament rock
#

the time format just has to be the current date represented as seconds as an integer.

hybrid cargo
#

well members is null idk if that's supposed to happen

lament rock
#

Usually, its represented as ms which would mean you'd have to floor it since dividing by 1000 could return a float

hybrid cargo
#

lol

#

show your client instance

chilly meteor
hybrid cargo
#

like where you create your client

hybrid cargo
#

Or i could be wrong

chilly meteor
#

Damn I forgot about Clicky's beach lol

hybrid cargo
#

wait, @carmine topaz are you running the command in the bot's dms by any chance?

chilly meteor
hybrid cargo
#

weird

chilly meteor
hybrid cargo
#

members return null only if the message object doesnt have a guild

#

this is really weird pikaconfused

wheat mesa
#

Guild members intent maybe? Idrk

delicate shore
#

hey guys

#

how can I scrape Youtube's HTML page?

#

I have the Query Selector's ID

#

I want to get the value

solemn latch
#

py?

delicate shore
#

js

pale vessel
#

If you're using Node you could use jQuery/Cheerio

delicate shore
#

I am using vanilla js

pale vessel
#

Ah

#

Query selectors?

#

I mean document.querySelector()

#

You can fetch the HTML using fetch and parse the result using DOMParser

delicate shore
#
      const likeLabel = document.querySelector(selector)
const value = likeLabel.text // ?
#

i am confused about the const value

pale vessel
#

innerText

#

If youu want text

delicate shore
#

oh okay

#

thanks

pale vessel
#

Otherwise innerHTML

slow terrace
#
          const fetchedLogs = await oldChannel.guild.fetchAuditLogs({
            limit: 1,
            type: 'CHANNEL_UPDATE',
        });
        // Since there's only 1 audit log entry in this collection, grab the first one
        const channelLog = fetchedLogs.entries.first();

        const { executor, type, id, name } = channelLog;

how to get the permissions that changed

pale vessel
#

Log channelLog and see the available properties

delicate shore
#

hey guys

pale vessel
#

Or well, check the documentation

slow terrace
delicate shore
#
<yt-formatted-string id="text" class="style-scope ytd-toggle-button-renderer style-text" aria-label="71,725 likes">71K</yt-formatted-string>
#

this is html for

#

like count

delicate shore
#

what is the query selector here, can I get it by using class as the query selector

pale vessel
#

Should be in changes

pale vessel
#

Otherwise, I have no idea

delicate shore
#

oh okay

#

thanks

#

for dislikes I am using ``` ytd-menu-renderer.ytd-video-primary-info-renderer > div > :nth-child(2) yt-formatted-string;

#

which surprisingly worked

#

I found this on the internet

pale vessel
#

Ah lol

#

Then use document.querySelector("ytd-menu-renderer.ytd-video-primary-info-renderer > div > :nth-child(1) yt-formatted-string").innerText;

#

Works for me

#

Just pick the previous child which is the like count

delicate shore
#

thanks!

earnest phoenix
#

Error

main trench
#

Description doesn't have 2 values like that

#

Oh wait

#

Read wrong

#

Timestamp doesn't have custom stuff like that iirc

quartz kindle
#

shouldnt there be a new line between member_count and discord.Embed?

#

or is that bugged?

main trench
#

Py probably logged it weird

quartz kindle
#

thats the only thing that would be invalid syntax

#

the rest is runtime

main trench
#

Oh he put DateTime twice?

#

Unless it's supposed to be like that

quartz kindle
#

that still wouldnt throw invalid syntax

main trench
#

Strange

tardy hornet
#

the slash command also can be used without the permission when invited?

lyric mountain
#

The permission is useless for a bot

#

You just need the intent

earnest phoenix
#
client.on("messageCreate", async msg => {
    if(msg.content === "!ping") {
        bot.commands.others.ping({
            client: client,
            type: msg,
            content: 'hello'
        })
    }
})
#

I wanna make this object is optional

golden path
#

wait

#

nvm

quartz kindle
# earnest phoenix

you are trying to use object destructuring for function parameters, i suggest you research a bit how they work

green kestrel
#

meh my joke was ruined by formatting

quartz kindle
green kestrel
#

lol

celest birch
#

I

sturdy dock
#

Is there a way to check scopes the bot currently has in a guild?

#

Want to send a message to reauthorize if the bot cannot show its slash commands in a guild and that seems like the easiest (if possible) way

lament rock
#

Not that I know of

sturdy dock
#

Hmm

#

So after discord forces message intents my bot won't function in any servers unless someone manually reauthorizes it w/ the command scope?

#

Is my understanding but I might be wrong

stray seal
#

My friend passed away last week and I want to carry his code with me. How do i add a Status to this code for my bot (like DND or Idle or Streaming):

const config = require('../config.json');
const chalk = require("chalk");
module.exports = (client) => {
    console.log(chalk.magenta.bold(`✅ Ready As the Bot: ${client.user.tag}\n📃 CHANNELS THE BOT IS IN: ${client.channels.cache.size}\n📅 SERVERS THE BOT IS IN: ${client.guilds.cache.size}\n👤 TOTAL USERS DETECTED FROM BOT: ${client.users.cache.size}`));
    client.user.setActivity(`${config.prefix}help ¦ Loading Backups In: ${client.guilds.cache.size} servers For ${client.channels.cache.size} channels!`); 
};
fresh bluff
#

Can someone help me again im getting this error

split hazel
#

basically

#

your code is not good

fresh bluff
split hazel
#

you can start by showing us your code

stray seal
fresh bluff
#

@split hazel

#

It’s in different parts for some reason lol

stray seal
#

It is fuzzy

fresh bluff
#

Click the dam photo

split hazel
#

if i remember correctly it might take a while for the status to visually update

stray seal
#

So like this?

const config = require('../config.json');
const chalk = require("chalk");
module.exports = (client) => {
    console.log(chalk.magenta.bold(`✅ Ready As the Bot: ${client.user.tag}\n📃 CHANNELS THE BOT IS IN: ${client.channels.cache.size}\n📅 SERVERS THE BOT IS IN: ${client.guilds.cache.size}\n👤 TOTAL USERS DETECTED FROM BOT: ${client.users.cache.size}`));
    client.user.setActivity(`${config.prefix}help ¦ Loading Backups In: ${client.guilds.cache.size} servers For ${client.channels.cache.size} channels!`); 
    client.user.setStatus('dnd');
};
split hazel
#

yep

stray seal
#

Thanks!

split hazel
fresh bluff
#

Wth is my bot having this issue I used this exact code before and did not get this error

split hazel
#

because i can easily plop it inside of an ide instead of trying to find the exact colon you missed for example

stray seal
split hazel
#

well online

stray seal
#

Not DND or whatever?

split hazel
#

you dont see many bots with statuses other than online

fresh bluff
#

@split hazel how do i send my hastebin code?

split hazel
#

copy the link and paste it here

#

it should save

#

there should also be a save icon on the top right

spark flint
#

just view it there instead

fresh bluff
split hazel
#

lmao

#

that is a violation on a personal level

#

anyways

spark flint
fresh bluff
#

@spark flint HOW DID YOU GET THAT?

stray seal
#

lol

spark flint
#

you left it in a ss

stray seal
#

BHWHAHAHA

#

REPLIT NOOB MISTAKE

fresh bluff
spark flint
#

at least it uses .env BH_shrug

fresh bluff
#

Im a idiot

split hazel
#

that is gold

fresh bluff
#

I protect all tokens with envs

split hazel
#

you missed quite a bit of colons

spark flint
#

fun fact: their friends Gocrix#1989 and Lighting Sploits I Utilities#6140

fresh bluff
split hazel
#

you havent set an interval here

#

what should the interval be

#

like what time delay between each interval

fresh bluff
#

Uhh

split hazel
#

i set it to 20 seconds for now

#

actually 60

spark flint
split hazel
#

nice

fresh bluff
split hazel
spark flint
#

not your friends code

split hazel
#

main reason why im sending it whole back is because i beautified it

fresh bluff
split hazel
#

i think you just destroyed a friendship

fresh bluff
#

I HATE HIM

split hazel
#

@spark flinti think you should keep quiet about forks next time

spark flint
#

true, my bad

#

it was all an illusion

#

the code is your friends

#

@fresh bluff what is your friends replit name

fresh bluff
#

I can’t say bc I forgot

spark flint
#

ok

fresh bluff
#

We haven’t talked in a while

stray seal
#

@fresh bluff You are Lying.

#

If you summit this to top.gg, then you will be denied because of it being Forked.

fresh bluff
#

@stray seal how am I lying

stray seal
#

Next Time, try to hide the GitHubs :D

split hazel
#

lmao what have we started

stray seal
#

@covert gale did you make Hycord? xD

spark flint
#

also ithundxr:

fresh bluff
#

LEAVE MY FUCKING CODE KNOW @spark flint AND @split hazel AND @stray seal

spark flint
#

christ

quartz kindle
#

Lol

spark flint
#

tw rblx: asks for help

us: gives help

him: LEAVE MY FUCKING CODE

stray seal
#

xD

split hazel
#

i only fixed, beautified it and sent it back

stray seal
#

He just mad that he got caught

split hazel
#

lol

stray seal
#

Is anyone good with using Watchbot? I need some help...

delicate zephyr
#

@quartz kindle yo tim, you messed with slash commands much? nvm I figured it out

stray seal
#

What are some good Free Domain Places?

lyric mountain
#

choose one
1 - good
2 - free

solemn latch
lyric mountain
#

but neither is both KEKW

solemn latch
#

ssl certs are free anyway 👀

spark flint
#

yeah

#

not really

#

lets encrypt is great

#

and easy

solemn latch
#

these days scripts do them in a line of code

spark flint
#

i host sites for free and ssl is automatic

#

and adding manual is easy af

#

my hosting provider?

solemn latch
#

any decent host these days

spark flint
#

^

#

literally 2 steps

quaint wasp
#

why is it not being defined..

#

oh

#

thanks

quartz kindle
#

Discord does not exist inside discord.js

#

thats why { Discord } = require("discord.js") is undefined

#

because thats the same as doing require("discord.js").Discord

quaint wasp
#

oh

#

thanks

errant perch
#

anyway to send a message with just buttons

hybrid cargo
errant perch
#

ok thanks

short pilot
#

is there a way to send a new webhook url automatically from my bot? pepe_thinking

solemn latch
#

Like creating a discord webhook from your bot?

earnest phoenix
#

Can we also do gif manipulation in pillow ?

earnest phoenix
fresh bluff
eternal osprey
#

why is this happening when i am trying to input my unicode character of 👾

#

that whole focking unicode is not fitting for some reason

#

almost all emojis have a five lettered unicoe

#

how can i ever use them then?

#

not a possibility as my vps encodes all emojis to ??

#

as i am using winscp, which uses a ddifferent encoding type

eternal osprey
#

no my cleint converts everything to ??

tulip marsh
#

hey is it possible that when someone vote the bot it give him voter role automatically and after 24 it removes it till the time he votes back

solemn latch
tulip marsh
#

tho i have read multiple time each and every line but nothing got in my mind

earnest phoenix
#

hm?

slender wagon
#

can an interaction fetch messages on a channel?

slender wagon
#

how doe

feral aspen
#

What do you mean, how doe?

slender wagon
#

how

feral aspen
#

There's no How?

#

You need to fetch the message once the interaction/slash command is run.

slender wagon
#

not that

feral aspen
slender wagon
#
client.channels.cache.get(channelid).fetchMessage(messageid)```
#

i want to do something similar to this but inside an interaction

feral aspen
slender wagon
#

mhm

#

slash commands

feral aspen
slender wagon
#

i thought u meant smthng else but anyway

#

man this d.js v13 is literally a pain

feral aspen
slender wagon
#

ii thought u meant to like fetch the message that me as an author just sent to trigger the slash command

#

but what i am trying to do is

#

inside the slash command which is on a command handler

#

get a id of a message and fetch the message

#

in this case it's a bot that gets a message u send and embeds it

#

with message collections

#

for example

#

/slashcommand embed 911982832518307840

feral aspen
#

Well, the method of FetchMessage() can only be used in the Webhook class and not in the Message class; you could use the fetch() method, instead.
According to your code, you could do the following and achieve the following result.

await client.channels.cache.get(channelid).messages.fetch(messageid); // Returns the "Message" class.
slender wagon
#

client isn't defined inside this thing and idek how to

pale vessel
#

interaction.client

slender wagon
#

OH

feral aspen
pale vessel
#

Or if you want to use the current channel, why not interaction.channel.messages.fetch(id)?

slender wagon
#
async execute(interaction, client) {
#

i used to do this

feral aspen
slender wagon
feral aspen
feral aspen
#

You should use it, interaction is defined.

pale vessel
#

No, it's "used"

#

🤨

feral aspen
#

Used is past tense. 😂

#

.. so kinda a bye-bye.

slender wagon
#

yeah used it on the past

pale vessel
#

...what

slender wagon
#

now using the new one

feral aspen
slender wagon
#

L

feral aspen
pale vessel
#

Yeah I dunno what's wrong with him

slender wagon
#

hold onnn

pale vessel
#

How do you know which channel it should fetch the message from?

slender wagon
#

i use hardcoded message id just for testing

#

can the bot fetch that

feral aspen
slender wagon
#

if not that might be why i keep on getting errors

pale vessel
#

It needs to know which channel the message was from

#

Otherwise you have to rely on cache

slender wagon
pale vessel
#

What are you going to do with just the channel ID?

slender wagon
#

so it's supposed to be the message

feral aspen
#

.messages, yes.

slender wagon
#

it logs a big list of messages

feral aspen
#

You refer to the Message object, correct?

slender wagon
feral aspen
slender wagon
#

using ```js
interaction.channels.cache.get

#

also here is how interaction is created on the main file

#
client.on('interactionCreate', async (interaction) => {
    if (!interaction.isCommand()) return;
    const command = client.commands.get(interaction.commandName);
    if (!command) return;
    try {
        await command.execute(interaction);
    } catch (error) {
        if (error) console.error(error);
        await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
    }
});
pale vessel
#

client =/= interaction

slender wagon
#

i think channels is not a thing

slender wagon
#

that's what is fucking up my brain

pale vessel
#

Every structure generated by the client has the client property

slender wagon
#
    console.log(await interaction.client.channels.cache.get(751178350945280091).messages.fetch(911984533635785468))
                                                                                           ^

TypeError: Cannot read properties of undefined (reading 'messages')
pale vessel
#

Did you use number for IDs?