#development

1 messages · Page 1616 of 1

earnest phoenix
#

message.send is not a function

#

wtf

ornate otter
#

do message.channel.send

eternal osprey
#

or just do message.channel.send

#

show your code

#

maybe i can help

ornate otter
#

its not the code,

#

the code is good

#

the event either isn't being emitted or received

slender thistle
#

Does it not work for one specific guild or completely?

#

Can you show your code? Are you sure there aren't any errors happening?

ornate otter
#

I mean i cant show it all but here

#
    if(member.guild.id !== botConfig.internal.main_guild) return;
    console.log(member)```
#

no errors happening

#

and if i remove that if statement still nothingg logs

#

like nothing is triggering the event at all

slender thistle
#

Did you allow the server members intent on Discord developer portal? Can you show how you're applying intents to your client?

ornate otter
#

yes

#

its allowed

#

anddddd, second part i dont understand

slender thistle
#

Show how you are creating your bot object

#

or however you do intents in d.js

ornate otter
#

const bot = new Discord.Client()

#

how i've always done it

pale vessel
#

Try explicitly specifying the intents

slender thistle
#

How the fuck do you set intents in d.js

ornate otter
#

shiv

#

i never have

#

and it worked in the past

#

and flaze, i tried it earlier and it didnt work

pale vessel
#

new Client({ ws: { intents: <array of intents or bitfield> } });

ornate otter
#

actually it still works

#

on my other bot

#

my main bot it works without me setting the intents

slender thistle
#

oh it's in websocket options

ornate otter
#

?

slender thistle
#

Well shrug there must be a reason why the event isn't fired

pale vessel
#

imagine intents=intents smh

eternal osprey
#

is it me or is the sound quality of rythm really bad?

#

Literally, even my shitbot sounds better.

slender thistle
#

Bro discord.Client(intents=discord.Intents.all()) ftw

modest maple
#

rythm massively cuts back their bandwidth

eternal osprey
ornate otter
#

so no one knows how to help?

pale vessel
#

hm

ornate otter
#

like my main bot uses the same thing and works flawlessly

pale vessel
ornate otter
#
  ws: {
    intents: [
      "GUILDS",
      "GUILD_MESSAGES",
      "GUILD_MEMBERS",
      "GUILD_VOICE_STATES",
      "GUILD_MESSAGE_REACTIONS",
    ],
  },
});```
pale vessel
worldly heron
#

They recently changed intents to be not in as

pale vessel
#

really weird

worldly heron
#

Ws

#

On master

#

It’s just on the main options object now

pale vessel
#

aren't they using stable

worldly heron
#

I hadn’t scrolled up yet ^^

pale vessel
#

oh yeah

#

it's required too

#

i guess it uses api v8 too

ornate otter
#

soooo, what do i have to do to make this work then, or do i give up all hopes and dreams of coding and decide to work in a retail store?

worldly heron
#

But then you’d have to deal with,,,, people

ornate otter
#

true

pale vessel
ornate otter
#

Oki doki

#

this can only go bad and get me told off

#

but here we go

earnest phoenix
#

let vartest = client.cool["action"].get(guild.id).get("lastaction"); console.log(vartest)
it returns nothing

#

action: Map { '757210469563105381' => Map { 'lastaction' => [Array], 'time' => 1, 'count' => 1 } },
this is the full map

pale vessel
#

very cursed

river panther
#

how do i make the bot only show the first 20 roles?

earnest phoenix
#
(node:23761) UnhandledPromiseRejectionWarning: TypeError: msg.delete is not a function
at Object.execute (/app/Commands/Fun/qrcode.js:25:14)
at module.exports (/app/Events/Messages/message.js:38:11)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:23761) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 11)
(node:23761) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message
    at RequestHandler.execute (/app/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async RequestHandler.push (/app/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
(node:23761) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 12)
river panther
#

ergh

earnest phoenix
#
const { Discord, MessageEmbed } = require('discord.js');
const { deletionTimeout } = require('../../config.json');

module.exports = {
  name: 'qrcode',
  description: "Crée un qrcode pour un texte.",
  usage: "qrcode (texte)",
    execute(message, args, settings) {
      // Get text for QR encoding (including file URl)
        let text = args.join(' ');
        if (!text) text = message.guild.GetImage(message, args, settings.Language);

        // send 'waiting' message
        const msg = message.channel.send(settings.Language, 'IMAGE/GENERATING_IMAGE');

        // Try and convert image
        try {
            // send image in embed
            const embed = new MessageEmbed()
                .setImage(`https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=${text.replace(new RegExp(' ', 'g'), '%20')}`);
            msg.delete();
            message.channel.send(embed);
        } catch(err) {
            // if error has occured
            msg.delete();
            message.error(settings.Language, 'ERROR_MESSAGE').then(m => m.delete({ timeout: 5000 }));
        }
    }
};
river panther
#

mine went up

earnest phoenix
#

I don't see the problem

#

:/

river panther
pale vessel
river panther
#

the one sent by the user?

river panther
earnest phoenix
river panther
#

await

#

should be there

#
 const msg = await message.channel.send(settings.Language, 'IMAGE/GENERATING_IMAGE');
#

@earnest phoenix

#

this should be correct

earnest phoenix
#

const msg = await message.channel.send(settings.Language, 'IMAGE/GENERATING_IMAGE');
^^^^^
SyntaxError: await is only valid in async function

#

:/

river panther
#

put it in async function

#

i am dming you the correct code

#

done

#

sent

pale vessel
slender thistle
#

I can feel flaze's disappointment

boreal iron
#

physical pain? KEKW

slender thistle
#

Pretty much

ornate otter
#

so

#

my lesson is done,

#

any ideas on how to fix it yet

pale vessel
#

atTim

#

What discord.js version by the way?

limber flume
earnest phoenix
#
(node:5697) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined
at Object.execute (/app/Commands/Moderation/snipe.js:10:31)
at module.exports (/app/Events/Messages/message.js:38:11)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:5697) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:5697) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
#

