#development

1 messages · Page 825 of 1

pale vessel
#

yes

#

corona

#

ok.

#

stop.

sturdy hamlet
#

People all over are having issues getting their bots to login & connect?

pale vessel
finite bough
#

@sturdy hamlet no

earnest phoenix
#

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

sturdy hamlet
#

ok

#

they're just flagging ips rampantly without a second thought?

finite bough
#

precisely

sturdy hamlet
#

I've tried hosting my bot off of 3 different isps & multiple ips

finite bough
#

heroku?

sturdy hamlet
#

no

finite bough
#

or glitch

sturdy hamlet
#

locally

finite bough
#

. .,.

sturdy hamlet
#

.

finite bough
#

vpn?

earnest phoenix
#

yeah basically, i guess it was an attempt to flag ips from free hosting but they forgot... ips cycle through and are finite

cerulean pebble
#

LAST QUESTION HOW LONG HEROKU UNBAN MY APP IP

earnest phoenix
#

it isn't heroku

#

it's discord

finite bough
#

spongery pls kill me

sturdy hamlet
#

If that were the case, then so many more bots would be down, no?

earnest phoenix
#

i thought we already established this

sturdy hamlet
#

@earnest phoenix

earnest phoenix
#

yeah

#

someone stated here that invitemanager is down

sturdy hamlet
#

Oh, my b

earnest phoenix
#

dw

sturdy hamlet
#

didn't see that

cerulean pebble
#

ah

#

2/3 app

#

can run

finite bough
#

inviteanager can have a normal error too tho

cerulean pebble
#

but the biggest app

sturdy hamlet
#

tru

earnest phoenix
#

invitemanager has competent devs who are able to handle errors without them crashing the entire app

cerulean pebble
#

discord x heroku hate loli girl like me fuck

#

fuck discord

pale vessel
#

wtf

cerulean pebble
#

fuck myself

pale vessel
finite bough
#

db overflow maybe

earnest phoenix
#

don't worry, discord doesn't hate you - their staff team is in fact full of pedo furries

slender thistle
pale vessel
#

twice

cerulean pebble
#

=)) actually more than twice

pale vessel
#

ok stop

cerulean pebble
#

ree

sturdy hamlet
#

Y'all got any ideas on how I could go about troubleshooting this timeout error?

slender thistle
#

This chat sometimes becomes more than just a clusterfuck

pale vessel
#

vps

finite bough
#

^

cerulean pebble
pale vessel
#

a good one tho

cerulean pebble
#

fiannly discord do not hate me more =)))

#

by the way if you like you can try my corona-chan

pale vessel
#

shit stats

cerulean pebble
#

@frank torrent

earnest phoenix
#

stop shilling

sturdy hamlet
#

Any suggestions on vps?

finite bough
slender thistle
#

Advertisement is against the rules

modest maple
#

we dont care about your bot

sturdy hamlet
#

Thanks for the help btw

finite bough
#

@sturdy hamlet pins pls

sturdy hamlet
#

ty!

pale vessel
#

there's no one named ty here

cerulean pebble
#

oke

native thunder
#

Ok. Got bot back online

#

Probably my support ticked was made his job

finite bough
#

cry has committed die as he couldnt handle this channel

earnest phoenix
#

not yet

#

