#development
1 messages · Page 825 of 1
People all over are having issues getting their bots to login & connect?
@sturdy hamlet no
they're flagging ips, but made a horrible attempt at doing so (like they do with anything else, take the new UI for example) so they fucked up badly
precisely
I've tried hosting my bot off of 3 different isps & multiple ips
heroku?
no
or glitch
locally
. .,.
.
vpn?
yeah basically, i guess it was an attempt to flag ips from free hosting but they forgot... ips cycle through and are finite
LAST QUESTION HOW LONG HEROKU UNBAN MY APP IP
pls kill me
If that were the case, then so many more bots would be down, no?
i thought we already established this
@earnest phoenix
Oh, my b
dw
didn't see that
inviteanager can have a normal error too tho
but the biggest app
tru
invitemanager has competent devs who are able to handle errors without them crashing the entire app
wtf
fuck myself
stop with your lolis this is #development
db overflow maybe
don't worry, discord doesn't hate you - their staff team is in fact full of pedo furries
Why do you have the urge to mention lolis in #development
twice
=)) actually more than twice
ree
Y'all got any ideas on how I could go about troubleshooting this timeout error?
This chat sometimes becomes more than just a clusterfuck
vps
^
a good one tho
fiannly discord do not hate me more =)))
by the way if you like you can try my corona-chan
shit stats
@frank torrent
stop shilling
Any suggestions on vps?
@cerulean pebble nice now pls #memes-and-media
Advertisement is against the rules
we dont care about your bot
Thanks for the help btw
@sturdy hamlet pins pls
ty!
there's no one named ty here
oke
cry has committed die as he couldnt handle this channel
yay xD
rare 
i can see into the future
i said the other day that discord is going to start breaking more often because their servers can't handle the stream increase from 10 concurrent viewers to 50
fml
rushing to finish my sharding rework while my bot is hardstuck at 2500 auto-leaving all new guilds to avoid breaking it lmao
Oof
Oof
how can i completely remove one role's perms from a channel?
d.js
v11
it shouldnt effect other roles or members
just remove
remove or change perms?
Ever heard of the docs as well?
some people are either lazy or ignorant
Oof
do you know what is an URL?
yeah
then thats how you define it lol
man i've been trying all day
i'm so new to this
and i just need this bot to play music by command with url
get the url from the command and put it there?
yeah
wanna see the full code
take it from the command, and put it in ytdl
hmm
do you process arguments?
i only use const
do you have like let args = message.content.split(...)
nop
how do you get input from the command?
if (message.content.startsWith === "$play [url]") {
if (message.channel.type !== "text") return;
const voiceChannel = message.member.voice.channel;
if (!voiceChannel) {
return message.reply("please join a voice channel first!");
}
message.react("638384691975684106");
voiceChannel.join().then(connection => {
const url = require[url];
const stream = ytdl(url, { filter: "audioonly" });
const dispatcher = connection.play(stream);
dispatcher.on("end", () => voiceChannel.leave());
});
}
});```
it works if i manually put the url into the code
but not like this cuz i need to define the url
ok thats really really wrong lmao
ooof
message.content will contain the things you receive in the message
url will be whatever the user writes, its not a fixed value
oh dang
so your startsWith needs to account for that
im so stupid
out of " "?
then once the message passes that check, you need to divide the message content to extract the url from it
ie: let arguments = message.content.split(" ")
that will split the message by space, making it an array of words
like this: ["$play","whateveryouwrite"]
oh
then to get the url simply get the second item from this array
arguments[1] (1 is the second item, 0 is the first)
wait hold on
i have something similar to this to my other bot
no it isn't the same thing but i kind of got it
thank you!
This keeps on saying improper token has been passed this is acc annoying why isnt this working?
because an improper token has been passed
its not telling you that because it just wants to fuck with you
the token is quite litterally invalid xD
there is no "the program is wrong"
For some reason my now refuses to connect any ideas why this might be the case? Im using discord js for node js bot
Is it a code placed in the bot, or what? :(.
@weak parrot
what is the bot
@glacial ocean You need to use DBL api to post server count
@glacial ocean yes
ok thx .<3
Code in the code
@elder moss i dont think you're copy pasting the right token
Does .run even work
what
there is no client.run() in discord.js
.login
because that looks like python
@elder moss what language
What other reason could there be for my bot not connecting given that the token and syntax is all correct?
Like im getting a timeout
discord is flagging ips and preventing them from logging in
dont think tis flagging ips
it very much is
also how do i check that
My bot wouldnt login before a couple weeks ago but now its working fine.
Took a couple hours
well what are you using to host
if its glitch or heroku it probably is ip getting flagged
if vps etc... then probably somthing blocking
discord is incompetent to do anything properly so they mass flagged ips, a lot of those were local machines etc
what lang
js
using discord js
the bot server count shouldnt have anything to do with it right?
or which servers its in
if it suddenly stops working then it's not the code
if your code isnt made to handle high loads / optimised then it could be pretty easy to run into issues to a point
@modest maple ive like minimised the code to like the minimum
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if (msg.content === 'ping') {
msg.reply('Pong!');
}
});
client.login('token');
how are you so sure?
like its literally this
oh.
okay then yh its discord or network
i tried running it on a vps and it still doesnt like it
why my bots on glitch r completely fine
okay ive tried running in on google cloud compute engines
HEROKU AND GLITCH HAVE MORE THAN ONE IP
@\ハーリ-さん (CF8)#6621
still hangs
thank you for not actually @ing me <3
@median siren wdym hangs?
dang whats kpal doing here
</offtopic>
console plays handsman
try this: client.on("raw",console.log) and client.on("debug",console.log)
ok so minimize the raw to this client.on("raw",r => { if(r.t === "GUILD_CREATE") { console.log(r.d.name) } })
Its raw
hmm
Could the api be timing out due to there being too many servers?
how many servers
Like the bot is in 1500 servers
okay so its not sharding problem
whats sharding?
but the code above should show you which guild its hanging on
sharding is splitting your bot into multiple connections and/or processes
do u like sharding tim?
oh i see
so that each process/connection handles a part of the bot, and not the full bot
so basically making it concurrent?
[ws] [connection] Sending a heartbeat
[ws] [connection] Heartbeat acknowledged, latency of 150ms
[ws] [connection] Sending a heartbeat
[ws] [connection] Heartbeat acknowledged, latency of 252ms
...
okay so now its just sending heartbeats
bot still unresponsive
did it hang on a specific guild?
like the last guild that was logged
is it the same guild that it hangs on everytime you try to run it?
an anyone help me
how do I set carl bot to auto remove and warn discord server invites
regex
ask in the carl bot support server
@quartz kindle so is the last guild named the one its hanging on
and if it is that one why would it take so long?
is it always the same guild?
it may take a long time when the guild is very large for some reason
this happened with me yesterday, and it kept hanging on discord bot list
i just kept trying and it worked eventually lol
there is a way to bypass this loading, but it might break your bot if people try to run commands in the guilds hanged
i havent exactly tested this
who knows how to link a discord bot to roblox bot
Yea its the same one
like
to do stuff in roblox
use your discord bot to use kicks and bans in a roblox group
do you use a NPM?
some one pls help me
Hi, users seem to be getting very confused as to how to use my bot... They don't seem to read the help info and keep getting the commands wrong. Is there any tips for how to make my bot more user friendly?
guys
@vagrant tree Whats ur bot name and prefix in here. I wanna test it
Please, someone help me.
my guy
understand
that we dont all make roblox bots
because why the fuck would that be a useful thing
LOL
@zenith terrace its called smart shopper and prefix is s! as in s! info
Ok
@vagrant tree doesnt seem that complicated from me just doing the s! info and s! search
@vagrant tree can u explain further?
if u r giving info like
[prefix] [space] [command]
it would be more understandable
and an example of the cmd would be ever better
@modest maple I mean
Make a discord bot that links to a game
so like
you do a command in discord
We get what you mean you don't need to spell it out
@elder moss not possible I think
then the action will take place in something like minecraft or roblox as a example
actually
@finite bough its possible because i know bots that do it
@finite bough I think that's what it's doing eg s! top
@median siren whats your discord.js version?
@elder moss example?
the verification bots and etc
@vagrant tree that's pretty self explainotary
like RoVer
@zenith terrace maybe I need to find more engaging users somehow
ClanClabs
they kick u from roblox groups?
That uses web scraping it has nothing to do with the game
All they do is scrape the roblox website
ClanClabs can
^
@vagrant tree find smarter ones
nothing shows up in google
roblox is a particular platform
im just asking you guys if you know how to do it
We don't
@earnest phoenix Refer to #502193464054644737 from now on, but ^
Can you make commands case insensitive?
@vagrant tree i'll tell you one thing. the average bot user is fucking stupid
not much you can do about that, besides maybe be stupidly explicit and descriptive in your help command, and give them a ton of examples
@quartz kindle 7.39.0
@median siren umm wat
whoops
lmao
"discord.js": "^11.6.2",
@elder moss hint: rule 3
@vagrant tree .toLowerCase()
In discord.py?
@cursive dagger dats why i deleted it ...
all g
how do i stop people from shitposting in #development
@mossy vine corona virus
Oh no he said the C word
Can you have different syntaxes for the same command e.g with a space and without a space?
@median siren try this: js setTimeout(() => { client.ws.connection.triggerReady(); },30000);
it should force itself to be ready after 30 seconds
not sure if this will work tho
Est ce que vous savez comment réactiver invitemanager
Aigh lemme try it out
idk whats going on then
try using discord.js v12.0.2
do you have anything else installed in you package.json?
yea but that shouldnt make a difference
i transfered the code to a new bot
and it works fine with that one
This server can't help you with invitemanager issues, this is a server for the developers of all bots on the website @earnest phoenix
Would also be cool if you didn't assume that everyone in this world understands the same language as you
We clearly use English here
@median siren you mean another token/account?
then its likely a discord problem
it happened to me yesterday on 2 bots
but the weird thing is that both were hanging on very large guilds
so there is something wrong with discord when sending large guilds
and since discord itself is split into hundreds of servers, it might be affecting only a few applications lol
okay i managed to get it to work by forcing the readystate like u said
so im just gonna leave it like that for now
@quartz kindle thanks for your help btw its hard to find ppl to acc know what their talking about 😅
👍
interesting, I seem to have a problem where some specific guild keeps dropping (going unavailable)
then what's even weirder, is that I keep recieving gateway events in batches. where it goes silent for 2-15s and suddenly sends a ton of events.
Yet the gateway latency is ~100ms. Only on 1 app. and the general latency (message response time) skyrockets
I'm getting over 5s in most cases and it's really bugging me
discord going bonkers
It's been like this for over a week
do you know anyone specifically that I could contact about that
it shouldn't act like this, especially only on 1 specific app
Oof
i guess emailing them is the only way
alright, I'll do that
I've been getting frequent timeouts for 2 days now
me too
were my frequent timeouts now the cause of this outage
gateway just went kaboom
Getting invalid session
Yeah
yup
Discord has some sort of issue at least once per week.
My bot can log in now, that may be temporary.
Welcome to Discord's home for real-time and historical data on system performance.
Discord.js have a inviteCreate and inviteDelete events? I can't find this events.
you weren't looking hard enough, or, well, haven't been looking at all
@low bolt in v12 yes
only v12?
yes
Yes
Pp
There is changelog
Frech
Frech please
@summer torrent i want to ask smh
there is a big changelog between v11 and v12, like every code is changing. Or only little things
?
Just check this changelog
Also yes, changes are big
tysm cry
i still use discord.js v10
why
i'm used to it's code
i hate to change the whole code to make the bot working again
it's best to update as soon as a new stable version comes out
I will only change when the time comes
ah so you have to update more and not be ready. Got it
I'll just have a project of V12 ready whenever that day comes
that's the best idea
which is soon because discord is switching to v7 gateway as the main gateway this year probably lol
Oof
I was getting this error with this segment of code when the discord API got fixed
let prefixes = JSON.parse(fs.readFileSync('./prefixes.json','utf8'));
if (!prefixes[message.guild.id])
prefixes[message.guild.id] = {prefix: Config.prefix};
let prefix = prefixes[message.guild.id].prefix;
i looked in that prefixes file and it was completely empty, which i found strange
i got a backup of that loaded so its fine but im wondering what caused that
Imagine that code failing on DMs because the guild is null 😔
the json is formatted correctly, since the code is functional right now
it was erroring because it was empty
that error tells us otherwise
alright ill grab the json file
only change i did was changing all the server ids to the word guild for privacy reasons
otherwise this is exactly what it looks like
headache warning: its all in one line
JSONLint is the free online validator and reformatter tool for JSON, a lightweight data-interchange format.
Your best friend when it comes to formatting json
If it says it's valid then maybe the error is somewhere else
i guess i wont find out what it was until discord goes down again
That is weird the error suggests the json failed to parse
if i take a look at the file changes it seems the prefixes file was completely cleared around the time of that error
i cant see an exact point unfortunately so no way to truly see if it happened after or before
Make it log every json it creates
If an erro occurs, you'll see what json was outputted
Don't make that permanent, obviously, just keep it until you pinpoint the error
actually hold on
when guilds become unavailable they trigger the guildDelete event right?
Guild left yes and the guild joined
But there is a bool variable on the event you can use to filter that
ahh right i forgot to filter that
my bot deletes a guild's data so i guess every server had an outage and everything got removed
but wouldnt the if statement here have fixed that?
let prefixes = JSON.parse(fs.readFileSync('./prefixes.json','utf8'));
if (!prefixes[message.guild.id])
prefixes[message.guild.id] = {prefix: Config.prefix};
let prefix = prefixes[message.guild.id].prefix;
unless you just cant read an empty file
the undefined:1 at the start of the error suggests that
Just a question...
How can i turn a link to a clickable short text in an Embed?
(Discord.js)
Example:
Link: https://top.gg => Click Me
Hmm like this?:
.addField("Link:", `[Click Me](link)`)
? @slender thistle
yes
where is my telescope
Hmm
`x`y`q`
The wot...
Or is that how it works in JS 
Hmm lemme try something...
s = 123
123
a = `s${s}`
"s123"
a = `s`${s}```
SyntaxError: unexpected token: identifier
debugger eval code:1:7
`s = ${s}`
"s = 123"
great
Hmm... Imma try something...
dude
that error
it fucking says
you added an extra `
it looks like this `)`) should look like this )`)
Welp i fixed it before you said that... Hmm just noticed...
ah yes
can you seek with ytdl? or do you need to re-create the stream?
I have question tho...
Why does my command output is like when users use command except for the owner of the server? Is something wrong here?
Hum...wrong server?
Wdym?... I mean like it's my bot and could i show the code and you guys look at to see what's wrong in my code?
What is it?
And the thing is that they can use the command but when they mention someone that happens...
K
Also the log at 20:31
@lyric mountain
Dude
Yea?
Just a question:
Why are you using an array to get the percentage instead of a rng function?
Hmm... Idk... It just works anyways but can you help me resolve the issue?
Still reading
Kk
Kk
Hmm... But i've seen so many people use === instead... Hmm want me to try that?
0 = nothing, emptiness, void
> 0 = anything, something
You're blocking it from adding the actual fields if someone is mentioned
Hmm i mean like should the === be removed and replaced with > 0 or
Like this ===> 0?
> 0
Oh ok... Lemme try that...
And btw, use Math.round(Math.random() * 100)
That'll get you a random value between 0 and 100
Math.floor is 0 - 99 right?
Yep
Hmm like the array function is not even needed right?
correct
And math.ceil for 1-100
Hmm... So if i use math.floor it will give me a number between 0-100?
Like: 0/67/99 (will it give out 100 too?)
Or if i use 101 instead of 100 it will give me a 100?
> greater than
< lesser than
== equal to
=== same type and equal to
=> equal or greater than
=< equal or lesser than
Just a table for you to save
I got this one
@earnest phoenix Math.random() returns a value between 0 and 1
it this channel for help?
If you ceil it, the result will be rounded up, so in this case 1 to 100
If you floor, the value will be rounded down, in this case 0 to 99
If you round, it'll be rounded to the nearest integer, so 0 to 100
Math.floor(1.4) = 1
Math.floor(1.5) = 1
Math.round(1.4) = 1
Math.round(1.5) = 2
Math.ceil(1.5) = 2
Math.ceil(1.4) = 2```
Math.floor(1.999999999) = 1
Hmm... Oh i got this thing... Like did you see the first phrase of code i wrote right?
(Message.mentions.users.first() === 0)
That was used to give the bot the ability to give response to the message.author itself without mentioning anyone... @lyric mountain
When I don't use that it doesn't respond to the message.author itself without mentioning anyone...
Wdym?
Like, if noone is mentioned then use yourself as a target, ELSE use the one mentioned
Because there are only two possible outcomes here:
Either noone is mentioned or someone is
Try using else
if i want my bot to join a channel, do i need to download something specific?
Hmm... Like should i change the if to else if?
Hmm...
@dull terrace salon?
Channel sorry
Do you mean a server?
You need to use the invite url of the bot
This can be found in the discord dev page
To join a voice Channel ?
Ah, that's different then
discord js?
Py
anyone here know py?
@lyric mountain but the thing that you said "change the whole if (...) to else" got me a little confused...
I change it to something else you mean?
If you meant that then what should i change it to?
I've been looking for a solution for several months now, I wonder if I should download something
@earnest phoenix just a sec
Kk
@dull terrace there should be a discord py function to join a voice channel, I dont know what you mean by download something
I'm really happy with myself for the bot I created, but I just miss the fact that it can join a voice channel x)
I have to confuse with something else then, I will continue my research on the documentation
if (message.content.includes(userhg)) {
//CODE
}
```to
```js
else {
//CODE
}
@lyric mountain if you look at my code... Do you see the let userhg;
And below it there's a userhg = message.author;
Should i remove the message.author? Like does it make sense to have? (Because message.author can't be included in a message right?)
You don't need it at all
K imma remove that
Thing is, you gotta think about your logic:
If noone is mentioned, then show this embed
Else show this other embed
I dont understand the reason for some of the code, wouldnt you just figure out whether to define the user as the author or the mention, then just use the variable's tag?
The way youre doing it is:
If noone is mentioned, then show this embed
If someone is mentioned and is the same as the previously assigned user then show this other embed
Hmm... My logic is a bit weird but welp... Here i go changing all the code again...
RIP
No no no, no need for that
You'll learn what's better for your code as you evolve your bot
Don't do it all at once
It might break it
I mean like the other ones (commands) are like that too so...
Fix one thing at a time
Hmm... K... Lemme try... Thx for the help anyways...
Guys I want a bot
it got everything
. like probot
. invites
. giveaways
. broadcast
.credits.....
hooooo can do this?
for free? nobody
I smell money
don't spam pings
you what?
I only accept republic credits
i dont know what is a credit bot
Define credit and broadcast
Btw it's discord.js
is it possible for you to copy it all and send it in code blocks in discord?
\`\`\`js
\`\`\````
Hmm but wouldn't it be counted as code spam?
delete the images
as long as you are not spaming code asking for solutions to problems that you don't know
bot.on("guildCreate", async (guild) => {
const channel = getDefaultChannel(member.guild);
const { gblacklist } = await con.prepare('SELECT blacklist FROM config WHERE guildid = ?').get(guild.id);
if(gblacklist == 1) {
let lembed = new Discord.RichEmbed()
.setTitle("Guild Blacklisted.")
.setDescription("If you wish to appeal please [click here](https://discord.gg/PdATjD2)")
bot.guild.leave()
channel.send(lemebed)
}
let guildID = bot.guilds.get('655662521486934026')
if (guild) {
channelID = guildID.channels.get('681377032806072354')
}
channelID.send(`${guild.name} | ID: ${guild.id}`)
await con.prepare('INSERT INTO config (guildid, premium, prefix, blacklist, time) VALUES (?, 0, ?, 0, null)').run(message.guild.id, config.prefix);
});
How could a fetch a default channel?
for a guild?
Yes.
Or any text channel the bot has access to.
I'm trying to send the message to the default channel.
@earnest phoenix what's the error?
@earnest phoenix in one sec I need you to delete it
MILLION i have no error btw. I'm just not sure how to do it.
ik
if (cmd.toLowerCase() === `${prefix}userinfo`) {
let useri;
if (message.mentions.users.size) {
useri = message.mentions.users.first()
} else if (args[0] && !isNaN(args[0])) {
useri = bot.users.cache.get(args[0])
}
let userembed;
if (message.content.includes(useri)) {
userembed = new Discord.MessageEmbed()
.setColor('#0033ff')
.setTitle('User info')
.setThumbnail(useri.displayAvatarURL())
.setAuthor(useri.tag)
.addField("**Name:**", useri.username, true)
.addField("**Discriminator:**", useri.discriminator, true)
.addField("**ID:**", useri.id, true)
.addField("**Avatar link:**", `[Click Me](${useri.avatarURL()})`, true)
.addField("**Status:**", useri.presence.status, true)
.addField("**Registered on:**", useri.createdAt, true)
.addField("**Joined on:**", message.mentions.members.first().joinedAt, true)
.setFooter(`Requested by ${message.author.tag} | Created by [ dank ] Voltrex Master#3587`, message.author.displayAvatarURL())
if (useri.bot) {
userembed.addField("**Is this user a bot?:**", "Yes", true)
}
if (!useri.bot) {
userembed.addField("**Is this user a bot?:**", "No", true)
}
if (useri.presence.activities.length) {
userembed.addField("**Currently playing:**", useri.presence.activities, true)
}```
you are on phone but it has colors for me on pc
Colour = helps
alright delete it please and thanks
Now how can i make it show user info about the mentioned user by their IDs?
Hmm
so you would first to check if there is an args
and if there is, check if it is an ID
MILLION. Just to ask
bot.on("guildCreate", async (guild) => {
guild.leave()
}
Would this work?
@crimson vapor what's the code for that?
I think but wouldnt that be counterintuitive?
just a tip (this could be fixed), if you add ?size=4096 to the end of the avatar url you can get a full-res version of an avatar
I would like to see your solution to the problem
Hmm
${useri.avatarURL()}?size=4096
make a function that checks for the user
.addField("**Avatar link:**", `[Click Me](${useri.avatarURL()})`
This works in JS?
Isn't it only a description thing.
Hmm... Welp imma try to make a function that checks for the id in args
@pine aspen yes it works...
That's cool.
Yea...
have you created a function?
how I get user for rewarding users in on_dbl_vote
That's not my bot
Yes
Link please?
Is corona-chan your bot?
yes
Damn, how is your bot more popular than mine? Mine's only on 32 servers
@pallid vector data['user']
do I need to use a webhook or something to use it? sorry i'm confused 😔 @slender thistle
or is data['user'] enough
data contains user_id?
Wrong channel?
@slender thistle ah alright, I haven't really touched webhooks at all 😭 what would I put for the port field?
"greater between"
Excuse me
lol
bot.on("guildCreate", async (guild) => {
guild.leave()
}
How'd i do to fetch/get a guild default/open text channel?
How do I make it so that if a user is not found, the bot will check on another shard to see if the user exists there before declaring it’s an unknown user? I am using discord.js v12
@pine aspen <Guild>.channels.cache.first() might be a way
SunSOG sorry i can't help. I'm not experienced in sharding.
Ok.
@earnest phoenix, so that'll just check. Will i have to check for permissions inside of that?
shiro, that short desc has more grammar mistakes than my friend has freckles
How do you make a vote thing for your bot on the website
Does anyone have a good way of matching images inside a image.
CPU: ${(process.cpuUsage().user / 10000 / 1000).toFixed(2)}
this or
CPU: ${(process.cpuUsage().user / 1000 / 1000).toFixed(2)}
@copper cradle
hey my friend i need sp
set CPU percentage
i need help with censoring some words but not censoring others. this is what i have but its not working how i want it to (this function is called when a message is sent; sheet is censored words, sheet2 is bypass words). im using google sheets and discord.js (tag me)
async function checkLanguage(msg){
const doc = new GoogleSpreadsheet('1EdJAfvXtA0DK9ZsifJ6w41dDmbva7E9GhXNO0FuSw1w');
await promisify(doc.useServiceAccountAuth)(creds);
const info = await promisify(doc.getInfo)();
const sheet = info.worksheets[1];
const sheet2 = info.worksheets[2];
var cells = await promisify(sheet.getCells)({
'min-row': 2
});
var cells2 = await promisify(sheet2.getCells)({
'min-row': 2
});
var bypass = false;
for(const cell of cells){
if(msg.content.toLowerCase().replace(/ /g, '').includes(cell.value) && msg.author.id !== '608417989464817675'){
for(const cell2 of cells2){
if(msg.content.toLowerCase().replace(/ /g, '').includes(cell2.value) && msg.author.id !== '608417989464817675' && !(cell2.value.includes(cell.value))){
bypass = true;
} else {
bypass = false;
}
}
if (bypass === false){
bot.users.get(msg.author.id).send('Please don\'t use that word ("'+cell.value+'") in LimitedNik\'s Fan Group!');
msg.reply('Please don\'t use that word!');
bot.users.get('335937477997101056').send(msg.author+' (<#'+msg.channel.id+'>): '+msg.content);
bot.users.get('378683529187295233').send(msg.author+' (<#'+msg.channel.id+'>): '+msg.content);
msg.delete();
}
}
}
}
can we send richembed from webhook?
D.js v11
It's done slightly different.
I am asking can i send it directly?
Wow Nice answer thanks a lot for help
Did it work?
I have a problem with ytdl and my music bot : idk how I can handle invalid videos.
here is my code
check if it has thumbnail for example and if not then return error
the problem is returning the error without stopping the queue process prematurely
with playlists
I don’t code stuff with js so can’t be helpful for you, sorry
But you are now in the correct channel to get help :D
you want cpu usage of the bot, or of the entire machine?
getting cpu usage with process.cpuUsage is a lot more complicated than that
oke
process.cpuUsage returns the time in milliseconds that the cpu was used by the system, or the process, since the last measurment
so you need to measure once, save it in a variable, then measure again after some time, then compare both results, and see how much time the cpu was being used by "user" compared to "system"
but in the picture 1 or 2 is correct
both are wrong
this is how i do it (it requires an async function)
let CPU = Number(Math.round((await new Promise(async r => {
let start = [process.hrtime(),process.cpuUsage()];
await new Promise(r => setTimeout(() => r(),100));
let elap = [process.hrtime(start[0]),process.cpuUsage(start[1])];
r(100.0 * ((elap[1].user / 1000) + (elap[1].system / 1000)) / (elap[0][0] * 1000 + elap[0][1] / 1000000));
}))+'e2')+'e-2')```
wat
hm
how do you set the webhook authentication?
I'm hosting the bot on a vps, I'm not sure what to put for the authentication, is it normally default set to no pass
you mean dbl/top.gg webhooks?
in dbl.DBLClient right?
in the code
I just don't know where that password is needed or required
hmm might get back to you on that later, ty though
and also, since I'm sometimes running my bot on my pc
instead of vps
is it possible to set 2 places
for webhooks no, you can only set one url
ok tyvm
try it
also process.memoryUsage().heapUsed is inaccurate, thats only the bot's internal memory
the full memory used by the process is process.memoryUsage().rss
hey how do you verify if your code is working or not with test? nothing shows up on my console right now for on_dbl_vote
@commands.Cog.listener()
async def on_dbl_vote(self, data):
print("voted")
logger.info('Received an upvote')
print(data['user'])
user = self.bot.get_user(data['user'])
try:
await user.send("Thanks for voting!")
except:
pass
this is what I have but it's not doing anything, I'm suspecting im doing something wrong
in the webhook
i believe the python lib has a specific function for testing: on_dbl_test
oh hmm ill try that ty
I tried for a hour how to handle invalid videos with ytdl (like deleted ones/privates ones), but I cant find a working solution
https://prnt.sc/rhnqfe I tried this, but it doesnt work : it says that everyhting has been queued, but the queue remains empty
still doesn't print anything :/
what do you have in your URL?
or
Nouvel album "Carré VIP" disponible. CD collector/Stream/Download : http://naps.ffm.to/carrevip
Abonne-toi à la chaîne ici : http://bit.ly/2kiGDEx
Inscris-toi à la newsletter ici : http://eepurl.com/cX8fi1
Album "On Est Fait Pour Ca" : http://naps.lnk.to/OnEstFaitPourCa
Album...
it takes playlist ID, and then do his work
@quartz kindle looks like this:
self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='ip_address:5000/dblwebhook', webhook_auth='DBL_PW', webhook_port=5000)
i meant the URL you put in the top.gg website, but thats also wrong btw
webhook path should only be "/dblwebhook"
or "/whateveryouwant"
and #topgg-api is the correct channel for this actually
oh
bruh hello how do you put your dbl widget into an embed
Lol
boi
add it as an image
ok
make sure it's the png variant
h o w
d o c s
o h o k
\
\
@quartz kindle tks Tim =))
i will make prenium command free for you if you use my bot
stop advertising your bot
=))) oke why you hate me =))
How do I setup the bot?
read docs
Where?
change the anime profile picture back cry
@pale vessel that's big bro
@pale vessel the annoyance of having to tell people to read docs 😂
@zenith terrace a perfect meme for you to use
just need to replace "our" with "the"
Here's a blank one to make your life easier
Put memes in #memes-and-media please
Does anyone know the best way to prevent someone from intentionally spamming your bot?
Ratelimits
@coral trellis srry 
without using message.reply, how do you put a message and a embed at the same time?
nvm found out
Thanks, i've limited it 3 times every 10 seconds now, hopefully my bot doesn't die anymore due to spam
Something really weird happens to my code.
const { blacklist } = con.prepare('SELECT blacklist FROM config where guildid = ?').get(guild.id)
if (blacklist == 1) return;
if (blacklist == 1) {
//embed code
}```
```js
if (blacklist == 1) return; //Works fine
if (blacklist == 1) { //Says blacklist is undefined
//embed code
}```
Hello, how can I check has my bot permissions to add a some role to member? (Discord.js)
true
const blacklist = await con.prepare('SELECT blacklist FROM users WHERE userid = ?').get(message.author.id);
if (blacklist != 0) {
let lembed = new Discord.RichEmbed()
lembed.setTitle("Guild Blacklisted.")
lembed.setDescription("If you wish to appeal please [click here(https://discord.gg/PdATjD2)%22")
return message.channel.send(lembed)
}
So like this?
bot.on("guildCreate", async (guild) => {
const response = await con.prepare('SELECT * FROM config WHERE guildid = ?').get(guild.id);
let blacklist = response.blacklist
console.log(`[DEBUG] ID: ${guild.id}`)
console.log(`[DEBUG] Database: ${response}`)
console.log(`[DEBUG] Blacklist: ${blacklist}`)
if(blacklist != 0) {
let lembed = new Discord.RichEmbed()
.setTitle("Guild Blacklisted.")
.setDescription("If you wish to appeal please [click here](https://discord.gg/PdATjD2)")
guild.channels.sort(function(chan1,chan2){
if(chan1.type!==`text`) return 1;
if(!chan1.permissionsFor(guild.me).has(`SEND_MESSAGES`)) return -1;
return chan1.position < chan2.position ? -1 : 1;
}).first().send(lembed).then(guild.leave())
}
let guildID = bot.guilds.get('655662521486934026')
if (guild) {
channelID = guildID.channels.get('681377032806072354')
}
channelID.send(`${guild.name} | ID: ${guild.id}`)
await con.prepare('INSERT INTO config (guildid, premium, prefix, blacklist, time, welcomeid) VALUES (?, 0, ?, 0, null, null)').run(guild.id, config.prefix);
});
@copper cradle yeah.
Blacklist is undefined now...
so what did you guys do about guilds that keep hanging
?
guilds that don't become available and cause shards to keep disconnecting/can't enter ready state
that... shouldn't be a problem
gateway sends READY regardless if guilds are available or not
which lib are you using
its an issue for discord.js
because the library does not enter ready state until all guilds are cached
Doesnt not
@_@
Is this the correct way to apply imageurloptions ?
guild.iconURL({
format: "png",
size: 1024,
dynamic: true
});
Yes
log message content
Does the bot have a nickname
def check(reaction, user):
return user == message.author and str(reaction.emoji) == '🟢'
try:
reaction, user = await client.wait_for('reaction_add', timeout=None, check=check)
except asyncio.TimeoutError:
TimeOut()
else:
DoSomething()
Hey, it's weird but it looks like only me can trigger the emote add
When another user clicks the emote nothing happens
Isn't message.author the bot?
I hightly doubt the bot will listen to its own messages
Considering only you can trigger it
:^)
I hightly doubt the bot will listen to its own messages
it does
So message.author is me, and user is me. Problem is when I remove the condition I can't trigger it (nobody in fact) anymore
message.author is the one who created the message
Because user is you
and message.author is you because you're the one who sent the message that triggered the event
It's a reaction
you == you
Is the reaction considered as a message lol
reaction is reaction
Yeah
Are you doing this under on_message
Yes
it should be return message.author == reaction.author

I mean it sends a message adds a reaction on it
And listens for another reaction add
So how to make it so everybody can trigger the event
On reacting
Not just me
just remove that check
return user == message.author and str(reaction.emoji) == ':green_circle:'
to
return str(reaction.emoji) == '🟢'
Yeah the problem is when I do return str(reaction.emoji) == '🟢' only
Nobody can trigger it
Which is weird
have you tried debugging it?
No error output
that's not a debug
if you add a breakpoint there you'll see the exact variable values at the time that method is called
what IDE are you using?
Atom
set_trace() ?
what should I print
yes
lol
Essentially almost everything you think is wrong
The real debugging
reaction, user, reaction.emoji, etc.
Gonna start with that
Lol nonsense
It just worked
With the print
Tried 5 times before without editing anything else
yeah, like jetbrains' IDEs
all of the varible from stuff getting passed from one lil dot
What IDE?
kek
lol
/hack
jetbrains is the company, the IDEs are pycharm, webstorm, intellij, etc
enter email ---sagar@gmail.com
{'global': False, 'message': 'You are being rate limited.', 'retry_after': 70291}```
What is this erore
send(response['message'])
retry after 70291