I have the problem

#
const Discord = require("discord.js")
const db = require("quick.db")

module.exports = {
  name: 'snipe',
  description: "Donne le dernier message supprimé du channel.",
  usage: "snipe",
  async execute(message, args, client) {
    
    const msg = client.snipes.get(message.channel.id)
    if(!msg) return message.channel.send("❌ Il n'y a rien à snipe !")
    const embed = new Discord.MessageEmbed()
    .setAuthor(msg.author)
    .setDescription(msg.content)
    if(msg.image)embed
    .setImage(msg.image)
    .setColor("00FFFF")
    .setTimestamp();
    
    message.channel.send(embed)
   
    
  }
}
#

My code: ⬆️

copper cradle
#

client.snipes is undefined

earnest phoenix
#

its with discord.js no?

copper cradle
#

oml

ornate otter
copper cradle
#

where did you define the snipes map?

earnest phoenix
#

wait

marsh oar
#

Hello, I would like to know how to comment on incorporating his website in the description of his bot

earnest phoenix
#

@copper cradle in async execute no?

copper cradle
#

🤦

#

where in your code did you define client.snipes

#

for example

copper cradle
#

let's say you got a listener somewhere that listens for deleted messages, when a message is deleted then you store it's content and id on the <client>.snipes map

#

where in your code did you do something along those lines

earnest phoenix
#

I don't do this :/

marsh oar
copper cradle
#

so you never defined a snipes map

#

then what did you expect to happen by trying to call get on something that's undefined

#

where did you get that code from

earnest phoenix
#

oh, but how can I define this?

#

to a friend

copper cradle
#

then ask your friend how they did it

#

I could help but I just woke up and need to get some breakfast

#

I'll be back in like 1Hr

earnest phoenix
#

oki

#

I go to school too

river panther
river panther
#

imagine a regular member helping a bot developer

copper cradle
#

you'd be surprised to what "bot devs" ask here

river panther
#

mhm

river panther
lyric mountain
copper cradle
river panther
#

oh wait

#

for who was that message?

lyric mountain
#

you

river panther
#

how?

lyric mountain
#

definition of spoonfeeding

river panther
#

oh, i explained the mistake

#

explain 999

river panther
lyric mountain
#

then word it better

#

"I am dming you to explain how to solve"

#

"do i explain how to make a code for snipe?"

#

the way you worded sounded like you were sending paste-ready code

river panther
#

nah

#

ofc not

river panther
#

and sent it to him

#

and then still he got an error

#

he was doing await in asyncn't

stuck pike
#

Wtf

nimble kiln
#

$3000 a week in bitcoin mining? LMAO thanks for the laugh

stuck pike
#

Yea

river panther
#

first you tell, why do astronauts use linux in space?

#

if you answer it correctly, then i will ask you how

cinder patio
#

@scenic kelp ads

#

I guess?

stuck pike
#

Yea

modest maple
#

can we do somthing about that dude

#

its the only messages he's sent

stuck pike
#

Lmao

modest maple
#

its just for a bitcoin scam mmLol

stuck pike
#

Yea

slender thistle
#

How's he not banned yet

river panther
#

ig he got betrayed by a girl who liked bitcoins

stuck pike
river panther
#

or her crush trades bitcoins

rustic nova
river panther
#

or is a miner of bitcoins

stuck pike
#

Great story

river panther
#

ofc

modest maple
stuck pike
#

Must make a story on it

scenic kelp
#

-b @nova otter ads in every channel

gilded plankBOT
#

dblMod Banned henry.michael#7573 (@nova otter)

river panther
rustic nova
#

parm yeeted alre

#

oh nvm

stuck pike
#

Hello prime minister

rustic nova
river panther
#

you could have made it sound better

scenic kelp
#

bye 👋

stuck pike
river panther
#

aww

river panther
#

will miss you

#

;-;

stuck pike
#

Lmao

#

Now who give us mining tips

river panther
#

;-;

stuck pike
nimble kiln
river panther
#

bruh

stuck pike
river panther
#

mine oil

#

oh no

stuck pike
#

Good idea tho

river panther
#

american will come

stuck pike
#

Lol

river panther
#

guys, i need to become fit, but its very boring

#

do you have any food which might help?

lyric mountain
#

coke ig

#

jk

river panther
#

no, it sugar

#

ye

#

coke: 50% sugar, 50% piss

lyric mountain
#

I didn't mean that kind of coke...

earnest phoenix
#

is anyone able to offer me some assistance with discord js if they dont mind? >.< i've hit a brick wall and am noob...

ornate otter
#

whats the brick wall