:(

finite bough
#

yay xD

quartz kindle
#

nice discord

pale vessel
#

rare pogey

earnest phoenix
#

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

pale vessel
#

are they going to decrease it or u p g r a d e?

#

that is the question

quartz kindle
#

fml

#

rushing to finish my sharding rework while my bot is hardstuck at 2500 auto-leaving all new guilds to avoid breaking it lmao

zenith terrace
#

Oof

tight plinth
#

Oof

small prairie
#

how can i completely remove one role's perms from a channel?

#

d.js

#

v11

#

it shouldnt effect other roles or members

#

just remove

pale vessel
#

remove or change perms?

zenith terrace
#

Ever heard of the docs as well?

pale vessel
#

some people are either lazy or ignorant

small prairie
#

Oof

slender wagon
#

const stream = ytdl(url, { filter: "audioonly" });

#

guys how do i define the url

quartz kindle
#

do you know what is an URL?

slender wagon
#

yeah

quartz kindle
#

then thats how you define it lol

slender wagon
#

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

quartz kindle
#

get the url from the command and put it there?

slender wagon
#

i mean like

#

!play [url]

quartz kindle
#

yeah

slender wagon
#

wanna see the full code

quartz kindle
#

take it from the command, and put it in ytdl

slender wagon
#

hmm

quartz kindle
#

do you process arguments?

slender wagon
#

i only use const

quartz kindle
#

do you have like let args = message.content.split(...)

slender wagon
#

nop

quartz kindle
#

how do you get input from the command?

slender wagon
#
  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

quartz kindle
#

ok thats really really wrong lmao

slender wagon
#

ooof

quartz kindle
#

message.content will contain the things you receive in the message

#

url will be whatever the user writes, its not a fixed value

slender wagon
#

oh dang

quartz kindle
#

so your startsWith needs to account for that

slender wagon
#

im so stupid

quartz kindle
#

ie startsWith("$play ")

#

leave the url out of it

slender wagon
#

out of " "?

quartz kindle
#

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"]

slender wagon
#

oh

quartz kindle
#

then to get the url simply get the second item from this array

#

arguments[1] (1 is the second item, 0 is the first)

slender wagon
#

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!

elder moss
#

This keeps on saying improper token has been passed this is acc annoying why isnt this working?

modest maple
#

because an improper token has been passed

elder moss
#

no

#

i used the correct token

modest maple
#

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"

elder moss
#

im just copying my pasting my token

#

client.run(token)

median siren
#

For some reason my now refuses to connect any ideas why this might be the case? Im using discord js for node js bot

glacial ocean
modest maple
#

@weak parrot

unique nimbus
#

what is the bot

modest maple
#

@glacial ocean You need to use DBL api to post server count

zenith terrace
#

@glacial ocean yes

glacial ocean
#

ok thx .<3

zenith terrace
#

Code in the code

modest maple
#

@elder moss i dont think you're copy pasting the right token

zenith terrace
#

Does .run even work

modest maple
#

what

zenith terrace
#

Why not do .login

#

client.run(token)
@.AtheonsPhantom#7167

quartz kindle
#

there is no client.run() in discord.js

zenith terrace
#

.login

modest maple
#

because that looks like python

zenith terrace
#

@elder moss what language

median siren
#

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

earnest phoenix
#

discord is flagging ips and preventing them from logging in

modest maple
#

Blocking code or somthing blocking the heartbeats

#

and that

median siren
#

dont think tis flagging ips

earnest phoenix
#

it very much is

median siren
#

also how do i check that

zenith terrace
#

My bot wouldnt login before a couple weeks ago but now its working fine.

#

Took a couple hours

modest maple
#

well what are you using to host

earnest phoenix
#

contact discord i guess

#

or your host to change your ip

modest maple
#

if its glitch or heroku it probably is ip getting flagged

median siren
#

ive tried hosting the bot on like 3 different machines

#

so

modest maple
#

if vps etc... then probably somthing blocking

earnest phoenix
#

discord is incompetent to do anything properly so they mass flagged ips, a lot of those were local machines etc

modest maple
#

what lang

median siren
#

js

#

using discord js

#

the bot server count shouldnt have anything to do with it right?

#

or which servers its in

pale vessel
#

if it suddenly stops working then it's not the code

modest maple
#

well

#

yes and no

pale vessel
#

of course lol

#

in general

modest maple
#

if your code isnt made to handle high loads / optimised then it could be pretty easy to run into issues to a point

median siren
#

@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');
pale vessel
#

how are you so sure?

median siren
#

like its literally this

pale vessel
#

oh.

modest maple
#

okay then yh its discord or network

median siren
#

i tried running it on a vps and it still doesnt like it

pale vessel
#

which vps?

#

or like what company

finite bough
#

why my bots on glitch r completely fine

tight plinth
#

What error

#

Token is valid?

median siren
#

okay ive tried running in on google cloud compute engines

pale vessel
#

HEROKU AND GLITCH HAVE MORE THAN ONE IP
@\ハーリ-さん (CF8)#6621

median siren
#

still hangs

modest maple
#

thank you for not actually @ing me <3

pale vessel
#

np

#

added a backslash before the ha

quartz kindle
#

@median siren wdym hangs?

median siren
#

like the console hangs

#

the code is the most basic thing as well

mossy vine
#

dang whats kpal doing here
</offtopic>

finite bough
#

console plays handsman

quartz kindle
#

try this: client.on("raw",console.log) and client.on("debug",console.log)

median siren
#

@quartz kindle okay it looks like its going through each guild

#

or something idk

quartz kindle
#

ok so minimize the raw to this client.on("raw",r => { if(r.t === "GUILD_CREATE") { console.log(r.d.name) } })

finite bough
zenith terrace
#

Its raw

quartz kindle
finite bough
#

hmm

median siren
#

Could the api be timing out due to there being too many servers?

mossy vine
#

how many servers

median siren
#

Like the bot is in 1500 servers

mossy vine
#

okay so its not sharding problem

quartz kindle
#

the api works until 2500

#

but it recommends sharding at 1500

median siren
#

whats sharding?

quartz kindle
#

but the code above should show you which guild its hanging on

#

sharding is splitting your bot into multiple connections and/or processes

finite bough
#

do u like sharding tim?

median siren
#

oh i see

quartz kindle
#

so that each process/connection handles a part of the bot, and not the full bot

median siren
#

so basically making it concurrent?

quartz kindle
#

more like load balanced

#

but yes

median siren
#
[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

quartz kindle
#

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?

median siren
#

lemme test

#

The order of the guilds seems different each time

earnest phoenix
#

an anyone help me
how do I set carl bot to auto remove and warn discord server invites

pale vessel
#

regex

quartz kindle
#

ask in the carl bot support server

pale vessel
#

oh Carl bot

#

i need to read smh

median siren
#

@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?

quartz kindle
#

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

elder moss
#

who knows how to link a discord bot to roblox bot

median siren
#

Yea its the same one

elder moss
#

like

#

to do stuff in roblox

#

use your discord bot to use kicks and bans in a roblox group

#

do you use a NPM?

median siren
#

@quartz kindle like sometimes it works

#

i just have to wait a long time

elder moss
#

some one pls help me

vagrant tree
#

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?

elder moss
#

guys

zenith terrace
#

@vagrant tree Whats ur bot name and prefix in here. I wanna test it

elder moss
#

Please, someone help me.

modest maple
#

my guy

#

understand

#

that we dont all make roblox bots

#

because why the fuck would that be a useful thing

median siren
#

LOL

vagrant tree
#

@zenith terrace its called smart shopper and prefix is s! as in s! info

zenith terrace
#

Ok

median siren
#

Tim just tell me the fix lol

#

the hacky one

zenith terrace
#

@vagrant tree doesnt seem that complicated from me just doing the s! info and s! search

finite bough
#

@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

elder moss
#

@modest maple I mean

#

Make a discord bot that links to a game

#

so like

#

you do a command in discord

true ravine
#

We get what you mean you don't need to spell it out

finite bough
#

@elder moss not possible I think

elder moss
#

then the action will take place in something like minecraft or roblox as a example

finite bough
#

actually

elder moss
#

@finite bough its possible because i know bots that do it

vagrant tree
#

@finite bough I think that's what it's doing eg s! top

quartz kindle
#

@median siren whats your discord.js version?

finite bough
#

@elder moss example?

elder moss
#

the verification bots and etc

finite bough
#

@vagrant tree that's pretty self explainotary

elder moss
#

like RoVer

vagrant tree
#

@zenith terrace maybe I need to find more engaging users somehow

elder moss
#

ClanClabs

finite bough
#

they kick u from roblox groups?

true ravine
#

That uses web scraping it has nothing to do with the game

#

All they do is scrape the roblox website

elder moss
#

ClanClabs can

true ravine
#

Ask the maker of clanclabs then?

#

Or...

#

Google it

finite bough
#

^

zenith terrace
#

@vagrant tree find smarter ones

elder moss
#

nothing shows up in google

finite bough
#

roblox is a particular platform

elder moss
#

im just asking you guys if you know how to do it

true ravine
#

We don't

finite bough
#

nope sorry

#

@earnest phoenix 1-2 weeks

slender thistle
vagrant tree
#

Can you make commands case insensitive?

quartz kindle
#

@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

median siren
#

@quartz kindle 7.39.0

quartz kindle
#

@median siren umm wat

median siren
#

whoops

quartz kindle
#

lmao

elder moss
#

immaggion waiting 1-2 weeks and they didnt pass your bot

#

that is sadd

median siren
#

"discord.js": "^11.6.2",

cursive dagger
#

@elder moss hint: rule 3

finite bough
#

@vagrant tree .toLowerCase()

vagrant tree
elder moss
#

@cursive dagger dats why i deleted it ...

cursive dagger
#

all g

earnest phoenix
#

How do i hack my package.json to give me free rhythm premium

#

@bitter sundial

mossy vine
finite bough
#

@mossy vine corona virus

true ravine
#

Oh no he said the C word

vagrant tree
#

Can you have different syntaxes for the same command e.g with a space and without a space?

quartz kindle
#

@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

zenith terrace
#

Yes

#

Testinnnggg

#

Wee woo

earnest phoenix
#

Est ce que vous savez comment réactiver invitemanager

median siren
#

Aigh lemme try it out

median siren
#

@quartz kindle Its super buggy tho

#

like it works for a bit but then just stops

quartz kindle
#

idk whats going on then

#

try using discord.js v12.0.2

#

do you have anything else installed in you package.json?

median siren
#

yea but that shouldnt make a difference

#

i transfered the code to a new bot

#

and it works fine with that one

late hill
#

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

quartz kindle
#

@median siren you mean another token/account?

median siren
#

Yea

#

not account another app

quartz kindle
#

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

median siren
#

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 😅

quartz kindle
#

👍

unborn raft
#

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

quartz kindle
#

discord going bonkers

unborn raft
#

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

zenith terrace
#

Oof

quartz kindle
#

i guess emailing them is the only way

unborn raft
#

alright, I'll do that

late hill
#

I've been getting frequent timeouts for 2 days now

quartz hill
#

me too

unborn raft
#

were my frequent timeouts now the cause of this outage

#

gateway just went kaboom

#

Getting invalid session

quartz kindle
#

discord died lul

earnest phoenix
#

see

#

i'm a fucking psychic

#

or a psycho

#

both

unborn raft
#

Yeah

median ridge
#

Rip my bot won't login after I was able to access discord

#

Discord got coronavirus

quartz kindle
#

yup

sudden geyser
#

Discord has some sort of issue at least once per week.

median ridge
#

My bot can log in now, that may be temporary.

hoary elm
#

All the bots are slowly coming back on

#

just give it time

summer torrent
low bolt
#

Discord.js have a inviteCreate and inviteDelete events? I can't find this events.

earnest phoenix
#

you weren't looking hard enough, or, well, haven't been looking at all

summer torrent
#

@low bolt in v12 yes

low bolt
#

only v12?

earnest phoenix
#

yes

summer torrent
#

Yes

low bolt
#

ahs

#

how can i update my codes to v12 with any program or smh?

#

im using v11

earnest phoenix
#

Pp

summer torrent
#

There is changelog

earnest phoenix
#

Frech

summer torrent
#

@earnest phoenix wdym

earnest phoenix
#

Frech please

low bolt
#

@summer torrent i want to ask smh

summer torrent
#

No @earnest phoenix

low bolt
#

there is a big changelog between v11 and v12, like every code is changing. Or only little things

#

?

summer torrent
#

Just check this changelog

earnest phoenix
#

it's a major version for a reason

#

of course it has breaking changes

summer torrent
#

Also yes, changes are big

low bolt
#

tysm cry

agile orchid
#

i still use discord.js v10

summer torrent
#

why

agile orchid
#

i'm used to it's code

#

i hate to change the whole code to make the bot working again

earnest phoenix
#

it's best to update as soon as a new stable version comes out

zenith terrace
#

V11 is good

#

V12 a bitch

#

Im not gonna change

amber fractal
#

Have fun with deprecation and bugs in the near future

#

Especially with intents

zenith terrace
#

I will only change when the time comes

amber fractal
#

ah so you have to update more and not be ready. Got it

zenith terrace
#

I'll just have a project of V12 ready whenever that day comes

amber fractal
#

that's the best idea

earnest phoenix
#

which is soon because discord is switching to v7 gateway as the main gateway this year probably lol

zenith terrace
#

Oof

cosmic parrot
#

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

amber fractal
#

The json isn't right

#

show me the json file, just remove any tokens

prime cliff
#

Imagine that code failing on DMs because the guild is null 😔

cosmic parrot
#

the json is formatted correctly, since the code is functional right now

#

it was erroring because it was empty

amber fractal
#

that error tells us otherwise

cosmic parrot
#

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

lyric mountain
#

Your best friend when it comes to formatting json

cosmic parrot
#

that site says its valid

#

so then what was causing that error

lyric mountain
#

If it says it's valid then maybe the error is somewhere else

cosmic parrot
#

i guess i wont find out what it was until discord goes down again

amber fractal
#

That is weird the error suggests the json failed to parse

cosmic parrot
#

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

lyric mountain
#

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

cosmic parrot
#

actually hold on

#

when guilds become unavailable they trigger the guildDelete event right?

prime cliff
#

Guild left yes and the guild joined

#

But there is a bool variable on the event you can use to filter that

cosmic parrot
#

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

earnest phoenix
#

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

slender thistle
#

Hyperlinks

earnest phoenix
#

Hmm like this?:
.addField("Link:", `[Click Me](link)`)
? @slender thistle

summer torrent
#

yes

earnest phoenix
#

Hmm k lemme test

summer torrent
#

where is my telescope

earnest phoenix
#

Hmm

slender thistle
#

`x`y`q`

earnest phoenix
#

The wot...

slender thistle
#

Or is that how it works in JS nekohmm

earnest phoenix
#

Hmm lemme try something...

slender thistle
#
s = 123
123
a = `s${s}`
"s123"
a = `s`${s}```
SyntaxError: unexpected token: identifier
debugger eval code:1:7
`s = ${s}`
"s = 123"
#

great

earnest phoenix
#

Hmm... Imma try something...

copper cradle
#

dude

#

that error

#

it fucking says

#

you added an extra `

#

it looks like this `)`) should look like this )`)

earnest phoenix
#

Welp i fixed it before you said that... Hmm just noticed...

copper cradle
#

ah yes

mystic violet
#

can you seek with ytdl? or do you need to re-create the stream?

earnest phoenix
lyric mountain
#

Hum...wrong server?

earnest phoenix
#

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?

lyric mountain
#

Ah, I see

#

Just noticed the issue

earnest phoenix
#

What is it?

lyric mountain
#

Could you show the piece where that embed is made?

#

Of the code*

earnest phoenix
#

And the thing is that they can use the command but when they mention someone that happens...

#

K

lyric mountain
#

Also the log at 20:31

earnest phoenix
lyric mountain
#

Dude

earnest phoenix
#

Yea?

lyric mountain
#

Just a question:

#

Why are you using an array to get the percentage instead of a rng function?

earnest phoenix
#

Hmm... Idk... It just works anyways but can you help me resolve the issue?

lyric mountain
#

Still reading

earnest phoenix
#

Kk

lyric mountain
#

Ah

#

I think I found it

#

Gonna screenshot it

earnest phoenix
#

Kk

lyric mountain
#

It should be > 0

#

Not === 0

earnest phoenix
#

Hmm... But i've seen so many people use === instead... Hmm want me to try that?

slender thistle
#

0 = nothing, emptiness, void
> 0 = anything, something

lyric mountain
#

You're blocking it from adding the actual fields if someone is mentioned

earnest phoenix
#

Hmm i mean like should the === be removed and replaced with > 0 or
Like this ===> 0?

crimson vapor
#

> 0

earnest phoenix
#

Oh ok... Lemme try that...

lyric mountain
#

And btw, use Math.round(Math.random() * 100)

#

That'll get you a random value between 0 and 100

crimson vapor
#

Math.floor is 0 - 99 right?

lyric mountain
#

Yep

earnest phoenix
#

Hmm like the array function is not even needed right?

crimson vapor
#

correct

lyric mountain
#

And math.ceil for 1-100

earnest phoenix
#

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?

lyric mountain
#
> 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

crimson vapor
#

I got this one

lyric mountain
#

@earnest phoenix Math.random() returns a value between 0 and 1

drifting jasper
#

it this channel for help?

lyric mountain
#

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

crimson vapor
#
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```
lyric mountain
#

