#development
1 messages · Page 893 of 1
I see the issue, haven't figured out what's causing it
Hold on, I think I've done something.
what's the issue
Possibly .call(this)
which file
Yes, that was bugging me a little. I've scrapped the IntervalTimer class, and changed it to a setInterval, and calling the function as checkPosition.bind(null, args)
That fixes my issue it seems.
Perfect
Well explaining my problems to someone else always seems to work.
I'm trying to use heroku with cogs but it won't turn the bot on when i activate it
https://github.com/mohgram/DRIPBOT
Here's the code
(TOKEN'S RESET)
Check the error logs
still no work
Does error logs show anything? or are they empty
How would I be able to store an array/list-like datatype in SQLIte for a column? I have a table with prefixes that I want to store a list of prefixes the user defined. Is it possible, or would I need to do something like adding a single prefix per table data.
u can yes
but what i would do is store it like a string
then parse it
@sudden geyser
its not hard
alright, thank you
there are some sqlite array plugins but converting it to text and back is easier
I GOT IT WORKING
gg
@hasty sparrow
just cheesed it that way
too many variables in a function... maybe?
Not sure whether it's better or worse
Yeah, not really sure how hard the machine is working to do that on every react
but it's a step away from eval
I'll shelf it til I get the motivation to restruction the "m." exports
there we go
a smig better
every new menu is just a case i can live with that
i can never imagine making a webpage like that
i just like my good old .html files and write whatever i want there
you dont need to break the switch case if you return anyway
^^
i see c style coding
so you c c style?
I feel like weird stuff happens if you pull breaks out
i c c style
i c sharp c style
she sells (ba, z, k)sh shells by the C xor
Hey. I was just looking to some documentation, and read about the privileged intents. One thing mentioned there is GUILD_MEMBERS. Does this mean I need that privileged intent when my bot is in more than 100 servers, when I just want to do things like guild.members.cache.filter(m => m.hasPermission('ADMINISTRATOR'));?
@nocturne grove no it's more about getting user info
private stuff I guess? So not things like username and id?
Wait do you
with intents of without intents, that specific line of code doesnt matter
because an X number of members will be uncached regardless
Discord.js will cache members as they talk without intents
With intents it'll have all given members cached on boot
you can still fetch members without the guild_members intent, you just cant fetch all of them
okay I guess you two are right then. But when does it matter (regarding the GUILD_MEMBERS)?
the guild_members intent allows you to request guild member chunking, before intents you could request guild member chunking whenever - intents have been implemented because of that in the first place (to prevent scraping data)
another impactful thing about the guild_members intent is that it also controls all guild_member packets/events
With intents it'll have all given members cached on boot
@delicate zephyr so they're directly available, just like messages that are not available when you start up your bot?
how do I stop my script with visual studio code
meaning without it, your member count will not be accurate, and you will not get member join/leave/update events
so I need that intent to use client.on('guildMemberAdd', ...? oof
Yea
how do I stop my script with visual studio code
pls
in any case, intents rules only apply if you have intents enabled in your code, for exmaple, for discord.js would be new Client({ws:{intents:INTENTSHERE}})
wdym @lofty lagoon
click the stop button
ctrl+C in terminal?
in any case, intents rules only apply if you have intents enabled in your code, for exmaple, for discord.js would be
new Client({ws:{intents:INTENTSHERE}})
@quartz kindle wait I don't understand that. Or do you mean, íf you have the intents available for your bot, you need to use that piece of code? instead of justnew Client()?
intents is an option you enable or disable in your client options
meaning without it, your member count will not be accurate, and you will not get member join/leave/update events
@quartz kindle speaking of this, a new endpoint has been added to GET an aprox. amount of members and presences in the guild
if you dont enable it, all of its rules and related things will not apply
although discord stated that intents will become mandatory in the future
but right now they are not
@earnest phoenix i heard about it, didnt check it out yet
but i heard people are complaining lmao
it's reasonable to complain, they're doing this thing on the rush without prior notice and it's being executed really badly
hm I don't fully understand it now. But if I want to use guildMemberAdd with +100 guilds, I need my reason for using that event to be verified by Discord?
yes
yes, but for the future, not for now
yes 7 Oct
for now you can keep running your bot without intents
you can be verified regardless, however if you want intents in 100+ guilds, you need a reason to get those intents
That is really gonna be a deal breaker for Dyno and mee6 unless they make deals with them
annoying 100 server limit
okay thanks
That is really gonna be a deal breaker for Dyno and mee6 unless they make deals with them
they're already verified and have intents
intents are a life saver for most large bots
@earnest phoenix I mean it says may limit to 100 servers
But is it hard to verify that reason? Can you just say (is not my case though) my bot sends welcome messages?
for unverified bots
Wait
just by being able to use intents to stop receiving presence packets, large bots were able to cut cpu and network usage by up to 90%
they were long overdue
So if I'm verified and get intents,I wouldn't be limited?
bots like dyno/mee6/tatsu/rythm are probably saving hundreds of bucks per month thanks to intents
huh but does that intent do something? I thought it was a permission to get that data
it's also nice that you can define certain intents for packets you want to receive, e.g. you may want to receive GUILD_MEMBER_ADD but not GUILD_MEMBER_UPDATE
So if I'm verified and get intents,I wouldn't be limited?
@nocturne grove
Maintaining a stateful application can be difficult when it comes to the amount of data you're expected to process, especially at scale. Gateway Intents are a system to help you lower that computational burden.
When identifying to the gateway, you can specify an intents parameter which allows you to conditionally subscribe to pre-defined "intents", groups of events defined by Discord. If you do not specify a certain intent, you will not receive any of the gateway events that are batched into that group. The valid intents are:
https://discordapp.com/developers/docs/topics/gateway#gateway-intents
someone can tell me how I can stop my bot with visual studio code pls
So if I'm verified and get intents,I wouldn't be limited?
@golden condor no, it would function normally
correct
discord by default sends you EVERYTHING
intents are a way to tell discord "send me only what i want"
you can sign up for it right now if your bot is in over 75 guilds
@quartz kindle I need to use intents then
they went over day 1 and day 2 applications already i think
you can sign up for it right now if your bot is in over 75 guilds
@earnest phoenix ik, I'm already verified
oh
Check my profile
@quartz kindle thanks. Maybe I'm confused now, but I'm seeing it as following now:
you can always (also with +100 guilds and after 7 Oct) use the events, but if you "want to consume less cpu power", you should get the intents.
My vision isn't right I guess
the intents are just to get the permission to use these events + consuming less cpu
not sure how it will be after oct 7, but for now your understanding is correct
I will use intents in my client
if discord makes intents mandatory, then it will be a different story
someone can tell me how I can stop my bot with visual studio code pls
okay thanks, but still confused
someone can tell me how I can stop my bot with visual studio code pls
@lofty lagoon maybe close visual studio code and launch node.js
but 🤷
presss ctrl + C in the terminal with the script running
just kill the terminal
is this not a thing at all in JS?
dynamic iterators?
or is my syntax just jacked up?
oh wait last question about the intents, if you're using one of them, are they enabled in your developer portal?
My bot has none of them enabled there
NOTE: This may limit your bot to 100 servers in the future. Read more here```
and that's disabled
they're automatically disabled
yeah but my bot is using guildMemberAdd and other events and things like guild.members.cache.filter()
if you depend on the user cache a lot, then yes you'd probably need the server members intent
my bot is working fine now without these things enabled, so I don't need them?
discord said that they're going to enforce intents in the future 🤷♂️
it's your choice
you'll eventually have to enable the intent though
and if you want to use it in over 100 guilds, you'll have to get verified
it is
ohh okay that explains it, that they want to enfore them. @earnest phoenix thanks again
?
it's your cache
flush it or use a different browser
When you use a browser, like Chrome, it saves some information from websites in its cache and cookies. Clearing them fixes certain problems, like loading or formatting issues on sites.
In Chrome
I don't see an icon too
Think he means the logo at the top of the page, not the favicon
Working now
yes that works here too
and if i want them to stop sending them, i add intents stuff in the client options? or
wait
sorry I barely understand it myself
How's it possible to change the output names of clientStatus?
For example if the user's clientStatus is { desktop: 'online' } change it to 🖥️ Desktop...
if (user.clientStatus.desktop == 'online') output = "!ONLINE ON DESKTOP!"
Hmm wait... <userdeclaration>.clientStatus.desktop or mobile or web is a function? @slender thistle
I don't speak JS, you might want to refer to the docs, I only gave you an overall idea
Hmm k lemme investigate then
for all following my fun times
I think I've finally reached my goal
that was a doosie of trial and error
How do you use intents on d.js
on d.js v12 just read the docs
I am not entirely sure
I was tryna find it and I couldn't find it in the options
nvm
I found it
Is it like this
const client = new Discord.Client({
ws:{
intents:{
//INTENTS HERE
}
}
})```
i know i was late
lol
Hello, How can I send embed with Webhook?
var respuesta = prompt('Digo algo que no sea un numero')
}
var segunda = parseInt(prompt('Ingresa un numero'))
alert('Boomer')
if (typeof segunda === number && typeof respuesta === string) {
console.log(respuesta)
console.log(segunda)
}
else {
console.log(`Hubo un error`)
01.js:4 Uncaught ReferenceError: number is not defined
at 01.js:4
bruh
typeof segunda == "number"
not typeof segunda === number
same with typeof resquesta === string
ok
xD
const client = new Discord.Client({
ws:{
intents:{
//do you put each intent here in an array?
}
}
})```
Clients are allowed 120 events every 60 seconds, meaning you can send on average at a rate of up to 2 events per second. Clients who surpass this limit are immediately disconnected from the Gateway
what exactly does this mean? that if i perform an action over 120 times in a minute i disconnect?
I found this, it's ok
https://discordjs.guide/popular-topics/intents.html
IntentsResolvable
Data that can be resolved to give a permission number. This can be:
- A string (Intents.FLAGS)
- An intents flag
- An instance of Intents
- An array of IntentsResolvable
why do you keep asking questions then answering them yourself 
const { Client, Intents } = require('discord.js');
const myIntents = new Intents();
myIntents.add('GUILD_PRESENCES', 'GUILD_MEMBERS');
const client = new Client({ ws: { intents: myIntents } });``` You do it like this?
yeah i knew i was getting mixed up, what exactly are gateway intents
That's what d.js guide says
IntentsResolvable
Data that can be resolved to give a permission number. This can be:
- A string (Intents.FLAGS)
- An intents flag
- An instance of Intents
- An array of IntentsResolvable
how i get the number 4 in this?
345
I need to add all intents
with %
you can do ```js
{
intents: ["GUILDS", "GUILD_BANS", "..."]
}
Does using a guild's emojis count as guild_emojis
Like not fetching the emoji
But just using the id
Like this
how i get the number 4 in this?
345
@earnest phoenix depends, how do you want to get it?
like emoji create
const client = new Discord.Client({
fetchAllMembers: false,
disableMentions: "everyone",
messageCacheMaxSize: 0,
presence: { status: "dnd" },
ws: {
intents: ["GUILDS", "GUILD_MEMBERS", "GUILD_BANS"]
}
});``` like this
with %
?
yes
@quartz kindle with %
GUILD_MEMBERS (1 << 1)
- GUILD_MEMBER_ADD
- GUILD_MEMBER_UPDATE
- GUILD_MEMBER_REMOVE``` Oh
I don't need it then
@grizzled raven so the privelleged intents only apply to events not methods
@earnest phoenix is the number always 345?
what are other possible numbers you can get? do you need to get "4" from all possibilities?
do you always need the second character?
not, i use prompt to the user put a number like:
245, 645 the 4 in de middle
so it is always the second character?
then number[1] if its a string, or number.toString()[1] if its a number
this is js or djs?
const { RichEmbed } = require('discord.js')
module.exports = (bot, oldMember, newMember) => {
if(oldMember.user.bot)return
let ChannedSend = bot.channels.get("703983082507599912")
let guild = bot.channels.get("535553754359922705").guild
if(!oldMember.user.presence.game && !newMember.user.presence.game)return
if(oldMember.user.presence.game !== newMember.user.presence.game){
console.log(" 2 event to trigger by : " + oldMember.user.tag)
}
}``` the event does not trigger, I'm on v11 (the presenceUpdate event)
this is js
ok ty
@golden condor putting an emoji into a messgae isnt a method
pretty sure discord does that
and takes care of whether the bot has access to the emoji to display ir
SyntaxError: src/jsx/Util/Utilities.jsx: Unexpected token, expected ) (45:56)
43 | if (player2.relationships.with(playerName) > 5 && player1.relationships.with(playerName) > 5) score += 3;
44 | else if (player2.relationships.with(playerName) > 0 && player1.relationships.with(playerName) > 0) score++;
> 45 | else if (player2.relationships.with(playerName) <= -2 && player1.relationships.with(playerName) <= -2) score += 4;
| ^
48 | }
Babel is screaming that this is wrong but my IDE doesn't, am I blind or something?
then
number[1]if its a string, ornumber.toString()[1]if its a number
@quartz kindle
toStringing a number takes time, why not just do arithmetic operations? divide by 10 and MOD it by 10
hmm lets see
yup, you are right, its much faster
however stringifying it is much easier to understand
Is it running in two instances?
?
When I type f = open("file.txt", "r") print(f.read()) can otput be without ( and '
It might be running twice is all I mean
@lofty lagoon show code
k
@earnest phoenix not sure what you mean. It should just output the contents of the file
That should work @lofty lagoon
the print screen button exists
@iron steeple but how I can stop my bot
do taskkill /f /im "python.exe"
You’re on Windows, correct?
yes
haha
Beat me to it
thn run bot again
Yeah it just looks to me like you are running one version of the new one, and one version of the old one
afcorse
What IDE are you using?
me?
@lofty lagoon I meant 🤭
I personally have a raspberry pi which works well enough for me
With 4K capabilities lmao
Oops!
@earnest phoenix it’s a tiny, power efficient computer that can run 24/7
where did you buy it
Amazon I think
price?
i've been thinking of making my home "smart" with rpis since it can easily run a webserver on it
You can get the newest one which can run two displays at 4K for around £50
ok
Which is probably $65
ok
but work
Yeah it works quite well although only has 1gb of ram
Really? Well I would highly recommend one
yes
how i separe 2 numbers?
like:
45```js
console.log(num1/4/)
console.log(num2/5/)
What can I add
shardId: process.argv[1],
shardCount: process.argv[2],
fetchAllMembers: true
});``` to my index.js?
@earnest phoenix u can check like this:
<@${message.mentions.users.first().id}>
Test

if(args[0] == `<@${message.mentions.users.first().id}>` || args[0] == `<@!${message.mentions.users.first().id}>` || )```
I don't really know if this can work but u can test

Nice
I think <@id> is only on computer
Or phone
Idk
Guys... If i use this function:
<clientname>.guilds.cache.get('GUILD ID').emojis.cache.find(e => e.name === 'EMOJI NAME')
and use it on an embed or message...
Will it bypass the USE_EXTERNAL_EMOJIS permission?
U can't bypass the permission @earnest phoenix
Hmm
But i think u can with a bot 
the desktop client pings with <@!id> while mobile pings with <@id> for whatever reason
discord ™️
Okay ty cry
@earnest phoenix yea i was talking about doing it with a bot lmao
@earnest phoenix no i've thinking and u can't 
@lofty lagoon I meant 🤭
@iron steeple 👀
Uhh
If the bot doesn't have the permission this is IMPOSSIBLE
Or i think u can used local images for test
there was a bug where bots can bypass external emoji permission by using emojis in an embed
i don't know if it's patched yet
Oh..

@earnest phoenix I'm thinking what discord staff was thinking when they were adding a ! For a ping format on a desktop and removing it on mobile...
I literally see no use on it
Lol i know why mobile and desktop are different on this thing
This is really stupid but wait
the ! format is legacy from 2016 discord, it used to indicate that the user has a nickname but ever since the public api exposure there's no point of using it and discord created an inconsistency with their platforms 
OMEGALUL
<@id> = if a role with empty name exist, u can't ping any user
But with the !
U can

Hard to explain sorry

@earnest phoenix that's not how ping formatting works lmao
How can I make my shard fit into my index.js?
Because it also includes const client = new which was already added
So if I add it and take the const client it'll give me an error
But how can I fix that
The index
Im trying to use:
shardId: process.argv[1],
shardCount: process.argv[2],
fetchAllMembers: true
});```
Oh..
shardId: process.argv[1],
shardCount: process.argv[2],```
If u use this
U need to use a thing like
node yourindex.js 0 1
Oh
shard.js
const Discord = require("discord.js");
const client = new Discord.Client();
const { ShardingManager } = require('discord.js');
const manager = new ShardingManager('./index.js', {
token: "token",
autoSpawn: true,
respawn: true
});
manager.on('launch', shard => console.log());
manager.spawn();
manager.on('launch', shard => (console.log(`[SHARD] Shard ${shard.id} / ${manager.totalShards}`)));```
Try a thing like this
Replace index.js by ur index
I already have a token in my index.js
This isn't a problem
So I add that into a shard.js file?
Put the same in the file
And
node shard.js
Yeah
And
const client = new Discord.Client({
shardId: process.argv[1],
shardCount: process.argv[2],
fetchAllMembers: true
});```
=>
```js
const client = new Discord.Client({
fetchAllMembers: true
});```
If u don't need to fetch all members
=>
```js
const client = new Discord.Client();```
How can I make a command that responds to all messages e.g. I write "hi" bot inscriptions "hello"
And after u can use events like:
shardDisconnected, shardReconnecting, shardResumed
But when I add that into my index.js it gives me an error because const client = new Discord.Client() exists
@earnest phoenix event message and verify the content
@raven urchin where u host ur bot?
e.g ?
glitch....
@earnest phoenix u don't know how to make it?
@raven urchin send me invitation i help u
i just saw can you give me example
@earnest phoenix i know but if u can't make it u can't make a bot
K
Can I trust you though.
K
resolved
thats only for gateway actions
@quartz kindle what exactly are gateway actions?
is it like connecting to the gateway and
sql.prepare("ALTER TABLE user ADD COLUMN dex TEXT;").run()
doesnt seem to making a new column
no error message
better-sqlite3
maybe try instertin into the column
Hi
Can you tell me where this code goes wrong? I'm trying to make a timer using Discord.js and I've used debuggers to solve the bugs and problems but no luck```js
function timer(arguments, receivedMessage){
var cnt = 0
receivedMessage.channel.send("ok it accually works" + arguments.length)
arguments.forEach((value) => {
receivedMessage.channel.send ("Value::::" + value)
//if (value == "start")
receivedMessage.channel.send("Timer for" + value + "has started")
setTimeout(
() => {
cnt = cnt+1
receivedMessage.channel.send("AHH IT RUNS ACCUALLY YAY!!!")
receivedMessage.channel.send("CNT = " + cnt)
},
1000 * 60
);
if (cnt == parseFloat(value)) {
receivedMessage.channel.send("Beep beep beep timer for "+value +"has ended!")
}
})
receivedMessage.channel.send ("Timer end")
}```
Here's what it did last time
Me: +timer 1
bot: ok it actually works1
Value::::1
Timer for1has started
Timer end
AHH IT RUNS ACCUALLY YAY!!!
CNT = 1
Doesn't go through ```js
if (cnt == parseFloat(value)) {
receivedMessage.channel.send("Beep beep beep timer for "+value +"has ended!")
}```
pls help
Im using an overwatch api to get player stats
https://www.npmjs.com/package/overwatch-stats-api
i have no idea how to get info in a way that is not json or console.log
can anyone take a look and help?
It uses API you said?
its an overwatch api ?
Ok
hmm idk what to doo with my bot rn
its pretty much feature complete because its a small bot made for one feature
Oh
ok
ya Idk how to do that
Hi Can you tell me where this code goes wrong? I'm trying to make a timer using Discord.js and I've used debuggers to solve the bugs and problems but no luck```js
function timer(arguments, receivedMessage){
var cnt = 0
receivedMessage.channel.send("ok it accually works" + arguments.length)
arguments.forEach((value) => {
receivedMessage.channel.send ("Value::::" + value)
//if (value == "start")
receivedMessage.channel.send("Timer for" + value + "has started")
setTimeout(
() => {
cnt = cnt+1
receivedMessage.channel.send("AHH IT RUNS ACCUALLY YAY!!!")
receivedMessage.channel.send("CNT = " + cnt)
},
1000 * 60
);
if (cnt == parseFloat(value)) {
receivedMessage.channel.send("Beep beep beep timer for "+value +"has ended!")
}
})
receivedMessage.channel.send ("Timer end")
}```
Here's what it did last time
Me: +timer 1
bot: ok it actually works1
Value::::1
Timer for1has started
Timer end
AHH IT RUNS ACCUALLY YAY!!!
CNT = 1
Doesn't go through ```js
if (cnt == parseFloat(value)) {
receivedMessage.channel.send("Beep beep beep timer for "+value +"has ended!")
}```pls help
pleaseeee help
try Number(value)
ok
ill try that
what the fuck is that indentation lol
idk
put it theough a beaifier
no
any idea why this happens? when i compare, its not up to date
in both branches this is what it is
wait actually
@grizzled raven how do you get bot developer
try again maybe it'll work the second time
function timer(arguments, receivedMessage){
var cnt = 0
receivedMessage.channel.send("ok it accually works" + arguments.length)
arguments.forEach((value) => {
receivedMessage.channel.send ("Value::::" + value)
//if (value == "start")
receivedMessage.channel.send("Timer for" + value + "has started")
setTimeout(
() => {
cnt = cnt+1
receivedMessage.channel.send("AHH IT RUNS ACCUALLY YAY!!!")
receivedMessage.channel.send("CNT = " + cnt)
},
1000 * 60
);
if (cnt == Number(value)) {
receivedMessage.channel.send("Beep beep beep timer for "+value +"has ended!")
}
})
receivedMessage.channel.send ("Timer end")
}``` correct?
























yes
now wait
until it gets accepted
stop
repeat*
Please do not spam.
how long does it take and ok i wont spam
1-2 weeks for a bot to be approved.
but this is development, so lets move somewhere else
code wont work
it is currently a bit less though. more like less than a week @earnest phoenix
ok
ok
This??? ```js
function timer(arguments, receivedMessage){
var cnt = 0
receivedMessage.channel.send("ok it accually works" + arguments.length)
args.forEach((value) => {
receivedMessage.channel.send ("Value::::" + value)
//if (value == "start")
receivedMessage.channel.send("Timer for" + value + "has started")
setTimeout(
() => {
cnt = cnt+1
receivedMessage.channel.send("AHH IT RUNS ACCUALLY YAY!!!")
receivedMessage.channel.send("CNT = " + cnt)
},
1000 * 60
);
if (cnt == Number(value)) {
receivedMessage.channel.send("Beep beep beep timer for "+value +"has ended!")
}
})
receivedMessage.channel.send ("Timer end")
}
so```js
function timer(args, receivedMessage){
var cnt = 0
receivedMessage.channel.send("ok it accually works" + args.length)
args.forEach((value) => {
receivedMessage.channel.send ("Value::::" + value)
//if (value == "start")
receivedMessage.channel.send("Timer for" + value + "has started")
setTimeout(
() => {
cnt = cnt+1
receivedMessage.channel.send("AHH IT RUNS ACCUALLY YAY!!!")
receivedMessage.channel.send("CNT = " + cnt)
},
1000 * 60
);
if (cnt == Number(value)) {
receivedMessage.channel.send("Beep beep beep timer for "+value +"has ended!")
}
})
receivedMessage.channel.send ("Timer end")
}```
oh
this?
should work, idk exactly what you're trying to do, just saw the arguments thing
timer
rying to make a timer
t
@amber fractal look 👀 ```js
timer(args, receivedMessage)
^
ReferenceError: args is not defined```
ur suggestion is wrong
arguments is reserved only in functions
if (primaryCommand ==
"timer"){
timer(args, receivedMessage)
}```
args isnt defined in the call
+timer <time>
ur suggestion is wrong
steven how you just gon let him diss you
change that args to arguments
ok
it's
in whole code?
dont
He isn't showing the code
I need help with my top.gg css, the votebutton and background color won’t change
<style>
#bot-details-page { background-color:blue; }
.votebutton { border-color:red; }
#title { color:purple; }
</style>
I can't help with the code I'm given, but I can tell you that you didn't define args before calling the function
@toxic plinth you should mention what you need help with
just saying you need help, doesn't help us
Wdym
ok
Fixed
let arguments = splitCommand.slice(
1
) // All other words are arguments/parameters/options for the command
👀
yes change it
it isnt taken cause i used it in whole code arguments
and no error
so
ya
doesnt matter if args or arguments
yes ik
just saying arguments isnt taken
argument is
wait
the other way around
brb
how i do !top with megadb?
@earnest phoenix #what do you mean
top of money
- first name money$
- second name money$
...
...
...
@restive furnace
wtf is megadb
better change to a real db
like which?
idk how to use sqlite
speaking of sqlite
sql.prepare("ALTER TABLE user ADD COLUMN dex TEXT;").run()
doesnt seem to making a new column
no error message
better-sqlite3
PSQL seems like a better solution 
@grizzled raven these are gateway actions/commands
the 120/60 rate limit is for these
I keep frequently getting this error
events.js:183
throw er; // Unhandled 'error' event
^
Error: unexpected end of file
at Gunzip.zlibOnError (zlib.js:153:15)```
No idea where that even comes from
looks like it's something to do with zlib
How would I catch it 😩
did you install zlib-sync?
unhandled error events can be caught via .on("error")
that doesnt look like discord though
collector.on("collect", async m => {
if(m.content === password){
await m.first().delete().catch(err => {
console.log("Impossible de supprimer le message")
});```
m.first is not a function
why?
#v11.5.1
the collect event doesnt give you a collection
so i remove first() ?
yes
I already listen for errors on the client
console.log(m)
Ok
@late hill which library and version of library?
hi i just have a question
on the bot's profile, we can display the server count, but on mine it display N/A
npm ls eris
@late hill
@earnest phoenix you have to post server count
it's on 0.9.0 still
thanks ^^
eris uses zlib for api requests
the error is coming from eris's request decompression
so
the file that handles api requests has been changed several times in the last 6 months
so try updating it
btw another question, in my bot, I have a music feature, but like after 2 minutes it marks the song as finshed but it is normally not
any suggestion ?
must be discord.js
i'm using v11 does the problem come from there ?
1|index | voiceChannelID: undefined,
1|index | speaking: false,
1|index | nickname: null,
1|index | lastMessageID: '704061537018708121',
1|index | lastMessage: [Circular *1],
1|index | deleted: false
1|index | }
1|index | }
@quartz kindle
yup
most people here have the same issue with that
like i do ytdl(url)
@earnest phoenix whats the beginning of the log
No worries. 🙂
thought i was in testing
ok I managed to find out while my sqlite table couldnt use order
position: 1,
parentID: '700619044079927348',
permissionOverwrites: Collection(2) [Map] {
wtf
https://pastebin.com/SVsWivNu @quartz kindle
database disk image is malformed
Im guessing I corrupted it?
I just made 2 new columns and this happens
I have a backup but Im really confused why this is happening
@earnest phoenix that looks like a channel, not a message wtf
thats not the full log
isn’t full log but m is supposed to be a message ... how can I do
@quartz kindle
m define is this
length: "9",
numbers: "5",
symboles: "4"
});
const filter = m => m.author.id === member.id && m.content === password```
no thats the filter
m is this, and its correct
collector does give you a message
so m.delete() should work
no x)
you want complete logs ?
yes
ok
how would i run a function that waits for a result in a for of loop
for me it runs it all at once and doesnt wait for a result
javascript
Hi guys i code my discord bot on python 3 and i wanted to know how do I do so that the activity of my bot is the ammount on guilds on wich he is idk if this is clear sorry for my bad english
so could anyone give me the command to put
we won't spoonfeed you code
for the moment i have this
we can guide you to your goal, but no one will spoonfeed you
await asyncio.sleep(10)```
my database became corrupted
this is why you don't use sqlite
my database became corrupted
@tired nimbus do you not have any sort of a backup?
yes
Bro i am not askling for spoonfeeding but for help
but Im still gonna remake the table
Im just gonna use a dB browser and filter out users who have more than 0
and then manually add their data back and the delete everything else
@empty owl show code
@tired nimbus I would recommend creating a script that duplicates or manually creating a duplicate of the database so that for instance your database corrupts you can revert to a backup
I have a backup but whenever I try to add a new column it results in corruption
how are you adding it?
sql.prepare("ALTER TABLE user ADD COLUMN ordering INTEGER;").run()
@tired nimbus better-sqlite3?
yep
ok ill try that
@quartz kindle ^
How can I change the widget style
Because I want to put this: &style=for-the-badge
Pls, I want help with that
which widget
discord or dbl
dbl
damn
i said i'll rewrite to d.jsv12 then shard but now im at 2100 guilds 
nm
now i have to force myself to do yukcy v11 sharding
rip
Yeah, I know that
But I want to change the style
Something like this:
How can I do that
that isn't dbl
Yeah, I know
But I want that style
Is posible or not?
you can't use something that doesn't exist
oh, :c
Ok, thanks
at best you can make your own cdn provider to generate that and put it on some small vps
ok
what you posted is shields.io, shields.io allows querying json data to generate an image which means you could use DBL's api to do it, however that would also mean exposing your API token to wherever you're providing the image
oh :c
Ok ok
@earnest phoenix i believe you can use the widget as json and code your own html element and style for it
there is also this
ok
guys
Your bot page mentions, or promotes NSFW functions in its descriptions. Please remove any mentioning of NSFW features.
is that include in help command ?
Wrong channel to ask, also
unless ur help command has nsfw content in it
sorry
you're not allowed to mention nsfw features in your bot page
however you are in the help command
ok thanks
can someone tell me where to write python?
in your bedroom, at the kitchen table, on the toilet.... anywhere
what site/app to write python on
There's plenty of IDEs and just text editors to write Python tbh
Sublime Text, PyCharm, Visual Studio Code, Atom
ok thanks
Ngl just searching 'getting started python basics' would of awnsered that question
ok thanks
hi guys so in my messanger this is where it gets the prefix for the custom prefix let prefix = bot.db.fetch(`prefix_${message.guild.id}`) ? bot.db.fetch(`prefix_${message.guild.id}`) : config.prefix
but the problem is if you dm the bot it gives an error so how would I make it so that if the channel type is dm then the prefix is db! ?
i tried to do if(id === null) { prefix = config.prefix } but it still gave me the same error
Not familiar with that language but something like ‘instanceof discord.DM’ but idk
im sorry but that dosent help
message.channel.type returns the channel type
Just check if the channel ID a Dmchannel
if (message.channel.type == "dm"

but how would I add that into https://discordapp.com/channels/264445053596991498/272764566411149314/704083637297217536 this code
Think logically
oh, spoonfeeding to himself
Check if channel is Dmchannel if yes use default if not use custom
@clever briar I write in python, I would recommend Atom or pycharm. Atom has a good extension call python run, and you just press F5 to run, but pycharm is built for python development and has more useful tools.
Litterally every python IDE has a direct run system in place
IDEs are just personally preference in the end
Unless you're doing high level work it won't affect you at all
put where in your bot?
copy the link and add it to your command
you need the png version, not the svg
how do i get the png version?
yes i just read that lol
hey
for (let f of jsfile) {
let props = require(`./commands/${f}`);
console.log(`Command ${f} loaded!`);
bot.commands.set(props.help.name, props)
if(props.help.alias) {
props.help.alias.forEach(alias => bot.commands.set(alias, props))
}
};```
does anyoneknow why this prints me this error out :
^
TypeError: props.help.alias.forEach is not a function
?
array
you sure
Does ffmpeg work for music commands? Cuz its website won't open?
yes
How do i install it then?
which programming language do you use
Python
When i open the ffmpeg website it doesn't load n says
"This site can't be reached
ffmpeg.org took too long to respond."
he sent you a mirror
Aaaaaa....
ffmpeg is back online
Okay ignore my old questions but does ffmpeg work on heroku???
Cuz my bot is hosted there 😅
I'm using Discord.net. How do I get the message object/details? The tutorials I'm using don't seem to knw
you can't
you can set your bots presence but you cannot make a custom status
that is not a custom status
that is game activity
yeah
which library do you use
which version
<Client>.user.setActivity()
how
hello i'm trying to make a stats bot but in a message not a vc so anyone know how can i define the message instead of VC
let EGC = client.guilds.get(`687018691023601726`);
let memberCount = EGC.memberCount;
let mcChannel = EGC.channels.get(`704091924809646100`);
mcChannel.setName(`${memberCount} عضو`)
dbl.webhook.on('vote'
How can I use Webhooks vote
@fluid orbit mcChannel.send(memberCount) will send it as a message to that channel
oh, thanks
No, because when I put my token, the console says an error
then you're doing something wrong lol
Yeah, but I don't know what
did you read this? https://top.gg/api/docs#jslib
I'm going to check the logs
did you read this? https://top.gg/api/docs#jslib
@quartz kindle yeah
more specifically this
ReferenceError: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 is not defined
This error appears
this'll be fun
@amber fractal
that looks like the start of a token that wasn't put in a string
Check your login statement and ensure you put your token in a string (at least in js)
@earnest phoenix tokens are always strings
otherwise your code thinks they are variables
do you know the difference between a string and a variable?
Is this Incorrect I'm getting an error?
if (!bot.user.hasPermission("CREATE_INSTANT_INVITE"))```
hasPermission can only be used on GuildMembers
You can also look at the typedefs for the permissions stuff
ok thx much
what's the best way to get content in quotes
ie "some text" and stuff would return ["some text", "and", "stuff"]
probably regex.
I could tell you how to ge tthe stuff in the quotes, but not in an array with the stuff without quotes (atleast efficiently lol)
i want to get what's in the quotes and just treat it as a single argument
One question
/"(.*?)"/g is good regex for it
can it be modified to support ' as well?
Is allowed to create commands, and keep unlocked untill the vote restarts (or expires)
/("|')(.*?)("|')/g but this would also match "some string'
there's probably a way to ensure it isnt like that, but idk it
that's fine
i just need to make it possible to type things with spaces as one arg
for role names
alright that works
could you suggest how to integrate it with my existing args? since right now if i do "role name" User#0001 User#0002 i get ['"role', 'name"', 'User!0001', 'User#0002']
and you get my point hopefully as i want to replace the first arg with the regex one
so do you want to execute it on an existing array of arguments?
yeah
i'm using a pretty generic method: const args = message.content.slice(prefix.length).split(/ +/g);
gimme a sec lemme see
m'kay
idek what I'm doing anymore
regex fries my brain
yeah idk, I would say join the array and extract the content, but Idk if that fits your needs
the use case is !add "role name" User#0001 User#0002 @amber fractal
so i want to get 3 args, being role name and User#0001 / User#0002
@earnest phoenix const message = new Discord.Client(); why are you making a new client
use your existing bot or client
why are you doing this
message should already be there in your event
// here
});```
you're not using that?
because if you aren't it's obviously not going to work
making a new client will do nothing
as a client is not a message, and has no content or channel
show your full code
https://oliy.is-just-a.dev/t6wrny_3717.png lol I made a stupid way to do it
it's super inefficient though
that's not your full code @earnest phoenix
i mean including the client and events and all
tony you want it like this yeah? https://oliy.is-just-a.dev/17r41_3718.png
yeah that'll work real well
i don't care about how efficient it is, it's only gonna be used in one server and occasionally
I used some nested loop stuff
¯_(ツ)_/¯
lang as in programming?
yeah
node v14
that's messy code
2 discord.client
const client = new Discord.Client();
const bot = new Discord.Client();
``` why
learn before you start making bots
they are wrong
follow it
nice friend
he isn't
function getArgs(str){
let result = []
let args = str.split(" ")
for(let i = 0; i < args.length; i++){
let content = ""
if(args[i].startsWith('"') || args[i].startsWith("'")){
content += args[i].slice(1)
for(let j = i + 1; j < args.length; j++){
content += ` ${args[j]}`
if(args[j].endsWith('"') || args[j].endsWith("'")){
i = j
content = content.slice(0, -1)
result.push(content)
break
}
}
}else{
result.push(args[i])
}
}
return result
}```
normally I wouldn't just post code, because spoonfeeding, but I think you know how to program lol
if you want it to work with passed arguments, just change the argument from string to args and remove the `let args = ...` part

he's somebody that you want to ignore because he doesn't know how to code properly
that's a fun chunk of code
but ty
I was trying to do regex like (["'])(?:(?=(\\?))\2.)*?\1 but my brain said nah
presence or status
like online or Playing x
Well setPresence works with both, use setPresence() with a correctly defined PresenceData object https://discord.js.org/#/docs/main/stable/typedef/PresenceData, ex
{activity: {name: "hi"}, status:"online"} would set the status to online and the presence to Playing hi
how to add html widget in discord.js embed?
are you posting your server count?
n o
Set channel permission which permission dose it need?
just add the source to the image in the embed
@sudden geyser how should i do that can you please tell me?
assuming you are using discord.js
well first go to your bot page on the site, click edit and scroll down
where you see somehting similar, copy and paste the link to the image but you need to replace .svg with .png for it to show up on an embed
ok that had nothing to do with djs but that's how you obtain the image
[Command("addchar")]
[Alias("ac")]
public async Task addchar(SocketUserMessage message = null){
if(message == null){
await ReplyAsync(";-; I'm not smart enough to figure out the rest...");
}
await ReplyAsync("Things went well ;v;");
}
Why does trying to use this with an argument cause an error when it says something along the lines "Message object not found"
@earnest phoenix https://top.gg/api/docs#widgets
what's the "safest" way to do a mass role addition operation?
hello everyone, is youtube api currently under limit today?
for those who have music bot whether youtube api limits daily exceeded today?
youtube api limits daily exceeded today means you've used that many api calls you're banned from using it until the next day
stop spamming the api to prevent it
ohh okay
what's the "safest" way to do a mass role addition operation?
@sick cloud if you're adding to a single member, set the roles the user has so you're only sending one request for many role changes.
if you're doing it for many users probably just a rate limit
Not sure if I am in the right channel, but I am new. Can someone help me with setting up Node.js on Ubuntu?
what version are you aiming for?
At least 12. I downloaded version 14.
you could try a tutorial like https://linuxize.com/post/how-to-install-node-js-on-ubuntu-18.04/
but use setup_12.x ofc
weird, the GIF I had set image as in my rich embed suddenly doesnt want to load