earnest phoenix
#

ive made an embed that posts when a command is typed in a channel (basic i know) but im struggling trying to get it to post automatically in a public channel when a private channel receives a message from a webhook and im not sure where i need to add the 'if' function (if thats even right) and basically say if this channel receives a message, send the embed in this channel >.< @ornate otter

#

ive tried stackoverflow/youtube/github for ideas but not having much luck

misty sigil
#

then if it is

mild flower
#

whenever i try to await reactions asynchronously using the .then statement it doesnt seem to work?

misty sigil
#

get the channel from cache
client.channels.cache.get("the id of the channel you’re sending to")

#

then send to it using .send() on the .cache.get() thing

earnest phoenix
#

ooo will give it a go!! tyvm

misty sigil
#

np

pale vessel
smoky herald
#

is there a way to see all reviews as the bot owner?

#

I'd love to know what are people unsatisfied with P_pepeHmm

earnest phoenix
#

is this right @misty sigil ?

    if (message.channel.id === '809759051919523860') {  

client.channels.cache.get("809508561918230559")

      const embed = new MessageEmbed()
            .setColor(16763136)
            .setThumbnail('thumbnailurl')
            .setDescription("choo choooooo")
            .setTitle(`🚂 TRAIN COMING THROUGH!`)
    
        message.channel.send(embed);
    }```
misty sigil
#

almost

earnest phoenix
#

darn

#

im getting there hahaha

misty sigil
#

you can do const channel = client.channels.cache.get("the ID")

#

and then at the bottom

#

channel.send()

pale vessel
#

i feel like only Tim can help you now

earnest phoenix
feral skiff
#

Can I like reward people for voting for my bot?

river panther
rustic nova
#

tim is the saviour in development

ornate otter
#

@quartz kindle almighty tim, we having big issues

mild flower
#
const msg = message.channel.send(Econfirm)
        msg.react(':white_check_mark:')```

It shows msg.react is not a function
pale vessel
#

await

#

const msg = await message.channel.send(Econfirm)

boreal iron
#

Or using .then()

umbral zealot
dusky harness
#

I'm writing a bot for myself what do I have to do to set its prefix

umbral zealot
#

Do you want one global prefix or do you want each guild to have its own?

#

@dusky harness stick to this channel, and answer my question 😉

viral mortar
#

to be yours?

#

like your bots?

umbral zealot
#

that... doesn't really answer the question

viral mortar
#

yeah...

umbral zealot
#

Same for everyone, or different one per guild?
Please choose one of the 2 choices above

dusky harness
#

I know Turkish, so I'm a little late

misty sigil
#

what about both evie

umbral zealot
#

Take your time!

dusky harness
#

same for everyone

umbral zealot
umbral zealot
misty sigil
#

lua

dusky harness
#

atom

viral mortar
#

O_O

#

lol

umbral zealot
viral mortar
#

gl with that

umbral zealot
#

Javascript
Python

dusky harness
#

I'm writing from atom

misty sigil
#

in what language tho

crimson vapor
umbral zealot
#

That's your EDITOR, not your language

slender thistle
#

@dusky harness Can you send a screenshot of your code?

river panther
#

yes

viral mortar
#

not c+, -b

#

lmaooo

umbral zealot
#

I bet this is discord.js but we'll know in a second.

misty sigil
#

c#? sorry bro i only know b♭

quartz kindle
slender thistle
#

You never know

quartz kindle
#

:^)

slender thistle
#

Then God help their soul

#

I'll be praying in my corner

lyric mountain
#

js

quartz kindle
#

discord.io is still one of the first results if you google how to make a discord bot

lyric mountain
#

wait

#

@dusky harness token leak maybe?

crimson vapor
#

nah

quartz kindle
#

partial

crimson vapor
#

can't see most of it

umbral zealot
#

it's missing enough characters it's fine

quartz kindle
#

anyway what is the problem?

crimson vapor
#

all you need is one missing letter

#

in reality

dusky harness
lyric mountain
umbral zealot
crimson vapor
#

I thought the first part was

lyric mountain
#

oh, nvm then

ornate otter
quartz kindle
#

ye first part should be the timestamp

river panther
#

AHAHAHA, YOU LEAKED YOUR TOKEN

ornate otter
#

long story

dusky harness
#

thank you so much

river panther
#

go change the token

#

fast

umbral zealot
river panther
#

someone will hack

quartz kindle
#

its not the full token

river panther
#

oh no

#

=c

dusky harness
#

Türkçe konuşan var mı

lyric mountain
#

chill down bruh

river panther
#

bruh

dusky harness
#

Does anybody speak Turkish

umbral zealot
#

The token's first part is a timestamp, then the ID, and only the last part is the "password". Removing like 4-5 characters from the end is enough to make a token completely unuseable.

umbral zealot
ornate otter
#

Tim, basically, my event isnt working, client.on('guildMemberAdd') just isnt actually being called, me and shiv and flaze aren't able to work out why

umbral zealot
#

But most of the programming world is english so you might as well practice.

lyric mountain
umbral zealot
ornate otter
#

Yes

mild flower
#

how do we add the time the embed was sent in the footer of the embed?

ornate otter
#

It is, flaze and shiv have already been through this

ornate otter
#

but it still no wanna play ball

mild flower
#

ahk