Math.floor(1.999999999) = 1

earnest phoenix
#

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...

lyric mountain
#

I see

earnest phoenix
#

Wdym?

lyric mountain
#

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

dull terrace
#

if i want my bot to join a channel, do i need to download something specific?

earnest phoenix
#

Hmm... Like should i change the if to else if?

lyric mountain
#

Replace the whole if (...) with else

#

There's no need for elseif

earnest phoenix
#

Hmm...

lyric mountain
#

@dull terrace salon?

dull terrace
#

Channel sorry

lyric mountain
#

Do you mean a server?

#

You need to use the invite url of the bot

#

This can be found in the discord dev page

dull terrace
#

To join a voice Channel ?

lyric mountain
#

Ah, that's different then

crimson vapor
#

discord js?

dull terrace
#

Py

crimson vapor
#

anyone here know py?

earnest phoenix
#

@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?

dull terrace
#

I've been looking for a solution for several months now, I wonder if I should download something

lyric mountain
#

@earnest phoenix just a sec

earnest phoenix
#

Kk

crimson vapor
#

@dull terrace there should be a discord py function to join a voice channel, I dont know what you mean by download something

dull terrace
#

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

lyric mountain
#
if (message.content.includes(userhg)) {
	//CODE
} 
```to
```js
else {
	//CODE
} 
earnest phoenix
#

