.then(async wb => {
const hook = new Discord.WebhookClient(wb.id, wb.token);
await hook.send(yazi)
return hook;
}).then(hook => hook.delete({ timeout: 2000, reason: 'HOOK silinmesi' }) )
or simply
.then(async wb => {
const hook = new Discord.WebhookClient(wb.id, wb.token);
await hook.send(yazi)
await hook.delete({ timeout: 2000, reason: 'HOOK silinmesi' })
})
#development
1 messages · Page 1361 of 1
@obtuse jolt idk looks correct, and the third image shows that it worked before, did you change anything?
I remove a line from the shard sending
that defined it as something
idk whyt but it's not outputting anything to console
A channel cannot have more than 10 webhooks
When you create a webhook for a channel, save it's ID in a database, so you don't create a new one every time
how can i do that
When you create a webhook for a channel, save it's ID in a database, so you don't create a new one every time
@cinder patio
in v11 i was use js message.channel.createWebhook(isim , avatar) .then(webhook => webhook.edit({name: isim, avatar: avatar} ) .then(wb => { const hook = new Discord.WebhookClient(wb.id, wb.token); hook.send(yazi) }).then(a => { a.delete({ timeout: 2000, reason: 'HOOK silinmesi' }) })
@quartz kindle https://cdn.yxridev.com/u/stKNpwkL.png
https://cdn.yxridev.com/u/de37sJgA.png
https://cdn.yxridev.com/u/Q1FUrxMv.png
where is the json response line i highlighted coming from?
but its not works in v12
This has nothing to do with the library, it's a discord limitation, you cannot have more than 10 webhooks in a single channel
how do i do to fix it
How can I take the previous one
You can either:
- Store the webhook's ID somewhere, if the ID is missing create the webhook, then use
fetchWebhookto get the webhook - Get all webhooks
fetchWebhooksand select one from there.
You can get the webhooks from the channel and if there are over 10 return
A friend of mine is looking to pay someone to make a custom (rather simplistic) bot. DM if interested or if you have any questions.
Fiverr has a lot of devs who will make it.
I made this command for webhook creations with my bot
message.delete()
const user = message.mentions.users.first() || message.author
const args = message.content.slice(33)
if (user.bot) return;
if (!user && !args.length) { message.channel.send("Utilizzo: gs.webhook <optional:utente> <testo>")}
const webhook = message.channel.createWebhook(user.username, {avatar: user.displayAvatarURL({ format: 'jpg', dynamic: true })}).then(webh => {
const webhookClient = new Discord.WebhookClient(webh.id, webh.token);
webhookClient.send(args)
webh.delete()
}```
So why the cmd gives me an error?
Made with discord.js
What's the error?
Because you call client.login(...) in the message event.
But you won't get any messages if you aren't logged in.
You call it in the global scope. Aka move it out of the event body.
}) before client.login(...)
Hover over the underlined red text and see you got yourself a syntax error.
You shouldn't have an extra }) there because you closed the scope already.
You're probably missing a } to cover the last if statement in your event body
Can you run it now.
Great
But I recommend you spend more time learning JavaScript, as scopes & syntax are fundamental traits to the language.
@sudden geyser Hey, I broke my help command, including my warn could u possibly help?
alright my help command does not respond and has 0 errors
my warn command I think I only set for 1 guild which I thinbk broke it and im not sure how to fix it
Did you mean to use === instead of !== when checking the guild ID?
o ye good spot, i was thinking of keep my bot so it only worked in one guild but i wanna change it

When you want to make a program that works in a number of environments (in this case, guilds), it's more reliable to think dynamically. In your case, it's probably not the best idea to hard-code a check into your command for a specific guild.
There are a number of other possible errors in your code:
await message.mentions.members.first()- Did you forget to do.cache.first()?- Line 28: Similar issue as the one I pointed out in the screenshot.
- You shouldn't need to do the checks you do at the top (prefix, bot, etc.) Your command should only hold the logic of your command.
There are a number of other errors that may be present, but I don't think I have the time to look over all your code. The idea is what matters more. @earnest phoenix
@sudden geyser alr thanks
It couldn't find the module.
How do I fix that?
Aka the path doesn't point to that file.
You supply a path that exists. The current file your code is being executed from also plays a role.
Can you show your directory structure on the left side
You're trying to access a file but pointing to the wrong file or no file
See, file doesn't exist.
Yeah we all make mistakes, but you should still take the time to learn JS
just trying to make a bot with help of here and github
You should always learn the language before using a library with the language
GitHub and this channel won't always be here to hold your hand. It's your code, so you need to take the time to learn the language if you want to make a bot.
kk
^
ill do that then
It seems the error is coming from await getInfo(args)
Which tells us it's coming from the ytdl-getinfo library.
What should I do ?
how do i make that if a user use a command it will start a timer
and he could not use the command till the timer is up
The way you are getting into isn't how ytdl.getInfo function works the method works by video id so you need to get the video Id then use that in the get info method
The way you are getting into isn't how ytdl.getInfo function works the method works by video id so you need to get the video Id then use that in the get info method
@queen needle What should I do ?
No, you should be able to use the video title.
Really?
This is on their README
then don't spread false information, thank you.
It was just a mistake free.
but they still should check README/docs before saying something.
😤
anyways he should debug himself though
let size2 = '='
size.forEach({
size2 = `${size2}=`
})
size2 = ${size2}=
^^^^^^^^^^^^^^^^^^^
SyntaxError: Invalid shorthand property initializer

I was going to say python, but it makes more sense than python
kinda looks like shit
javascript
jabbascript
jabba
Hello,
My bot can no longer play music. It was working before. It does not work anymore. Why is that ?
Command (Cal.js) = https://hasteb.in/efavotaf.js
Errors Code = https://hasteb.in/wureqabe.rb
Thank you 🙂
anyone got an eval code for me
we dont spoonfeed here
Not how it works Star
eval("10+10")
1010

how do i make that the bot will know what time is it?
i saw so many bots
@tardy hornet depends, what timezone?
GMT +2
new Date().toLocaleString("en-US",{timeZone:"Etc/GMT-2"})
so like
how do i make him know, what time the user sent the message, like it will say in the footer, today at bla bla
ty guys
theres also message.createdAt
Greetings, I'm here to inquire if anyone has implemented a distributed shard system, with a centralized cache w/ shared data for de-duplication.
I'm currently re-evaluating my current strategy for self-coordination among pods to elect master nodes, and distribute M shards across N clusters.
Thanks.
Brain go brrrr
i have never implemented it because i have no need for it, but i have pondered about it before
My current cost regarding scaling on a single machine is becoming non-feasible, which is my motivation to seek better solutions.
whats your current setup?
Self-coordination among shards, using a central redis instance to communicate among shards to obtain key locks w/ TTL heartbeats up to M shards.
Abstracted router layer that feeds compressed data into central redis store, and an internal queue to distribute/balance requests to microservices. I believe the tradeoff of CPU cycles for ~35% memory compression saving was worth it.
I believe I inquired the same thing about two years ago: https://discordapp.com/channels/264445053596991498/272764566411149314/525951226076987392
personally i would go for a centralized sharding manager/coordinator to which individual shards can connect to via tcp/etc and obtain shard ids to connect with, this way its easy to load balance them among machines
your microservice queue sounds good, the redis store also sounds ok, although i would personally look into non-memory database to avoid having non-hot data hogging the memory
Are there any insights on the larger bots on the 16 multiple sharding systems are handling it? Would be great to get some inspirations.
unfortunately i dont have any information about how they're doing it, but they are likely using similar ideas
the only tricky part about a multi-machine setup is sharding coordination, which can only be reliably done with a centralized manager
to avoid multiple shards trying to connect at the same time
The current manager/coordinator is the redis instance, obtaining locks on keys would be the method of obtaining shard ID
sounds good enough
i know its not working like that but
if(new Date().toLocaleString("en-US",{timeZone:"Etc"}) !== new Date().toLocaleString("en-US",{time:"10:00 - 12:00"})) return message.channel.send('F')
yeah no that makes no sense
ik
hello
hi
how i can make a guess game like dank memer?
well you have to make it yourself, we aren't gonna give you the code. I can, however, help you. What library are you using?
discord.js
ah ok
uh you can ask people to donate i guess
and what particular command from dank memer are you wanting to have in your bot
@ionic dawn what is funny in my Q?
lol its cuz bot development usually takes money from you
uh you can ask people to donate i guess
@earnest phoenix ok no another way to make money?
no i can get money from bot development?
discord isn't gonna pay you for making bots xd
paying for advertisement
ok
So the errors are gone now!
How does the webhooks help with the voting rewards?
I have it as the running script and now its checking of the user voted
no i can get money from bot development @wintry elk
you can build a bot and somehow make it generate moneh using patreon tiers or any kind of PREMIUM features
But thats difficult
Can someone acknowledge my existence please?
you can build a bot and somehow make it generate moneh using patreon tiers or any kind of PREMIUM features
@ionic dawn ok my brother thank you very much 🌹
@earnest phoenix are you there to help me?
is it possible to create a hyperlink inside of discord that when once you click it, it copies text
Please help me, ANYONE
what
is it possible to create a hyperlink inside of discord that when once you click it, it copies text
@errant perch That would require at least JS, so nope it’s not possible
ok
I have the script running so a webhook is sent when a user votes and now my bot isnt giving me my voting reward
copies text?
like ctrl+c ctrl+v
are you receiving the vote webbook?
i guess you could hyperlink a website that does on load

are you receiving the vote webbook?
@solemn latch I dont even know where the web hook is even going
well, first you need to receive the webhook in the webhook event
@errant perch check onload for html/js
ok i'll look into it
window would probably be my recommendation
@errant perch check
onloadfor html/js
@opal plank he spoke about Discord, it’s unfortunately not possible in discord to trigger event on the client side
again, load it on a website
use the bot to fetch previous msg or something
is it possible to create a hyperlink inside of discord that when once you click it, it copies text
that was the question, if its your website, yes, it can @boreal iron
you got access to the bot, therefore the chat too
limited but functional
well, first you need to receive the webhook in the webhook event
@solemn latch ?
is the webhook event logging when you testvote
???
@opal plank Nah I think he meant to copy a specific text in discord by clicking on a link
Whats a console?
oh no
@boreal iron then no, the way he phrased makes it seem like something else
he just say copies text
he didnt specify what text, nor where it is from
if you simply want a copy function from a link, its doable with onload and copy function
thats as simple as it gets
what about text generated from the bot
if its your bot, you can do logic to log what it sent
i assume text generated from the bot you mean on the go
not chat history from the bot
yes
as long as you have a domain, you can simply put a path on your domain and have it with whatever text you wish
and then send that link in chat
Is it possible to send message and reactions at the same time? Because if I send the message before reacting to it, I need the READ_MESSAGE_HISTORY permission
you only need read message history if you dont cache the message afaik
you only need read message history if you dont cache the message afaik
@solemn latch It's not working
caching the message isnt?
example
bot generates text: "Hello World"
Bot creates a new path on your domain with a router
mydomain.com/Hello
bot adds the generated text onto the onload function on that page
Bot sends mydomain.com/Hello
User clicks that hyperlink and loads a page, instanly have the text on their clipboard
@errant perch @boreal iron
you'd probably generate a page for each generated text
caching the message isnt?
@solemn latch the error come from the API itself, and yes the message is cached
why do you need to get the message from the api if its cached?
re-read my message I dropped some words
Hello,
My bot can no longer play music. It was working before. It does not work anymore. Why is that ?
Command (Cal.js) = https://hasteb.in/efavotaf.js
Errors Code = https://hasteb.in/wureqabe.rb
Thank you 🙂
@opal plank yeah, as I said thought he speaks about an event like onclick in discord not external
I dont see where you cant just add the reaction to the cached message
apart from that, no, theres no way unless you using client mods
ehm im tryna use css and stuff in the bot description, but when I click preview it doesnt work, console says "[Error] ReferenceError: Can't find variable: preview
onclick (new:316)"
You can’t use JS in the description
I didnt
I dont see where you cant just add the reaction to the cached message
@solemn latch The message is sent, so even if it's cached and I know everything about it, Discord consider it as an old message and I need theREAD_MESSAGE_HISTORYpermission, I got aDiscordAPIError: Missing Access
whats your code look like?
Then save ur changes and clear your cache and reload the site
tried that
Tried a different browser already?
not yet
whats your code look like?
@solemn latch something like that
const message = await channel.send(/* */)
// stuff here
for (const reaction of /* */) {
// stuff here
await message.react(reaction)
}
and const message = await channel.send(/* */) is in the same scope as the for loop?
chrome gives me this
Uncaught ReferenceError: preview is not defined
at HTMLButtonElement.onclick (new:316)```
and
const message = await channel.send(/* */)is in the same scope as the for loop?
@solemn latch yes
so the same thing as safari
Then head to #support and report the issue please
And probably ping the moderators once
Hey guys
If my bot status online like we use desktop how can we change to phone online status
Any idea what the rate limit for deleting emotes is?
@earnest phoenix bruh
Any idea what the rate limit for deleting emotes is?
No idea 😓
@obtuse thistle it's about 1+ second(s). Though, you shouldn't rely on the number being constant as it can change. The library you use will probably handle rate limits for you, but if you're trying to protect against rate limits a bit more, then setting a limit like 1-2 seconds is fine.
👌 Thanks
Hey @sudden geyser
Do you know how to make bot status to phone online status
@subtle kiln turns out cached messages cant be reacted to without view message history 
actually something I didnt know.
I think some bots have done that. What library are you using
D. Js
I swear users could do it
??
@subtle kiln turns out cached messages cant be reacted to without view message history
actually something I didnt know.
@solemn latch yes because Discord don't care if you cached the message or not. All it see it's that it's an old message and you don't have the permission to know about it
@sudden geyser You found smth?
Not yet
I didn't find it in the Discord.js documentation, so I'm looking in Discord's documentation.
I know it's gonna put in ready.js
?
its done in the identification payload
mobile status is not documented and shouldnt be used
i've done it, its in the identification payload
you'd have to hack the library to change it
in a nested dict in python, if i do dictname["module"] dictname["module2"] will it get from the same dict?
its like a dict inside a parent dict
A bit confused. What is the nested & parent dict (dictname)? Whatever variable your dict is supposed to be you access (and isn't changed) is the dict you read from, so it should be the same dict.
Hello
@opal plank So it's illegal right
basically, dont do it @clever vector , yes
I was making a bot(discord.js), and I went for the guild's member cache, and as I called to search the cache, it could not find my ID. So I did a little bit of digging and found that the bot is the only member in the member cache... can someone help me?
You probably don't have intents.
What are those?
the things you receive from discord. intents are what you choose to get
Hey guys
I got 1 more problem
How do I fix that though
I enabled server member intent but the user count still unstable
This article may interest you: https://dis.gd/gwupdate
Did discord have an update that changed the way caching worked?
Yes, those are intents.
I swear you just had nitro.
Where do I enable intents?
Impassive check your bot's dashboard on the developer portal.
Click on the Bot tab and scroll to Privileged Gateway Intents
Where on the dashboard?
Thanks
You may also need to change some of your code, as I think there's an intents field in the client constructor's option object.
actually, @sudden geyser, i lied, its not 17kl
sad
its 19k
still sad
wdym still sad?
sad
It still does not cache all of the members
@opal plank What is the size of your emotes folder?
top.gg and discord have seperate validations
https://support.discord.com/hc/en-us/articles/360040720412-Bot-Verification-and-Data-Whitelisting
^ discords
top.gg is for being on the bot list
Noo I mean
how many emotes?
The Verification mentioned on the intent
intents are discords side
Ohh so
@boreal flume as in storage megabytes or how many files inside of it?
It's must be verified by discord in order let it stable again?
storage megabytes
if your bot is in over 100 guilds, and needs a privileged intents
Then?
then you need to be validated by discord to make it work
Ohh
Smaller than I thought
i think the database compresses it with the hash
ahh
@earnest phoenix when it passes Discord verification
it isnt
after 75 servers you will get a dm explaining it
oh ok
aight, time to go grind more genshin and bother shiv
Hey guys how do I change var = 0 to numbers ?
var i = 0
var a = i++
bot.guilds.cache.map(guild => `${a}. ` + guild.name + " - " + guild.memberCount).join("\n")
when the command come out it's 0
All
I wanna put it to like
1
2
3
It's maybe because of EEMBED
@earnest phoenix
wut?
Bruh pinged oliy
not like he asked a question
lol
how do i get the stats of a bot using dblpy?
can you read a yml file like you read a json file with require()
So I can't use client.channels.cache.size anymore?
If you don't have the intents for it.
can you read a yml file like you read a json file with require()
@celest schooner you need to parse it with a library.
oke i can use fs
but i can't use client.user.cache.size
i wrong paste sorry
client.user.cache.size only print 1 / 2 /3 only user
alright
@grand iron it's better you rely on the number of members in the guild provided by the API. In your case (since you're using Discord.js), you should iterate over every guild and add up its .memberCount property, which is the number of members in the guild.
For example: js guilds.cache.reduce((total, guild) => total + guild.memberCount, 0)
@grand iron client.users.cache.size
hey guys, does anyone know how should i approach to create a hp bar? in the embeds description
That'll work
can someone tel me why command promt is telling me this
C:\Users\L26jo\Desktop\disc bot\main.js:30
Messege.channel.send('(text)');
^
ReferenceError: Messege is not defined
at Client.<anonymous> (C:\Users\L26jo\Desktop\disc bot\main.js:30:9)
at Client.emit (events.js:314:20)
at MessageCreateAction.handle (C:\Users\L26jo\Desktop\disc bot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\L26jo\Desktop\disc bot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\L26jo\Desktop\disc bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\L26jo\Desktop\disc bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\L26jo\Desktop\disc bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\L26jo\Desktop\disc bot\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:314:20)
at Receiver.receiverOnMessage (C:\Users\L26jo\Desktop\disc bot\node_modules\ws\lib\websocket.js:797:20)
Hmm...
@inner badger Messege is not defined
and how could i add color to it?
@inner badger message.channel.send('are your ready to die?')
message not Message
Incorrect @grand iron
waht are these blocks? i need to put them in discordjs bruh
case sesi
▰▰▰▰▰▰▰▰▰▱
▄▄▄▄▄▄▄
I have to finish a line of code before they review my bot so imma head out
ty
And a lowercase m usually...
and need to increase size?
U+25B0

▰ | | black parallelogram (U+25B0) @ Graphemica
JavaScript and JSON \u25B0
ye just saw that
\u25B0
:\u25B0 :
mmm
how
do i
why is it not converting? xD

has to be a lowercase u
oh ye
You'll use it in the string to create a zero-width space.
i mean, why isn't it being detected as markdown here?
or will it work if i send it in embeds?
from the bot
From Javascript To Client = ▰
From Client To Javascript = \u25B0
i dont know but i think we can't
i guess they using something else, on anigame then
this what im trying to achieve
the health bar
static image
those are images
you can also build it using custom emojis
you can send multiple in one embed?
yep
not images
Use custom emojis
Oh
you can also build a canvas with all the elements
yeah don't emojis seems simpler
it made no sense to use
and easier


but how would i "fill" the appropriate color values? ;-; sorry im noob
google.com is always helping the people
so i tried doing this
const argsforvideo = message.content.split(" ").slice(2).join(" ")
const embed = new Discord.MessageEmbed()
.setTitle(`${argsforid}`)
.setAuthor(`${argsforvideo}`)
message.channel.send(embed)```
now i do b!message hi hello
it sends hello as argsforvideo
but how would i "fill" the appropriate color values? ;-; sorry im noob
@crystal wigeon what?
add await before message.channel.send
and hi hello as the argsforid
add await before message.channel.send
@grand iron i mean it works
oke
but not how i want
maybe you can use args[0]
it sends hi hello as the argsforid
you can find how to make args on github or google maybe
angga, why you sending all to google?
this channel is to help people and discuss about dev
xD
No... I mean they should google first but answering them: go google
isnt gonna solve nothing
Okay im wrong
can we get on a call or something?
im sure im not googling properly
i cant find anything
related to what i want
i want a health bar. but if i use emojis
hwo would i change the color
?
like green bar and yellow, red
i mean, its like a progress bar
I know
from 0/100
what is this channel for?
What I mean is, you can use 2 color patterns for every bar
how would i get the exact points required for the moji to show the colors?
and use the ligher for empty and stronger for fill
mm
work on a 100% and when the progress is higher just swap an emoji or pushit using arrays
what is this channel for?
@zinc talon chat about development, you can also read the desc for more info
ty
for typescript I keep on getting this error
Property 'cmds' does not exist on type 'Client'
here client.cmds = new Discord.Collection()
i tried adding ```import { Client, Collection } from "discord.js-light";
declare module "discord.js" {
export interface Client {
cmds: Collection<unknown, any>
}
}``` into the typings folder but
¯_(ツ)_/¯
i still need help
I think its a problem with tsconfig
so this is my tsconfig
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"lib": ["dom", "es6", "es2017", "esnext.asynciterable"],
"sourceMap": true,
"outDir": "./dist",
"moduleResolution": "node",
"removeComments": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"resolveJsonModule": true,
"baseUrl": ".",
"skipLibCheck": true
},
"exclude": ["node_modules"],
"include": ["./src/**/*.tsx", "./src/**/*.ts"]
}```
ping me pls
how do you use custom emojis for reactions in discord.py?
i currently have this <a:name:id>
but it gives me this error discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 10014): Unknown Emoji
Hey I am in my messageReactionAdd event and trying get the following to work ever since this new update:
let reactmember = reaction.message.guild.members.fetch(user)
that returns a guildMember which is perfect.
when I go to do: reactmember.roles.add(role1)
Role1 is defined and works already tested
it says:
Cannot 'add' of undefined
Yo I need some help with discord.js 11.4.2
I'm trying to use discord-giveaway.js wit it
And when ever I run the token it says its invalid and cant catch the token
I've even reset the token multiple times
Anyone know how to fix this?
you cant use djs versions older than v12
not anymore
what's a boolean matrix
how cn i get a mono db url pls tell me
as i dont now more about mono db
@earnest phoenix are you using mongodb atlas or normally hosting it on localhost?
for localhost: http://localhost:port-for-mongodb
for atlas: Copy the URI for the specific cluster
the colored emoji is getting a white bg even when the bg is trasnparent, waht i tried ehre is i took the empty shape, filled a color, the empty one belnds in correctly but idk why the same image with color is acting weird ;-;
the colored emoji is getting a white bg even when the bg is trasnparent, waht i tried ehre is i took the empty shape, filled a color, the empty one belnds in correctly but idk why the same image with color is acting weird ;-;
@crystal wigeon or did you upload it as a JPEG instead of a PNG (JPEGs can't have transparency only PNG)
send file here
(not code send the emoji picture)
the non colored one works fine
but the red
or yellow
is adding that white bg
the picture has no transparent background smh
the white one does ;-;
this also has no transparent background and it's not even discord
send me the link to that
yeah i tried to "fill" color with paint which is adding taht white bg i presume
@crystal wigeon microsoft paint does not work with PNG transparency
ahh
it will delete the transparency upon saving
is there any other online tool?
thanks
How does paint not support rgba 
How does paint not support rgba
@solemn latch it is what it is (deprecated)
True
fuck class started bye guys
paint.net isn't free? ;-;
@crystal wigeon you want them to just spend a billion years making a good image editor and give it away for free?
also the URL is actually https://getpaint.net
ok nevermind they actually give it away for free
😂
Hey
yes
yes
@earnest phoenix try troubleshooting quick.db https://github.com/JoshuaWise/better-sqlite3/blob/master/docs/troubleshooting.md
if it does not work after that there is no hope
kk

Wont let me publish my NPM package no matter what the name is
any one know how to make loop for getting all guild id
for(let i = 0; i < guild.size; i++)
{
const gID = ?
const channel = Guildconf[gID]
message.member.voice.channel.join();
}
i only know the loop
how to implemented it?
any know?
is there a way to filter bot mentions?
wdym by filter
so i have a thing where it replies to all bot mentions. but i want to filter some user.id and add different replies
can you show your code?
if(message.mentions.has(client.user.id)) {
message.channel.send("hello")
}
well, you kinda already answered your question
replace the id with other member's id?
no, sorry
ok wait
so lets say
if a normal user mentions the bot - they get hello as a reply
now if a special user mentions the bot - they get how are you as a reply
if else, i guess?```js
if ([id1, id2].some(x => message.mentions.has(x)) {
// special user
}
else {
// ordinary user
}```
@earnest phoenix @earnest phoenix
kk
Wont let me publish my NPM package no matter what the name is
@agile lance capital letters are forbidden
[id1, id2].some(x => message.mentions.has(x)
@pale vessel message.mentions? aren't you supposed to check message.author.id?
wut
you're checking if the special user is mentioned
while the guy wants it so if the messages sender IS the special user

no
i don't use glitch, sorry
i don't think glitch supports go?
repl.it does though, iirc
isnt glitch js only?
can i send a createReadStream(filename) as an image in the embeds?
did any of yall have problems getting mysql to work on your vps? just give me a ton of errors authentication errors
is there a way to check if i got a promise as return after a function is executed
const express = require('express');
const app = express();
app.get("/", (request, response) => {
console.log(Date.now() + " Ping Received");
response.sendStatus(20000);
});
app.listen(process.env.PORT);
setInterval(() => {
http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 20000);```
server.js
So I made one Client event on which if it joins any server, it will send an embed to a designated channel but it keeps on sending the error that the guild is not defined. If I define the guild like guild = ctx.guild. it will send me my server's info whereas I want the serverinfo of the server which my bot entered it
Sending the code
async def on_guild_join(guild):
channel = client.get_channel(772723143261028432)
embed = discord.Embed(title = "New Guild Joined!" , colour = discord.Colour.red())
embed.add_field(name = "**Guild Name**" , value = f"{guild.name}")
embed.add_field(name = "Guild Id" , value = f"{guild.id}")
embed.add_field(name = "**Owner Name**" , value = f"{guild.owner_name}")
embed.add_field(name = "**Owner Id**" , value = f"{guild.owner_id}")
embed.set_image(url = "https://cdn.discordapp.com/attachments/772723143261028432/772736709124948008/200.gif")
embed.set_footer(text = f"Requested by {ctx.author.name}" , icon_url = ctx.author.avatar_url)
await channel.send(embed=embed)```
@slender thistle Can you help me up? 
Everyone is afk lol
nani
Come on 🥺
embed.set_footer(text = f"Requested by {ctx.author.name}" , icon_url = ctx.author.avatar_url)
ctx doesn't exist in this case
guild doesn't have an owner_name attribute unless that's new
I have zero clue why it would do that
Wait
Mhmmm
it will send me my server's info whereas I want the serverinfo of the server which my bot entered it
Make sure you don't have another event fucking it all up somehow
I don't have another event
I have only three. First is async Def on_ready():
Second is this
Third is async def on_raw_reaction_add
Not weird lmao
yes?

anyone know imaghash
Anyone using VBA here? Got a weird type mismatch in my array
how to mention someone by id in an Embed message
<@id>
u sure ?
yes
You cant ping in a embed but you can send a mention <@id>
i tried
that's not what i sent
u didn't understand the question
:+1:
how do u check if a member is in the server or not ?
i tried by guild.members.fetch(id)
problem is discord sends the message before i get the result from promise
then block it by awaiting
or use then pattern
0|AudioLab | at Object.module.exports [as GUILD_CREATE] (/root/audio/node_modules/discord.js/src/client/websocket/handlers/GUILD_CREATE.js:33:14)
0|AudioLab | at WebSocketManager.handlePacket (/root/audio/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
0|AudioLab | at WebSocketShard.onPacket (/root/audio/node_modules/discord.js/src/client/websocket/WebSocketShard.js:436:22)
0|AudioLab | at WebSocketShard.onMessage (/root/audio/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10)
0|AudioLab | at WebSocket.onMessage (/root/audio/node_modules/ws/lib/event-target.js:125:16)
0|AudioLab | at WebSocket.emit (events.js:315:20)
0|AudioLab | at Receiver.receiverOnMessage (/root/audio/node_modules/ws/lib/websocket.js:797:20)
0|AudioLab | at Receiver.emit (events.js:315:20)
0|AudioLab | Error: No tracks were found.
0|AudioLab | at ErelaClient.<anonymous> (/root/audio/node_modules/erela.js/dist/lib/ErelaClient.js:267:31)
0|AudioLab | at Generator.next (<anonymous>)
0|AudioLab | at fulfilled (/root/audio/node_modules/erela.js/dist/lib/ErelaClient.js:5:58)
0|AudioLab | at runMicrotasks (<anonymous>)
0|AudioLab | at processTicksAndRejections (internal/process/task_queues.js:93:5)```
🤔 🤔
using python, how do i log stuff people input, example.
input = 'Enter A Number>'
and then the number they enter would be logged to a text document
something like number = int(input("Enter a number"))
should work
if i remember correctly
then you can save number to the text doc
how
i mean, if i gave someone something and i wanted to record answers. example.
input = ("enter a suggestion")
and then the suggestion would get saved to a txt called suggestions.txt on MY COMPUTER
and only my computer'
@cold grotto google how to save to a text file in python
its pretty simple i just suck at explaining
@earnest phoenix 
no you're going to save it on someone elses computer 
the way of inputting would be the same though, just without the int bracket as itll be a string not a number
lmao
could someone write the script for me so i understand, not in depth or anything. im not using it for anything. (just yet) but i dont understand at all.
One message removed from a suspended account.
xD
One message removed from a suspended account.
@slender thistle what's VBA bro?
@sage bobcat not like i was asking anything to hard, it would have taken like 10 seconds
Visual Basic for Applications
Basically my Excel shit
open() with w mode will create a new file if one doesn't exist under provided name @cold grotto
One message removed from a suspended account.
Beep boop are you familiar with open()
Have you tried searching for "write user input to file"
P.S. input() returns a string. Use the returned string and write into a file
Beep boop are you familiar with open()
@slender thistle no lol
input = ("enter a number")
open(number.txt, w)
would this work?
w would be a string
And
No
input is a function
It takes a string to output when the program wants the user to input something
how should it be written then?
open() with w mode will create a new file if one doesn't exist under provided name @cold grotto
@slender thistle it's import Py autogui lib
#development message @cold grotto
?????
Nicole, int is unnecessary here from what I understand, but the idea is there
number = int(input("Enter a number"))
open(number.txt, w)
o h
would this work
Ic
Same goes for number.txt
number = int(input("Enter a number"))
open('number.txt', 'w')
open it with context manager 
that would work?
@zinc fable
number = int(input("Enter a number"))
open('number.txt', 'w')
@slender thistle
this would work?
open() returns the opened file
so either use a context manager (please use google for this) or assign it to a variable and then use .write on it
If you don't use a context manager, you'll have to .close the file manually
file = open('some_file', 'w')
try:
file.write('Hola!')
finally:
file.close()
@slender thistle
pretty self-explanatory
yes
yes
file = open('some_file', 'w')
try:
number = int(input("Enter a number"))
finally:
file.close()
would that work?
You open the file, you parse the input, but you aren't writing to the file.
what why when who
Common sense: you need to .write like I said before. The returned number (or whatever) must actually be of datatype "str" (string) and not anything else
The Hola part in the snippet you sent before was a literal text that would be saved in the file
bruh, can someone just all save us a little bit of time and correct it for me?
everything you need to know has been told
i dont get it tho
The proper question would be "Am I willing to learn or be spoonfed everything?"
Then take a step back, learn the basics, then come back to it
file = open('some_file', 'w')
try:
file.write(number = int(input("Enter a number")))
finally:
file.close()
would this work
write takes no keyword argument
and why do you keep asking if that would work when you can try it yourself
he said to use .write tho
i didn't tell you not to use it, i said, it takes no kwarg
Yes I did
You do, just not like that
I said use .write method on the file object
I never said specify a number argument in the function
One message removed from a suspended account.
This may be a useful read: https://realpython.com/read-write-files-python/
number = int(input("Enter a number"))
import json
with open('WhateverFileName.json', 'w') as f_object:
json.dump(number, f_object)
would this work?
Relie.Script/Responses/List2+=Words "How are you" "What can you do" "mute {user}" "Ban {user}" "Kick {User}" "Please stay active during night" "activate Online charge" "can you save your battery" "Greet {user}" "Show battery" "go offline" "charge" "8ball {Question}" "Show dev bots" Read More.
@cold grotto try it out and see.
Then make it accept any text.
Your first test should be to not wrap input(...) in int(...)
Hey, I'm implementing an Economy System on my bot and I'm confused if i should use quick.db or quickmongo.
both are almost identical (btw i have a free mongo cluster) All i wanna know is which one will manage higher loads better?
@merry thunder why don't you use mongoose?
im familiar with quick.db , it'll be hard for me to work with mongoose
trust me, it is easy
i make a dashboar so i need mongoose
Hello, I will have a small question, I switched the bot from glitch to vds everything works fine, but I am confused in the bot panel part, we can look at the show part in a little glitch.I threw the panel files to the server where the domain is located, but index js does not have app.listen codes, I wonder if I set the env port
wait
a
sec
const { Client } = require('discord.js');
const { Token } = require('./config.json');
const GuildModel = require('./models/Guild');
const { connect } = require('mongoose');
const client = new Client;
client.on('ready', () => console.info(`Loffend in at ${client.uset.tag}`));
client.on('message', async (msg) => {
if (!msg.guild) return;
if (msg.content === '!hello') {
return msg.reply('Hello!');
} else if (msg.content === '!create') {
const doc = new Guildü({ id: msg.guild.id })
await doc.save();
msg.reply("made row document!")
} else if (msg.content == '!prefix') {
const reg = await GuildModel.findOne({ id: msg.guild.id});
if (!req) return msg.reply('sorry! doc dosent exits.');
return msg.reply(`found a document! prefix: ${req.prefix}`);
}
}
);
(async () => {
await connect('mongodb://localhost/mongodb-demo', {
useNewUrlParser: true,
useFindAndModify: false
});
return client.login(Token);
})()
i mean, quickmongo connects and saves data in the same database in which mongoose does
yes, but this is completly wrong 😦 you need to change a lot of things
Can u give me the expamle?
unlucky dayy!
I didnt download the local host of mongo.db. Could it be because of this?
mongoose
.connect("mongodb://filip:test@ds135196.mlab.com:35196/dev")
.then(() => console.log("MongoDB Connected"))
.catch(err => console.log(err));
for example
if you go on your mongo db account you get a link
you need to copy replace that link
with the one I have just posed
eee
you have localhost
that is not the right way to do it
you get a link on mongo db
that is connected to the database
that you created
(async () => {
.connect("blalalalallaa")
.then(() => console.log("MongoDB Connected"))
.catch(err => console.log(err));
});```
like that?
stop async
+invite
yeah, but I found my own code
i will change
module.exports.database = function () {
try{
mongoose.connect(mongodb+srv://${mongo_username}:${mongo_password}@"yourdatabasename".yourlink, { useNewUrlParser: true,useUnifiedTopology: true }).then(() => console.log("db online")).catch(err => console.log(err));
}catch(err){console.log(err)}
}
There's no need for the try {...} catch (...) {...} by the way.
You're already handling the promise via .then/.catch
if there is still an error
error should be self-explanatory
İ didnt see problem here
how can i play music from spotify?
yes
@static saffron you cant
no
you cant play songs directly from spotify
a solution is to parse the song title in youtube and play it
🤔 but rythm can
No
It uses the API to get song data then with that uses youtube to find and play the song.
oh ok, thanks
@cold grotto why json.dump
question can the client.users.fetch fetch users that are not in any guild the bot is
is there any way to have a join log (server owner name, guild icon, member count) and a welcome message without either of the intents?
question can the client.users.fetch fetch users that are not in any guild the bot is
@tight plinth yes
all user ids
What is a good permission to require for a set prefix command?
admin
dont the rules say that it cant require admin perms?
a set prefix command is not required
@dense patio lmao
Lool
@solar oxide manage server
ah ok thx
Minimum permissions needed
ah yes, send messages
Send and view msgs tbh
Having admin is just a disaster waiting to happen if the token is leaked imo