quartz kindle
river panther
#

wait, is tim the man, the legend, the god?

ornate otter
#

why you gotta make this so difficult, but, ill try it

river panther
#

the best in discord.js

crimson vapor
#

tim is helping you debug kekw

river panther
#

bruh, everyone says tim is the best

crimson vapor
#

if that fires there is another issue

misty sigil
crimson vapor
#

if it doesn't, there is an issue with intents

misty sigil
ornate otter
#

yeah, nothing tim

quartz kindle
#

do you have server members enabled in the dev portal?

#

are you using discord.js stable or master?

ornate otter
#

It should be

#

i've been told that it is

crimson vapor
#

check bro

#

ezpz

ornate otter
#

and idk

quartz kindle
#

"you've been told"...?

ornate otter
#

i cantttt its not my bottt, im just the dev

crimson vapor
#

that could be an issue

quartz kindle
#

show your intents

crimson vapor
#

run it without intents

ornate otter
#

how does one show intents

crimson vapor
#

if not getting the event, its their issue

quartz kindle
#

show client options

crimson vapor
ornate otter
#

example?

safe creek
#

so i was testing and when i got to using my unban command i got this in my terminal ```discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ValueError: not enough values to unpack (expected 2, got 1)

#

ill post my code

quartz kindle
#

client = new Discord.CLient({ // options here })

slender thistle
#

CLient :)

river panther
ornate otter
#

Yea

quartz kindle
#

the version from github

ornate otter
#

i dont do that

ornate otter
#

never have

river panther
ornate otter
#

just const bot = new Discord.Client();

quartz kindle
ornate otter
#

its always worked for me in the past

safe creek
# slender thistle Show your code
    @has_permissions(ban_members=True)
    @commands.command()
    async def unban(self, ctx, *, member):
        banned_user = await ctx.guild.bans()
        member_name, member_descriminator = member.split('#')

        for ban_entry in banned_user:
            user = ban_entry.user

            if (user.name, user.descriminator) == (member_name, member_descriminator):
                await ctx.guild.unban(user)
                await ctx.send(f'Unbanned {ctx.author.id}')
                return```
crimson vapor
#

you don't have members enabled in the panel then

slender thistle
#

okay

#

what do you pass as the member argument?

ornate otter
crimson vapor
#

ok

slender thistle
#

To rephrase my question, how are you using the command?

safe creek
#

!unban <user>

slender thistle
#

What is <user>?

quartz kindle
safe creek
#

the user you want to unban

slender thistle
#

Got an example?

ornate otter
#

Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.

quartz kindle
#

there you go

lyric mountain
#

yeah, it's disabled

quartz kindle
#

you have it disabled

ornate otter
#

Wait

#

is this for both or just one

safe creek
crimson vapor
#

one or the other

ornate otter
#

Cus i believe he only has one enabled

slender thistle
#

They shouldn't and won't

quartz kindle
#

only guild members in needed

#

not presences

ornate otter
#

Thats the one he says is enabled

slender thistle
#

The latter will because of #, the former won't because it's a mention

safe creek
#

ahh ok i see

ornate otter
#

But until he's online and sends me a screenshot i wont know for sure

river panther
#

guys, in this the bot should react to the last message with an emoji, but when the server traffic is high the bot doesn't react, what do?

module.exports = {
    name: "lol",
    description: "lol",
    category: "emoji",
    run: async (bot, message, args) => {
        let channel = message.channel;
        channel.messages.fetch({limit: 2}).then(res => {
            let lm = res.last()
            lm.react("770535724704989194");
            message.delete();
            console.log(`the reaction was in ${message.guild.name}, the user was ${message.author.username}`)
        })
    }
}
slender thistle
#

Two ways go about this

safe creek
#

mmmk

#

im all ears

slender thistle
#

Actually, maybe even three

safe creek
#

oh

#

ok

lyric mountain
#

how to solve? don't add a reaction to every single message

quartz kindle
# river panther is it better?

is not better, it just has the newest features like gateway v8, slash commands, etc. but it can be buggy or have other issues because of untested updates

ornate otter
#

ok, what do you guys actually think about slash commands

#

im not too keen on them

lyric mountain
#

superfluous

#

that what I think

quartz kindle
#

they're good for specific things

misty sigil
#

i don’t mind them but I won’t be implementing them

quartz kindle
#

i havent actually tested them tho

slender thistle
#
  1. Check for member.split("#") length. If the length is < 2, argument is invalid, don't unban anyone;
  2. Allow IDs and then straight up use .unban on a discord.Object(id=the_argument_value);
    2.1) As for mentions, logic is similar, because all you need to do is .strip() anything that's not an ID, aka <@!>.
ornate otter
#

Im curious as to how they will expect us to input our bots command list

#

whether it will be on the application site or what

safe creek
#

ty

slender thistle
#

Sure, choice is yours

#
>>> s = "@ebon shadow"
>>> s.strip("<@!>")
'123'
>>> s = "@ebon shadow"
>>> s.strip("<@!>")
'123'
safe creek
#

so does s mean user input or?

#

ive never used s or strip

misty sigil
#

s is a string

#

:p

slender thistle
#

Well, s is just a variable in my example

safe creek
#

oh

#

ahh ok

#

my bad

slender thistle
#

aka what you'd receive from member

safe creek
#