@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?)

lyric mountain
#

You don't need it at all

earnest phoenix
#

K imma remove that

lyric mountain
#

Thing is, you gotta think about your logic:

#

If noone is mentioned, then show this embed

#

Else show this other embed

crimson vapor
#

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?

lyric mountain
#

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

earnest phoenix
#

Hmm... My logic is a bit weird but welp... Here i go changing all the code again...

#

RIP

lyric mountain
#

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

earnest phoenix
#

I mean like the other ones (commands) are like that too so...

lyric mountain
#

Fix one thing at a time

earnest phoenix
#

Hmm... K... Lemme try... Thx for the help anyways...

old steeple
#

Guys I want a bot
it got everything
. like probot
. invites
. giveaways
. broadcast
.credits.....

#

hooooo can do this?

quartz kindle
#

for free? nobody

old steeple
#

nononono

#

i willl pay

#

@quartz kindlecan you?

#

@quartz kindle

copper cradle
#

I smell money

lyric mountain
#

don't spam pings

old steeple
#

ok just briadcast ans credits

#

hooo can?

lyric mountain
#

you what?

old steeple
#

@lyric mountainme?

#

i want a credit bot and broadcast

crimson vapor
#

I only accept republic credits

quartz kindle
#

i dont know what is a credit bot

lyric mountain
#