mhm

misty sigil
#

yo I’m gonna see if there are any eggs

safe creek
#

so member.strip() blah blah blah then

slender thistle
#

You got the gist of it

safe creek
#

ayy nice

#

tysm

slender thistle
#

.strip() removes all passed characters from the string and returns a modified string

crimson vapor
#

.strip is kinda cool

#

but .replace(/stuff/g, '') seems cooler

safe creek
#

i see so would it remove any special chars or?

#

lol @crimson vapor

slender thistle
#

A more verbose example would be

>>> s = "@ebon shadow"
>>> s.lstrip("<@!").rstrip(">")
'123'
#

See where I'm getting at?

safe creek
#

yes

#

i see

latent heron
#

.strip() just handles splitting of a string based off of the current text encoding you have

#

by default JS I believe does utf-8 encoding

safe creek
#

ahhh ok

#

well in this case its py

latent heron
#

so it'll just handle splitting through that

#

you can define it however to do other things like ANSI encoding and split likewise

safe creek
#

ahh ok

slender thistle
#
>>> help(str.strip)
Help on method_descriptor:

strip(self, chars=None, /)
    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.
misty sigil
#

aw

#

no eggs

safe creek
#

i see

#

tyvm @slender thistle @latent heron @crimson vapor

latent heron
slender thistle
misty sigil
#

PHP is just weird man

latent heron
#

i know

#

i major in it Sadge

quartz kindle
#

PHP is a futuristic language

misty sigil
#

not as bad as lua

crimson vapor
#

true

quartz kindle
#

instead of iterating, mapping and joining

latent heron
#

yes i agree, PHP is a "WTF" language indeed

quartz kindle
#

PHP implodes and explodes things

#

:^)

crimson vapor
#

did the creator just have a stroke when deciding what to name functions?

misty sigil
#

Sounds terrible

#

yes

quartz kindle
#

yes

crimson vapor
#

accidentally typed the wrong word

quartz kindle
#

probably also on drugs

crimson vapor
#

he was watching a WWII documentary

river panther
#

probably fought with his wife

#

.snipe

#

-snipe

#

ergh

quartz kindle
#

some functions are fn(source,destination), others are fn(destination, source)

#

for no reason

crimson vapor
#

big brain novice dev

river panther
#

yes, tim the man

crimson vapor
#

I mean he wasn't

river panther
#

the legend

#

;-;

crimson vapor
#

or isn't?

#

idk

river panther
#

wait, what bot has tim made?

#

mee6?

quartz kindle
#

nah

river panther
#

then

#

?

quartz kindle
#

my bot is small

#

only 8k guilds

river panther
#

the fuck

lament stump
river panther
#

8k

umbral zealot
#

Does it really matter what we've made? As long as we help you KEKW

latent heron
#

slight flex

lament stump
#

3 of those are mine

quartz kindle
#

lmao

river panther
#

mine is 82 servers

latent heron
#

mine is in 7 too monkaS

crimson vapor
#

I have like 76

quartz kindle
#

well, compared to mee6's millions, 8k is small

#

since you asked about mee6

river panther
#

time how to get my bot in many servers?

quartz kindle
#

xd

royal herald
#

Mine is 154

river panther
#

ig

quartz kindle
#

wat

river panther
#

nvm

viral mortar
#

wut

quartz kindle
#

godzilla had a stroke reading this

umbral zealot
#

Did you just call Mee6's mother fat?

river panther
umbral zealot
#

Yes, that question was answered. The answer was "rate limits"

river panther
#

oh when

#

oh yes

quartz kindle
#

yes

river panther
#

what can be a good programmer nickname on a server?

quartz kindle
#

a normal name

river panther
#

oh, ok

viral mortar
#

i like it

quartz kindle
#

xD

river panther
#

wait, i need to ask tim too

river panther
quartz kindle
#

because linux is better

river panther
#

no

royal herald
river panther
pale vessel
quartz kindle
#

xD

pale vessel
#

still waiting

river panther
safe creek
#

ok

river panther
#

oh wait, people, is doing dual boot safe?

pale vessel
#

too lazy to install d.js-light master branch

river panther
#

i want unbuntu and win

viral mortar
#

lmao

safe creek
river panther
#

if you have friends and life you are not a real programmer

safe creek
#

thats just true

river panther
#

having dev fends is allowed

safe creek
#

yes

#

but you must only speak about code

river panther
#

oh

safe creek
#

and argue with which lang is better

#

and code whe nyour pissed

river panther
#

do you know my potato in java was over countered

safe creek
#

and only speak in code

#

and say fuck java

#

etc

river panther
#

bruh

#

java is good

sharp thicket
#

Hi

river panther
#

i like java

safe creek
#

so many code friend rules

royal herald
#

İ forked a patato

river panther
#

chat ded

sharp thicket
lyric mountain
umbral zealot
#

could we get back to actually helping people code? Remember guys, some people are shy and won't ask their question if the chat is too active 😦

royal herald
#

Can i fork github felixthink

river panther
sharp thicket
#

Idk yet

river panther
#

yo cowards, ask your problems, don't feel shy, if you feel shy here what will you do while seks

sharp thicket
#

Guys anyone know how to make an inventory/backpack, i dont want code i just dont have enough logic on how i would store and find things like arrays or objects???