nor do I

#

broadcast would be a PM spammer bot?

zenith terrace
#

Define credit and broadcast

earnest phoenix
#

Btw it's discord.js

crimson vapor
#

is it possible for you to copy it all and send it in code blocks in discord?

#
\`\`\`js

\`\`\````
earnest phoenix
#

Hmm but wouldn't it be counted as code spam?

crimson vapor
#

delete the images

earnest phoenix
#

K

#

K now imma copy all

crimson vapor
#

as long as you are not spaming code asking for solutions to problems that you don't know

pine aspen
#
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?

crimson vapor
#

for a guild?

pine aspen
#

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?

crimson vapor
#

@earnest phoenix in one sec I need you to delete it

pine aspen
#

MILLION i have no error btw. I'm just not sure how to do it.

crimson vapor
#

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

earnest phoenix
#

Imma send the other code

#

I mean the rest

pine aspen
#

Colour = helps

crimson vapor
#

alright delete it please and thanks

earnest phoenix
#

Now how can i make it show user info about the mentioned user by their IDs?

crimson vapor
#

ok

#

I see

earnest phoenix
#

Hmm

crimson vapor
#

so you would first to check if there is an args

#

and if there is, check if it is an ID

pine aspen
#

MILLION. Just to ask

bot.on("guildCreate", async (guild) => {
guild.leave()
}
#

Would this work?

earnest phoenix
#

@crimson vapor what's the code for that?

crimson vapor
#

I think but wouldnt that be counterintuitive?

lyric mountain
#

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

pine aspen
#

oo

#

That's usful.

crimson vapor
#

I would like to see your solution to the problem

earnest phoenix
#

Hmm

lyric mountain
#

${useri.avatarURL()}?size=4096

crimson vapor
#

make a function that checks for the user

pine aspen
#
.addField("**Avatar link:**", `[Click Me](${useri.avatarURL()})`
#

This works in JS?

#

Isn't it only a description thing.

earnest phoenix
#

Hmm... Welp imma try to make a function that checks for the id in args

#

@pine aspen yes it works...

pine aspen
#

That's cool.

earnest phoenix
#

Yea...

crimson vapor
#

have you created a function?

pallid vector
#

how I get user for rewarding users in on_dbl_vote

cerulean pebble
wintry sonnet
cerulean pebble
#

=))) how can it possible