sharp thicket
#

I use mongoose btw

#

Yea ik

#

Also im using js

#

Coz i like js

lyric mountain
#

so, whats the issue?

sharp thicket
#

I dont know what to store info in

#

An array or object

lyric mountain
#

in mongoose

#

use an object

sharp thicket
#

Omg yea ik

#

But

lyric mountain
#

think like this:

sharp thicket
#

How would i find the object when it needs to be removed

sharp thicket
#

A loop?

#

Yea but mongoose returns an array of objects

#

So each object would be a profile

#

Then inside that profile would be a nested object

lyric mountain
#
{
  id: "toiletpaper",
  name: "Toilet Paper",
  properties: ["burnable"]
}
#

for example

sharp thicket
#

Ik that

lyric mountain
#

then just remove by id toiletpaper

chilly vine
#

Ola uwu

sharp thicket
#

Whats the function for that

#

Or do i need a loop

#

O wait

lyric mountain
#

findAndSomething

viral mortar
sharp thicket
#

I can use .find()?

#

So like

lyric mountain
#

get user inventory, remove item by id

sharp thicket
#

const toremove = Array.find(obj => obj.id == "toilet paper")
delete toremove

#

Would that work

lyric mountain
#

there's probably some function to do that inside mongo

sharp thicket
#

Yea ik

#

But id rather use this

#

Ty for the help

tired panther
#

you want to remove the mongodb document?

tired panther
summer torrent
river panther
#

he wasn't there 2 days ago

latent heron
#

question

#

has anyone here messed with partial Webhooks in d.py?

slender thistle
#

kinda sorta

latent heron
#

I'm confused on how to go about it

#

because I want to create a webhook but not have it bound to a channel

#

but my understanding is that you can only do that with a partial method

slender thistle
#

Ok I'm confused what you mean by partial webhooks now KEKW

slender thistle
#

oh jesus christ

latent heron
#

hm?

slender thistle
#

I forgot that's how it's done

latent heron
#

yeah i hate it

#

it's text channel bound

viral mortar
#

ig

slender thistle
#

Well, yeah, that's how webhooks are

latent heron
#

i can work around the channel part since d.py allows me to change the text channel link

#

the problem is being able to create it i think

slender thistle
#

If you want webhooks for different channels, you'll need to create multiple Webhook objects separately

viral mortar
#

yeah

latent heron
#

yeah

#

it's a constant process of deleting and creating

#

which i'm not like super angry about

viral mortar
#

you can automate it though

latent heron
#

it's feasible mhm

viral mortar
#

yeah

latent heron
#

i'm wanting to do webhooks for a specific idea of mine

#

i just don't understand how to create them

slender thistle
#

Why deleting though?

latent heron
#

i'm looking at this partial method

#

but idk what the ID part is to be

slender thistle
#

Sec

latent heron
#

1 overall webhook ID or a pseudoID

slender thistle
latent heron
#

Well if you don't delete them

#

they're gonna clog up the whole server

#

you're gonna have like 300 webhook integrations in the server settings KEKW

viral mortar
#

reuse it

latent heron
#

hmm

slender thistle
#

Holy

viral mortar
#

you can use different names and pfp each time

latent heron
#

yeah

#

it's like

#

really bad the way it's done

viral mortar
#

yeah but its not awful

#

its manageable

latent heron
#

thankfully lmao

#

i'm in VC if you guys want to look at it

#

because i'm so perplexed

slender thistle
#

Can't you just

#

use from_url instead

latent heron
#

that implies the webhook already exists

#

i need to create it first

latent heron
#

i preferrably want to do it from guild point

viral mortar
#

yeah, but its not that hard to check if it exists

latent heron
#

yeah

#

and i preferably would like to do it from the guild point lol

#

combing through each text channel and checking for a webhook is err

#

maybe not the best route to take

latent heron
#

that's basically making me go

#

"each message in the server, read every single text channel and look for that webhook, and modify"

#

that's bad

slender thistle
#

Jesus

viral mortar
#

nope

viral mortar
#

dont do it like that lol

#

two ways you could do it

latent heron
#

well yeah that's why i don't want to do it with text channels

viral mortar
#
  1. store in db
#
  1. check the current channel for a webhook
slender thistle
#

Manual caching

viral mortar
#

even better

latent heron
#

hmmm

#

let me see if i can get some feasibility out of the guild.webhooks method first, if not i can manually store it through DB

slender thistle
#

You can do some fucky wucky with dictionaries

#

key being a channel ID

latent heron
#

i pmuch do that as is with tinydb

#

since tinydb is mostly JSON

viral mortar
latent heron
#

well

#

all we are trying to do is grab the ID

#

we're not trying to hold actual data about the message contents or that

#

we can manually update the webhook's information from our end upon the instance of the message

slender thistle
outer perch
#

how do I get words with outline effect in node-canvas?

latent heron
#

if I used a {channel_id: webhook_id} i think for the most part it's fine

viral mortar
latent heron
#

although

#

i still hate how discord does this

#

it's really dumb

viral mortar
#

yeah except one thing

#

if its deleted in the interim it will cause an error

latent heron
#

how would it get deleted though

viral mortar
#

it might be worth checking and retrieving it each time rather than storing it

viral mortar
slender thistle
#

{channel_id: {id: id, token: token}}