#

@wintry sonnet your bot in 232 k servers

#

wow =)))

wintry sonnet
#

That's not my bot

cerulean pebble
#

oh

#

you mean add server count like me ?

wintry sonnet
#

Yes

cerulean pebble
#

PM me

wintry sonnet
#

Link please?

cerulean pebble
#

by the way upvote corona-chan =))

wintry sonnet
#

Is corona-chan your bot?

cerulean pebble
#

yes

wintry sonnet
#

Damn, how is your bot more popular than mine? Mine's only on 32 servers

slender thistle
#

@pallid vector data['user']

wintry sonnet
#

@cerulean pebble Can I have the link to the top.gg documentary?

pallid vector
#

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?

slender thistle
#

Yup, webhook kwargs in DBLClient

cerulean pebble
#

how can coonect bot with webhook

#

*connect

wintry sonnet
#

Does somebody know how to add server count to your bot on top.gg?

pale vessel
wintry sonnet
#

Wrong channel?

pallid vector
#

@slender thistle ah alright, I haven't really touched webhooks at all 😭 what would I put for the port field?

slender thistle
pallid vector
#

so does anything work?

#

or

slender thistle
#

"greater between"
Excuse me

pallid vector
#

lol

pine aspen
#

bot.on("guildCreate", async (guild) => {
guild.leave()
}

#

How'd i do to fetch/get a guild default/open text channel?

earnest phoenix
#

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

pine aspen
#

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?

earnest phoenix
#

yes you need to check

#

since it just gets the first channel in the Discord

copper cradle
#

shiro, that short desc has more grammar mistakes than my friend has freckles

earnest phoenix
#

How do you make a vote thing for your bot on the website

cerulean pebble
#

is this code true =))

earnest phoenix
#

Does anyone have a good way of matching images inside a image.

cerulean pebble
#
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

weak tangle
#

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();
            }
        }
    }
}
small prairie
#

can we send richembed from webhook?
D.js v11

warm marsh
#

It's done slightly different.

small prairie
#

I am asking can i send it directly?

warm marsh
#

Maybe.

#

Try using <Webhook>.send({ embeds: [richembed]});

small prairie
#

Wow Nice answer thanks a lot for help

warm marsh
cerulean pebble
#

help

small prairie
#

@warm marsh Thanks seriously

#

sorry for being rude F

warm marsh
#

Did it work?

tight plinth
#

I have a problem with ytdl and my music bot : idk how I can handle invalid videos.

restive furnace
#

check if it has thumbnail for example and if not then return error

tight plinth
#

the problem is returning the error without stopping the queue process prematurely

#

with playlists

cerulean pebble
#

again hope for some one will help

flat pelican
#

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

cerulean pebble
#

lol

#

look at my history chat i ping for 20 times and no one help me

quartz kindle
#

you want cpu usage of the bot, or of the entire machine?

cerulean pebble
#

for bot

#

@quartz kindle you know how to help me ?

quartz kindle
#

getting cpu usage with process.cpuUsage is a lot more complicated than that

cerulean pebble
#

oke

quartz kindle
#

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"

cerulean pebble
#

but in the picture 1 or 2 is correct

quartz kindle
#

both are wrong

cerulean pebble
#

lol

#

so can you fix for me

quartz kindle
#

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')```
tight plinth
#

wat

quartz kindle
#

this is how you calculate cpu percentage in node

#

this is the result

tight plinth
#

hm

pallid vector
#

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

quartz kindle
#

you mean dbl/top.gg webhooks?

pallid vector
#

yeah

#

don't know what im rly doing with it pensivesob

quartz kindle
#

the authentication is the password you put in your dbl code

#

webhookAuth

pallid vector
#

in dbl.DBLClient right?

#

in the code

#

I just don't know where that password is needed or required

quartz kindle
#

yes, the password you put in webhookAuth

#

is what you put in authentication

pallid vector
#

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

quartz kindle
#

for webhooks no, you can only set one url

pallid vector
#

ok tyvm

cerulean pebble
#

@quartz kindle

#

this is my file

#

fix like that

#

it's true

#

?

quartz kindle
#

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

pallid vector
#

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

quartz kindle
#

i believe the python lib has a specific function for testing: on_dbl_test

pallid vector
#

oh hmm ill try that ty

tight plinth
#

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

Lightshot

Captured with Lightshot

pallid vector
#

still doesn't print anything :/

quartz kindle
#

what do you have in your URL?

tight plinth
#

or

#

it takes playlist ID, and then do his work

pallid vector
#

@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)
quartz kindle
#

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

pallid vector
#

oh

humble pendant
#

bruh hello how do you put your dbl widget into an embed

shut kindle
#

Lol

humble pendant
#

boi

pale vessel
#

add it as an image

humble pendant
#

ok

pale vessel
#

make sure it's the png variant

humble pendant
#

h o w

pale vessel
#

d o c s

humble pendant
#

o h o k

fringe relic
#

\

humble pendant
#

\

cerulean pebble
#

@quartz kindle tks Tim =))

#

i will make prenium command free for you if you use my bot

pale vessel
#

stop advertising your bot

cerulean pebble
#

=))) oke why you hate me =))

smoky jungle
#

How do I setup the bot?

pale vessel
#

read docs

smoky jungle
#

Where?

pale vessel
#

change the anime profile picture back cry

earnest phoenix
#

imagine still being a weeb

#

can't relate

pale vessel
#

lol

#

I'm not one

#

I'm just a mod from a web hosting company

cerulean pebble
#

@pale vessel that's big bro

zenith terrace
#

@pale vessel the annoyance of having to tell people to read docs 😂

lyric mountain
#

just need to replace "our" with "the"

zenith terrace
#

Yes

#

Un momento

#

Ima edit

lyric mountain
coral trellis
tulip iron
#

Does anyone know the best way to prevent someone from intentionally spamming your bot?

cursive dagger
#

Ratelimits

lyric mountain
#

@coral trellis srry doggowave

shy turret
#

without using message.reply, how do you put a message and a embed at the same time?

#

nvm found out

tulip iron
#

Thanks, i've limited it 3 times every 10 seconds now, hopefully my bot doesn't die anymore due to spam