latent heron
#

if you mean user as in like

#

those with admin perm?

outer perch
latent heron
#

i don't think you can just up and go with deleting a webhook

viral mortar
#

yeah, its not if someone does, its if they can

latent heron
#

hmm

#

i'll have to look into a solution for that down the road because quite frankly

#

if someone did that

#

big dumb

viral mortar
#

lmao ok

viral mortar
latent heron
#

plus i don't think most server owners are intelligent enough to check their webhooks periodically 😂

slender thistle
#

Always make everything user-proof

#

Never trust people

viral mortar
#

yeah

latent heron
#

i can't user-proof admins lol

viral mortar
#

just in case

lusty quest
#

expect the enduser to be a donkey

viral mortar
lusty quest
#

can you somehow check if the webhooks are still healthy?

viral mortar
lusty quest
#

just expect that the enduser is a donkey, if a donkey can use it pretty much every user can

latent heron
#

that's what i'm currently doing

latent heron
#

basically on bot start it combs through the guild webhooks, it'll then check for the same name or ID

#

these are all great solutions for finding the webhook

#

but i still have the issue of making it lmao

lusty quest
#

cant you create webhooks with d.py?

latent heron
#

i cant find it lol

viral mortar
lusty quest
#

lol then switch to js, iirc d.js can create webhooks

latent heron
#

this is the only way you can do it

#

i'd have to call it on the message context's channel ID

viral mortar
#

that works

#

thats good

lusty quest
#

make a setup command, and ask for what channel the webhook should be generated

latent heron
river panther
#

guys, how download kali linux?

lusty quest
#

like other linux distros

viral mortar
river panther
#

the top link, right>

umbral zealot
#

If you need to ask how to download a distro you're not ready to download a distro.

lament stump
latent heron
#

oh boy

#

so webhooks get a tiny bit more complicated

umbral zealot
#

Don't get anywhere near linux until you can install linux without having to ask people how to ddownload linux KEKW

latent heron
#

there are 2 webhook types now i need to check for

#

channel_follower instance of the Webhook object if it's for announcement channels of other servers

#

and then a regular one

viral mortar
latent heron
#

yeah

viral mortar
#

you only need one right?

umbral zealot
latent heron
#

correct but i can also potentially target a channel webhook

#

it obv won't impact shit but the code wouldn't then work

viral mortar
#

hmm

umbral zealot
orchid nest
#

hi

viral mortar
#

i think theres an easy fix

#

gimme a sec

#

yeah there is

lament stump
#

yup, that was it c:

viral mortar
#

@latent heron webhook.type

latent heron
#

oh pog

viral mortar
#

yup

#

ez

slender thistle
#

I forgot those exist

latent heron
#

so here's my idea

viral mortar
latent heron
#

i have a cog listener for when the bot joins the guild it makes a webhook for this on the first channel it finds

#

i save that token somewhere

#

and then i can just refer to it from there on out

earnest phoenix
#

who can help me make server bot @everyone

viral mortar
#

idk exactly what youre doing

latent heron
#

im pretty sure this is a bad method

#

but shit if it works it works lmao

slender thistle
viral mortar
#

oh right

#

yeah thats for announcents

#

idek how to use it

earnest phoenix
#

can somone dm me so there can make me bot

slender thistle
#

@drowsy crag -needdev

drowsy crag
#

-needdev

gilded plankBOT
#

DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.

viral mortar
#

thanks

earnest phoenix
#

@latent heron can help me make bot

latent heron
#

no i can't

earnest phoenix
#

-needdev

#

ok

viral mortar
#

@drowsy crag

latent heron
#

go learn how to code

earnest phoenix
#

-needdev

earnest phoenix
latent heron
#

then study how to make a bot

drowsy crag
#

@earnest phoenix go look on fiverr or find a freelancer

#

this isnt the place

earnest phoenix
#

this said i can get help

drowsy crag
#

yes, about your code

#

not about others coding for you

earnest phoenix
#

i going pay somone

drowsy crag
#

-m 700880831098650674

gilded plankBOT
#

🤐 Muted JJandTtv#3301 (@elfin rune)

near fjord
#

whats the best bots?

viral mortar
slender thistle
#

Ask an engineer that and then ask a Discord bot community

#

You'll get different answers

#

Reason: "best" is subjective

viral mortar
#

yeup

near fjord
#

ok thanks

latent heron
#

alright

#

so i've achieved the ability to find the webhook and edit it to send what i want

#

and then i realized there is no d.py method to change the text channel it belongs to Sadge

viral mortar
#

...

#

yeah...

cinder patio
#

Can you even do that in discord normally?

latent heron
#

yea

viral mortar
latent heron
#

you can change the webhook after you create it

#

at least as a user

#

there's probably just no actual API method for it if i had to guess

cinder patio
#

I don't think you can change the webhook's channel

viral mortar
#

yeah but thats bot the same

#

i thought you were trying to create something for the system channel

quartz kindle
#

why cant you change the webhook's channel?

viral mortar
#

if you wanna send a webhook in a channel, you need to have a webhook in that channel

latent heron
#

well you can call on a webhook anywhere regardless

#

but the receiving end is bound

viral mortar
quartz kindle
latent heron
#

lmao

quartz kindle
#

you can create webhooks with the bot

latent heron
#

d.py just doesn't support this

#

for whatever reason

viral mortar
latent heron
#

yeah

#

im looking through all of the docs

#

even on the create webhook event you can't declare the text channel because it's contextually based

#

which means unless i want to manually send HTTP requests to discord

viral mortar
#

yeah ok

#

youre right

quartz kindle
#

you're right, no option to change channel lmao

latent heron
#

i'd have to do the really horrible method of combing through text channels

slender thistle
#

You can technically abuse bot.http

quartz kindle
#

make a PR for it

slender thistle
#

sec

viral mortar
slender thistle
#

wait

#

you can change channels for webhooks?

latent heron
#

yup

viral mortar
#

apparently not

latent heron
slender thistle
#

I see

quartz kindle
#

you need webhook's permission, but yes you can

latent heron
#

lol some dude said "fuck you" and left the vc

slender thistle
#

Yeah, aiohttp to the rescue

latent heron
#

thanks very cool

mighty ember
#

is it fixed yet?

quartz kindle
slender thistle
#

Not yet

quartz kindle
#

should be simple to add a channel_id field

latent heron
#

it's just an extra JSON parameter Danny would have to pass for his HTTP request

#

idk why he didn't add it

slender thistle
#

imo easier to implement that yourself than making a PR

#

Probably forgot or didn't consider it useful enough

viral mortar
#

thats pretty cool

slender thistle
#
async def modify_channel(channel_id: int):
    # yada yada

discord.Webhook.modify_channel = modify_channel
``` inb4
earnest phoenix
latent heron
#

that's just

#

that's so dumb

earnest phoenix
#

I just tried it

latent heron
viral mortar
#

hmm?

earnest phoenix
#

Wait what on earth is happening, it returned something but didn't actually move it

slender thistle
#

It can?

earnest phoenix
#

brr no clue

slender thistle
#

I don't think it officially can

earnest phoenix
#

I mean because it takes arbitrary keyword arguments

latent heron
#

this is insane

#

because through discord http request i now need to read the whole json struct

#

and then put it back into a way for d.py to understand it

#

then i can finally edit it

#

holy fucking shit this is so stupid just for a workaround

earnest phoenix
#

because it's just calling this

quartz kindle
#

you can piggyback on the webhook_update event

#

send the request, then wait for the event to arrive

latent heron
#

im better off at this rate using plan A

#

which was making a new webhook and deleting it after

#

because there's no way to modify it or keep active track

quartz kindle
#

or fork dpy

#

and add it to your fork

latent heron
#

idk, it's fruitless to me to make a modification of the d.py source when i'll update it in a few weeks and it'll override all of the code changes i made

quartz kindle
#

you could also override it at run time

#

not sure if py supports modifying class prototypes like js

latent heron
#

that's unnecessarily complicated though

#

none of this should have to be done in the first place

#

its an API wrapper which serves the sole purpose of being a way to work with an open-sourced API through a lang

#

that's counter intuitive of what it's purpose is to do

quartz kindle
#

just fork it, then PR it. use your fork while you wait for merge

slender thistle
latent heron
#

no

#

i've tried doing something similar to that already

slender thistle
#

Oh

latent heron
#

sorry if it sounded a little off

slender thistle
#

Well I'll be praying for you while doing my homework

latent heron
#

a bit heated by how something that's literally a passable argument didn't make it into the wrapper

#

LMAO

#

i'll make a pr this evening about it

slender thistle
#

Good luck KEKW

viral mortar
#

wow that was actually quite constructive

#

i enjoyed reading that

latent heron
#

constructive? man i was about to lose my shit 😂

viral mortar
#

haha but youre getting there

earnest phoenix
#

oh bruh, I just realized d.py uses token on its url and the endpoint ignores channel_id parameter

latent heron
#

it's just purposefully ignored

quartz kindle
#

hmm i just noticed

#

so you have to use the non-token version

latent heron
#

cant wait for my bot ms to go up + 30 because of this new revolutionary concept of reading every text channel now 🤣 🔫

quartz kindle
latent heron
#

tried that

viral mortar
#

yeah

#

do you really need to modify it each time?

latent heron
#

unfortunately.

#

it's that or the way im having to write it: find the old one, delete it, create a new one for that new channel.

#

that's the most efficient approach i can see being feasible for now

viral mortar
#

you you need to delete it?

quartz kindle
#

this is the code from discord.js

#
    const data = await this.client.api.webhooks(this.id, channel ? undefined : this.token).patch({
      data: { name, avatar, channel_id: channel },
      reason,
    });
latent heron
#

d.js works with everything in a JSON struct though

#

unfortunately d.py does not

quartz kindle
#

no?

earnest phoenix
#

yeah you gotta do this, fucking danny

latent heron
#

i know that at least in d.py you can't without a class method calling straight from a dict source

#

which very few d.py objects even support, i know one being Embed

latent heron
earnest phoenix
#

Shift to hikari lol

latent heron
quartz kindle
slender thistle
#

Python with strict typing when

latent heron
#

tfw asymmetric indents break the whole script because you can't dynamically handle lexing

viral mortar
latent heron
#

most languages can deal with tokenization just fine

#

idk why py requires indentation

#

this is why im slightly glad i tried learning how to code a programming lang in order to research how this shit works

lyric mountain
#

just learnt today that js only exists because of java