pine aspen
#

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
}```
pale vessel
#

const blacklist

#

why { blacklist }?

copper cradle
#

yeah

#

why are you destructuring that

tight plinth
#

@pine aspen

#

just do const blacklist = ...

pine aspen
#

Oh

#

Ok

proper inlet
#

Hello, how can I check has my bot permissions to add a some role to member? (Discord.js)

pale vessel
#

docs

#

docs.

#

guild.me.hasPermission

zenith terrace
#

:)

tight plinth
#

true

zenith terrace
#

But stilllll

#

Its relative

#

;-;

pine aspen
#
    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...

late hill
#

so what did you guys do about guilds that keep hanging

pine aspen
#

?

late hill
#

guilds that don't become available and cause shards to keep disconnecting/can't enter ready state

pine aspen
#

Oh

#

Can't help with that sorry...

earnest phoenix
#

that... shouldn't be a problem

#

gateway sends READY regardless if guilds are available or not

#

which lib are you using

quartz kindle
#

its an issue for discord.js

#

because the library does not enter ready state until all guilds are cached

zenith terrace
#

Doesnt not

quartz kindle
#

@_@

zenith terrace
#

Lmao

#

^-^

valid holly
#

Is this the correct way to apply imageurloptions ?

guild.iconURL({
  format: "png",
  size: 1024,
  dynamic: true
});
sudden geyser
#

Yes

grizzled raven
#

log message content

sudden geyser
#

Does the bot have a nickname

lyric mountain
#

you can set one

#

if it have permission to that, obviously

lyric hawk
#
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

slender thistle
#

user == message.author

#

yes

lyric hawk
#

Isn't message.author the bot?

slender thistle
#

I hightly doubt the bot will listen to its own messages

#

Considering only you can trigger it

#

:^)

lyric mountain
#

I hightly doubt the bot will listen to its own messages
it does

lyric hawk
#

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

lyric mountain
#

message.author is the one who created the message

lyric hawk
#

Then why does it trigger when I react

#

I suppose user is me

slender thistle
#

Because user is you

lyric hawk
#

So the condition shouldn't be met

#

user != message.author

slender thistle
#

and message.author is you because you're the one who sent the message that triggered the event

lyric hawk
#

It's a reaction

lyric mountain
#

you == you

lyric hawk
#

Is the reaction considered as a message lol

slender thistle
#

reaction is reaction

lyric hawk
#

Yeah

slender thistle
#

Are you doing this under on_message

lyric hawk
#

Yes

lyric mountain
#

it should be return message.author == reaction.author

slender thistle
lyric hawk
#

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

lyric mountain
#

just remove that check

#

return user == message.author and str(reaction.emoji) == ':green_circle:'
to
return str(reaction.emoji) == '🟢'

lyric hawk
#

Yeah the problem is when I do return str(reaction.emoji) == '🟢' only

#

Nobody can trigger it

#

Which is weird

lyric mountain
#

have you tried debugging it?

lyric hawk
#

No error output

lyric mountain
#

that's not a debug

lyric hawk
#

Like it was intended

#

Ah

lyric mountain
#

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?

lyric hawk
#

Atom

lyric mountain
#

wait

#

yeah, that

#

probably

#

you could also use a more complete IDE too

lyric hawk
#

Wait it's to debug atom itself right

#

Not your code

#

Just realized

lyric mountain
#

ah mb

slender thistle
#

Set a breakpoint, run in debug mode

#

or just print() everything

lyric hawk
#

set_trace() ?

lyric mountain
#

^ that'd work

#

not trace, shivaco's way

lyric hawk
#

what should I print

lyric mountain
#

yes

lyric hawk
#

lol

slender thistle
#

Essentially almost everything you think is wrong

#

The real debugging

#

reaction, user, reaction.emoji, etc.

lyric hawk
#

Gonna start with that

#

Lol nonsense

#

It just worked

#

With the print

#

Tried 5 times before without editing anything else

modest maple
#

once u learn how to use a debugger

#

it becomes life

lyric mountain
#

yeah, like jetbrains' IDEs

modest maple
lyric hawk
#

What IDE?

modest maple
#

jetbrains

#

ngl

#

just relised i leaked my token

#

rip

slender thistle
#

kek

lyric hawk
#

lol

quartz kindle
#

/hack

lyric mountain
#

jetbrains is the company, the IDEs are pycharm, webstorm, intellij, etc

earnest phoenix
#
enter email ---sagar@gmail.com
{'global': False, 'message': 'You are being rate limited.', 'retry_after': 70291}```
#

What is this erore

modest maple
#

you are being rate limited

#

stop being the naughties

slender thistle
#

send(response['message'])

lyric mountain
#

retry after 70291

earnest phoenix
#

I am make register in discord api that is the errors

#

@slender thistle