#development
1 messages ยท Page 402 of 1
im pretty sure inviting the bot in the first place is pretty consent enough no?
and he needs to encrypt unless the users give him permission to store the guild name
Do you want to see it through the database?
LMAO
"Warning: this bot stores the name of your server if you invite it, sorry"
yes
either that or you encrypt the db
the db is local only
As far as I know, inviting a bot gives it permission to store EUD
Encrypting it will make it show random characters in database
tbh i'd ask in DAPI
Yeah, you can't be too sure
You want to see the name?
or play safe and encrypt it
encryption's fairly cheap nowadays
disk encryption is supported by most CPUs and has little to no overhead
ids no
if it's generated by discord it's not EUD
Good, I don't need encryption.
so no encryption is needed
I only store ids
Holdup you sayin i can add encryption, but I would know how to decrypt the info anyways what does it matter ๐ฎ
encryption will make it harder to have data breaches and safer for you as well
Like i said before I'm not here to explain to you just that it's easier
make a command to get the server id for support reasons
I'm asking how to, not looking for an argument
I have been coding bots for a long time now so I got tons of experience and is just offering advice. I understand that you want to have a server name to best handle support but you can't save names with unicode in them via sql. It's best to just use a command that returns the id. Telling them the command if they are unsure how is not a back breaking test.
how would i prevent my bot from responding to other bots
@slim heart
@knotty steeple make a if statement seeing if you user is a bot. Language?
javascript
if(message.author.bot) return;
^
ok ty
I'm not having this argument with u fuzzy, if you can't help then dont try to oof
I think you're misunderstanding his intent, Berry
I have my reasons, and I've experienced situations where it just makes it a lot easier
If you can't listen to that, the only thing I can tell you is to encode it (which would make everything look weird as well like encryption but more noticeable). Google it, stack overflow probably has to answer ready.
base64 encode any non ascii character 
Is there a way to just continue with my .forEach, and if there's an error it just says null
was it base64
ik there's the way but im not ver gud with js
I swear it was utf8
encode with utf8 ^
yeah mysql uses utf8 default im pretty sure
you need utf8-mb4 iirc
encode the variable
base64 would technically work but it'd be more work and use more space
How would i just return a null if it makes an error
I'm talking about the normal code oof
if the text is normal then just dont set the var
I'm not doing the db encoding im talkin about the actual js that would send that data to the db
you'd need to check for code points outside the database's encoding supported rangeยฒ
which is considerably harder than just setting the proper encoding in the DB
๐
Or do the hard work yourself. We already explained easier methods.
well i just tried that mathiasbynens.be thing and it returns the same error
ยฏ_(ใ)_/ยฏ
@inner jewel
so uh my ping command is done, but how do i have the ms
i don't use mysql ยฏ_(ใ)_/ยฏ
Why ping trixter? We already gave you our answers. If you want a better answer then try Google.
so uh my ping command is done, but how do i have the response time
natan stole my name
what does that have to do with development? @solemn obsidian
@knotty steeple depends on your library
again, what does that have to do with development?
๐คฆ
Jonas, he's answering that question
How?
Ooooh
I'm sorry
It didn't seem to do anything with development out of context
my bad
someone pings natan
they ask "why ping trixter"
trixter answers "natan stole my name"
i have discord.js
client.ping or client.pings[0]
ok
How could i message all discords my bot is in that downtime is going to take place?
im using discord.js btw
So like mass message the servers?
that sounds bad but yes
- don't do that
- don't do that
- don't do that
- don't do that
- you'll get an API ban
wait really?
Or ping @ everyone in your support server
@uncut slate using bot.pings[0] returned the same ping for a while
What's "a while"? The value gets updated once in a while, automatically
websocket ping is calculated once in a while
idk few mins
REST ping is usually calculated on demand
Alright, so what I'm wanting to do is have my bot send a message, grab that ID and after a promise is completed edit that message.
I checked the docs but I'm still a bit lost. Could anyone help?
Alright I found the four culprates for the MySQL errors... Any idea how to get mysql to recognize these?
Discord.js
Um
The message should have the field .createdAt
What do you mean by culprits @slim heart?
Oh wait
The 4 servernames that can't be inserted
:P
lol
I wouldn't need an ID, wouldn't I?
@slim heart did you enable multipleStatements
without crashing*
no i dont think so
I don't think that, makes a, difference oof
What's the data type of the column you are putting them in, and are you using a prepared statement?
all i can say is this is the error
Executing:
UPDATE `bot`.`censorbot` SET `servername`='โ๐๐ฃ๐๐ค๐ฅ๐๐๐ ๐๐๐ฃ๐ง๐๐ฃ' WHERE `idcensorbot`='32';
ERROR 1366: 1366: Incorrect string value: '\xF0\x9D\x95\x99\xF0\x9D...' for column 'servername' at row 1
SQL Statement:
UPDATE `bot`.`censorbot` SET `servername`='โ๐๐ฃ๐๐ค๐ฅ๐๐๐ ๐๐๐ฃ๐ง๐๐ฃ' WHERE `idcensorbot`='32'
that doesn't seem like a prepared statement
it looks like your table doesn't support unicode
Quick search turns up that MySQL is not a fan of the encoding for those characters, but there's ways around it. This can explain better than I can: https://stackoverflow.com/questions/1168036/how-to-fix-incorrect-string-value-errors
Also, any particular reason you are using MySQL over something like Postgres? And, why store the server name, since you can just retrieve that with the server ID, and if the server changes its name...
And yeah, as @heady anvil said, that doesn't look like a prepared statement.
No, not shhh. It's easy to use prepared statements, and you have no excuse not to these days,
I mean idek how to do these "prepared statments" witchery
What language and library are you using for interacting with your database?
want to test it
guildList.forEach(guild => {
var servername = guild.name
let on = {
"serverid": guild.id,
"censor": true,
"servername": servername
}
connection.query("INSERT INTO censorbot SET ?", on)
console.log(`inserted ${guild.name}`)
});```
I dont think it would i might be wrong though
IIRC, that is a proper way to prepare a statement wiht mysqljs. So that's good.
@slim heart you have to enable unicode for mysql https://mathiasbynens.be/notes/mysql-utf8mb4
Thats the guide i followed before
It's a pain in the ass but it works
why are you even storing the server name
Still, why store the server name?
Honestly, if not possible is there a way to see if it's any special characters and then just set it to null?
If u did it right then if you run that command it will come out like that
what do i set variable_name
Wdym
SHOW VARIABLES WHERE Variable_name LIKE 'character_set_%' OR Variable_name LIKE 'collation%';
you can just use your lib to get the guild name from the id
Okx ive had this argument twice by now, i just want it in mysql for reason so jus shush lmaooo
Let him do what he pleases
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
You ran that?
Heck
hold on w8 i think im being stupid
Can u go into the mysql command line
And run it
Instead of through that app thingy
ye
okay so i think i was bein dum cuz i was setting it through db commands instead of shell command line
okay well every returns correctly but it still doesnt work
doesnt seem like u set the collation_server
i followed everything
i just did it and everything matches up gooood, but, still no work oooof
This is what happens when you encode with utf8
text = "Table Flip โบ (โฏยฐโกยฐ๏ผโฏ๏ธต โปโโป โปโโป "
print(text.encode("utf8"))
>>> b'Table Flip \xe2\x98\xba (\xe2\x95\xaf\xc2\xb0\xe2\x96\xa1\xc2\xb0\xef\xbc\x89\xe2\x95\xaf\xef\xb8\xb5 \xe2\x94\xbb\xe2\x94\x81\xe2\x94\xbb \xe2\x94\xbb\xe2\x94\x81\xe2\x94\xbb ```
That is how it is via python, but encoding with js should do the same thing.
Now, you can use a package like this to encode it: https://www.npmjs.com/package/utf8
Converting UTF8 should convert all special character like above.
This best works if there are none or little special character in the name itself. Server names with all unicodes will be hard to understand when looking through database. I still recommend just the server id command but encoding it then saving it probably will work when saving it via sql.
@slim heart
so lik, js will do it by itself?
https://hastebin.com/edahiwiduc.js anyone know why the nitro subscriber and joined guild fields are coming up undefined
because discord doesn't send that info to bots
premium is not available to bots
Joined at has a chance of being null
Ah, alright

I've run into that problem several times and have to throw "Unknown" for it
that field's never been null to me
Could just be a cache issue too
But that field is almost always null for me if they joined recently
Or the user isn't properly fetched and cached
I've been looking into just manually REST fetching the user since it always seems to be null
Yeah
Nvm it's not because of new accounts
Just tried with a 2016 account and still, undefined
Joining a guild has nothing to do with joining Discord
Ee
I'm pretty new to this stuff
So far I've been pretty good at getting things to work eventually
But this is a tricky one
Oh don't worry this one is just weird because some libraries seem to always have that field null
Discord.Net (C# lib) for example has that field as a nullable type because it can be null .. ?
Which makes no sense because I don't think Discord indicates that field as nullable and should always have it sent
Quick question
You mentioned avatar hashes, what exactly are they
And is it in the docs how to get them
9
huh
If two people upload the same png to discord as their avatar they'll get the same hash
Basically it's an identifier for the image itself
Think of it like a signature for someone
It's just a signature to a specific image
https://cdn.discordapp.com/avatars/433790467830972417/20e8a1fde72e29af8c59ff6018742724.webp?size=1024 I'm pretty sure its this?
yup
The hash would be 20e8a1fde72e29af8c59ff6018742724
mm, that other thing is my ID right
Yes
Alright, thanks
is it a good practice to have a more "stable" version of a bot and have a dev version which is frequently updated
You should always be doing that
Modifying a public branch everyone uses is a terrible idea
So yes it's a very good practice
ah okay
I'm a bit split about that. I'd rather not pre-release unstable features and just work on it locally till I think it's done. I could not be motivated to care about two bots rather than just one.
I have two bots
The dev one is only in my server and not public
It's used because I login and relaunch the bot several times and it doesn't interfere with the public database, bot, or anything
Two public ones I'm not sure about
I mean Discord does it
But I'm not sure that'd be ideal for a bot
It would incentivize people to use a more unstable version of the bot for the features and just doesn't really work out right
?
No idea about .py
ok
Hey I should make a voting feature
Can I have some help
he wants his user count in d.js to be in his playing status, for whoever knows d.js ^^
^
Ah, gimme a sec @frozen path
okay
Use bot.guilds.size
ok
Also, its in the docs
So before asking you should really look in there
Incredibly helpful
ok
@hidden veldt create an on reaction add event
thank you very much
it's in the docs so go check that out
what did u try
but can u send me examplar
lemme show
wait..
somethings lagging
discord.on_reaction_add("\u0031\u20E3", message.author)
that
and it gives me this
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "C:\Users\edwar\Desktop\Bot-Lib\TB\v1.py", line 28, in on_message
client.on_reaction_add("\u0031\u20E3", message.author)
File "C:\Python\lib\site-packages\discord\client.py", line 296, in getattr
raise AttributeError(msg.format(self.class, name))
AttributeError: '<class 'discord.ext.commands.bot.Bot'>' object has no attribute 'on_reaction_add'
oh
can u show me
i never really understood "events"
ik no spoonfeed
an event just like on_ready
hmm?
or on_connect
are you doing this in a cog or main file?
is this your first python project?
no
third
well depends on what u call a python project
if u mean bot
then third
if u mean just python like fiftieth?
idk
@bot.event
async def on_reaction_add(reaction, user):
#do stuff ```
you can add if statements..
oh
ok
is there a way to put that under one unified function?
Traceback (most recent call last):
File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "C:\Users\edwar\Desktop\Bot-Lib\TB\v1.py", line 33, in on_reaction_add
await client.send_message(message.channel, "yay this works!")
NameError: name 'message' is not defined
Ignoring exception in on_reaction_add
Traceback (most recent call last):
File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "C:\Users\edwar\Desktop\Bot-Lib\TB\v1.py", line 33, in on_reaction_add
await client.send_message(message.channel, "yay this works!")
NameError: name 'message' is not defined
Ignoring exception in on_reaction_add
Traceback (most recent call last):
File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "C:\Users\edwar\Desktop\Bot-Lib\TB\v1.py", line 33, in on_reaction_add
await client.send_message(message.channel, "yay this works!")
NameError: name 'message' is not defined
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "C:\Users\edwar\Desktop\Bot-Lib\TB\v1.py", line 29, in on_message
if reaction.emoji.id == "\u0031\u20E3":
NameError: name 'reaction' is not defined
Ignoring exception in on_reaction_add
Traceback (most recent call last):
File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "C:\Users\edwar\Desktop\Bot-Lib\TB\v1.py", line 33, in on_reaction_add
await client.send_message(message.channel, "yay this works!")
NameError: name 'message' is not defined
bam thats what I got
๐คฆ
NameError: name 'message' is not defined
yeah can't you understand the error?
the currently cached messages in client...? basically only some recent messages
ok...
wait
this is what the api says
Called when a message has a reaction added to it. Similar to on_message_edit, if the message is not found in the Client.messages cache, then this event will not be called.
look
wat...
tf does that mean
what do you not understand
stop spamming
id advice you to take a comprehensive read at https://docs.python.org/3/tutorial first
https://hastebin.com/avopeqemor.js
No error and the command won't work!
ok
cool
seriously?
ik python
like i dont need the tutorial
JUST DISCORD
dude...
i have a working discord bot
it just wont react to reactions
@ashen quail best advice is to just breakpoint and walkthrough the program (console logs work too). I don't really know the API but that's really all I could tell you if you are 100% the API you have is correct. e.g. your on message event
ok
on_reaction_add and all other events are functions.
@bot.event
async def on_reaction_add(reaction, user):
#do stuff ```
on_reaction_add
all events
on_command
wat
on_error
ok
are functions
@client.event
async def on_reaction_add(reaction, user):
await client.send_message(message.channel, "yay this works!")
thats what im doing
good?
i use client instead of bot
You need to define message
@client.event
async def on_reaction_add(reaction, user):
await client.send_message(reaction.message.channel, "yay this works!")
reaction.emoji should return the emoji
emojis = reaction.emoji
@client.event
async def on_reaction_add("\u0031\u20E3", user):
await client.send_message(reaction.message.channel, "yay this works!"
No
...
keep it as reaction
reaction returns http://discordpy.readthedocs.io/en/latest/api.html#discord.Reaction
ok
it works
but
for every reaction i add, it returns yay this works
how do I specify which one
like where would I put that
if str(reaction.emoji) == ":thumbsdown":
#do stuff```
...
ok
mmm
hmm
ima add await?
@client.event
async def on_reaction_add(reaction, user):
if str(reaction.emoji) == "๐ช":
await client.send_message(reaction.message.channel, "yay this works!")
yep
it says this
RuntimeWarning: coroutine 'on_reaction_add' was never awaited
client.on_reaction_add("\u0031\u20E3", message.author)
why is it... a warning?
need to wait it
on_reaction_add is not a function in client
do i say
it's an event
yeah
hold up
i want the bot to say something when I add a reaction
thats what...
the event
use the example above
pls
client.on_reaction_add("\u0031\u20E3", message.author)
not thing
It needs to be a function, an event.
@client.event
async def on_reaction_add(reaction, user):
await client.send_message(reaction.message.channel, "yay this works!")
?
but...
yes
how what?
@client.event
async def on_reaction_add(reaction, user):
if str(reaction.emoji) == "๐ช":
await client.send_message(reaction.message.channel, "yay this works!")
so...
whats wrong///
...
i mean
It should return a message when anyone adds a cookie emoji to a message.
hmm?
ok
lemme see...
RuntimeWarning: coroutine 'on_reaction_add' was never awaited
client.on_reaction_add("\u0031\u20E3", message.author)
thats what I got
client.on_reaction_add("\u0031\u20E3", message.author) remove that
I have to go man, will help you out tommorow. :D
Copy the actual emote.. not the keycode
heyyo
uncle
can u help meh?
i got it to work
@mental solstice
but it keeps responding to its own reactions
can u help?
hi
im not a dev
but hi
Add a conditional statment.. id user.isbot return
wat
uh...
i don't know how to do that
wat
coins...
uh...
Idk JS very well.. but if (senderOdMessage.IsBot) return
Well whatever the arg for reactionadded event
if user.bot: return
Dammit turtle
no u
no u
He bypassed anti-ads basically
u
You
buhbye
so
Are you constructing it or editing it after construction?
Are you using an object rich or norm?
richembed
If I remember correctly then you would just need to do something like this - https://stackoverflow.com/questions/1168807/how-can-i-add-a-key-value-pair-to-a-javascript-object
oh i know how to do that
Yeah try that out and see if it works
are bots still allowed to upload emojis to the guild
Let's say they can
yeah
Ratelimit though, about 30 mins cd after you upload like 50 emojis i think
the add emoji endpoint was useronly at one point
In ejs, does anyone know how can I access a parameter passed into the module from an included module?
In index.ejs, I have <% include ../partials/navbar.ejs %>
in express, res.render("pages/index.ejs", { opts: { active: "/" }});
but the navbar.ejs
cannot see opts
yeah cant you just include('', {})
oh, you can do that?
now index.ejs also tells me that opts dont exist

this is extremely weird
I did this now
app.get('/', async (req, res, next) => {
res.render("pages/index.ejs", { active: "/" });
});
And added
<%= active %>
in my index.ejs
and it still throws an error
Ah nevermind
im a bit of an idiot
I didnt restart the node process when I made changes to index.js
too used to webpack and auto-restart
ยฏ_(ใ)_/ยฏ
so yeah, sorry for wasting your time
How do I make my bot show the amount of servers it's in on the website?
#312614469819826177 @glacial sentinel
Thanks! @solid cliff
hmm it's showing here tho ๐ค http://prntscr.com/jb691t
I fixed my restart issue by creating a script with fs-events-linux which automatically restarts the server on file change
or you could use something like nodemon?

https://donbot.space/i/434f76a.PNG why am I getting 401 unauthorized with access denied as the response body?
consider manually making an auth request with curl to check if your credentials are valid
I just pushed out >dbl on my bot if anyone want to try it out
>dbl <bot ID or mention>
@spring ember btoa isn't a native thing in node, how are you defining it
oh
it occurs to me you aren't even sending the bearer token lol
cred is unused it would seem
oh nah, he doesn't need the bearer token, he's just getting an auth token which all you need for is client ID and secret
I required it and downloaded it via npm @uncut slate
he's not using BASIC auth, just passing the params instead
its
how would u make a bot ignore its own reactions? Im using python and async. I know sorta how to do it, but it seems like nobody online knows the exact code.
Basic Buffer.from(`${clientId}:${clientSecret}`, "binary").toString("base64");``` for authorization
not necessarily
Yes it is
if and only if you're using basic auth though
literally how the dAPI works
nope, you don't need to use basic auth
you can pass it as a param
either is supported
const options = {
ย ย ย ย ย ย ย ย client_id: _this.bot.user.id,
ย ย ย ย ย ย ย ย client_secret: _this.config.bot.secret,
ย ย ย ย ย ย ย ย grant_type: 'authorization_code',
ย ย ย ย ย ย ย ย code,
ย ย ย ย ย ย ย ย redirect_uri: `${_this.config.web.domain}/discord/cb`
ย ย ย ย ย ย };
blame GitHub for indent
and?
that's all you need to pass
Can you explain what you mean instead of giving code that means nothing?
@spring ember I'm not sure if snekfetch auto converts objects to urlencoded, that might be your issue
@earnest phoenix you don't need to use your method for auth, you can pass the client id and secret as parameters aswell
Hi
Anyway i sent him how i do it considering he dmed me 
my way is the shown way
I've never seen your way done
Yukine told me to reach out for you 
it's known that the dapi docs are of questionable quality
because he said you did a web dashboard
Well i am working on it rn
lol gonna use vue with express
And you're sure your ID and secret are valid?
That code is very incorrect in that screenshot above tho
Hard to tell what part bc its a screenshot
somehow the problem is that the authorize site doesn't authorize the bot because it is not on my authorized apps
and idk why
@spring ember whats the issue exactly? i remember dealing with this
you did add your localhost to a valid URI redirect, right
Use the code that i sent you, lol
yes
you cant use encodeURI like that first of all, snekfetch does it for you
you dont need to set Content-type
snekfetch does it for u
oh
oh yeah, encoding it twice would make it invalid
if the oauth authorize page says something is wrong, open dev tools go to the red link, click on it and find the preview it will say why
umm now I am getting unsupported grant_type
grant_type is code
Yes
if (!req.body.code) return res.status(400).json({ message: "No code provided" });
const creds = Buffer.from(`${clientId}:${clientSecret}`, "binary").toString("base64");
const response = await snekfetch.post(`https://discordapp.com/api/oauth2/token`)
.set({ Authorization: `Basic ${creds}` })
.query({
grant_type: "authorization_code",
redirect_uri: req.body.redirectUri,
code: req.body.code
});
if (!response) return res.status(500).json({ message: "Error fetching token" });
return res.status(200).json(response.body);
``` this isnt express (btw, its for vue-auth not ur normal discord oauth implementation)
.query vs .send?
Im trying to make my bot send and image in an embed but he image doesnt come up
hi
Really aeth?
wat up
take a guess
dont say it blake
BACK
lol
nu
@earnest phoenix Dondish is using send, you're using query. Calm your ass down.
i got a problem
the mods are here
I'm not asking a question.
you'll get muted
wait me
@hidden veldt whats the issue
because, you're meant to query it not send the data
@uncut slate send is object type query is for setting parameters one by one
I was getting into that
how do u make a python async bot not react to itself?
check if the author's id is you
how would I do that
you use on_message()?
@hidden veldt return if the message author is equal to the bot ID
it says message is not defined
I'm fully aware, I'm pointing out that you're using query and he's using send for the same purpose
@uncut slate opposite lul
@client.event
async def on_reaction_add(reaction, user):
if reaction.emoji == "\u0031\u20E3":
await client.send_message(reaction.message.channel, "yay this works!")
heh...
that works fine
on_reaction is not on_message and you can get the message from the reaction
@bot.event
async def on_message(message):
if message.author.bot:
return
bot.process_commands(message)
```@hidden veldt put this in the main file and it will completelly ignore all bot messages
@spring ember I was talking to Jacz
...
I doubt there's any point in me repeating myself again 
reaction.message.author.bot
he's using py, Dondish
it is in py
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "C:\Users\edwar\Desktop\Bot-Lib\TB\v1.py", line 36, in on_message
if message.bot:
AttributeError: 'Message' object has no attribute 'bot'
oh, deng
ok
this will check if it's a bot user
i wanted to know the same thing
reaction.message.author.bot @hidden veldt
oof
hello?
hi @knotty steeple
https://donbot.space/i/f011833.PNG so I did this and I get 400 with unsupported_grant_type
Send embeds you mean?
yee
@knotty steeple https://discord.js.org/#/docs/main/stable/class/RichEmbed
@spring ember try setting redirect_uri to /callback instead
i sorta hate it when people tell me to look at the docs
but ok
maybe it works for other ppls
it will be an infinite loop natan lul
no
nah
it won't
wat
the redirect URI is the callback page
the page Discord redirects you to
still unsupported_grant_type
@spring ember can i see the redirect URI's you've set on your application page?
have you set them up properly
yes
if it's even off by a bit it won't work
it isn't
i had the same issue
http/https matters in that
the grant_type is 100% authorization_code
Can we see full code
you're just posting screenshots, its quite annoying
so use richembed maybe
Donkku
@client.event
async def on_reaction_add(reaction, user):
if reaction.emoji == "\u0031\u20E3":
await client.send_message(reaction.message.channel, "yay this works!")
if reaction.message.author.bot:
return
I have a lot of code which is basically not relevant
@knotty steeple refer to the Discord API docs if you want to send raw embeds
@spring ember Just that endpoint...
reactions
no
/callback
^
?
@hidden veldt you want to return before you react
Did you save the file and restart the app?
OH
yeah
do the check first
#development-2 when?
never
https://hastebin.com/axodilinoz.javascript this is my callback
@client.event
async def on_reaction_add(reaction, user):
if reaction.emoji == "\u0031\u20E3":
if reaction.message.author.bot:
return
else:
await client.send_message(reaction.message.channel, "yay this works!")
?
@spring ember dude
use the code i sent you
you need to use.query
yet you're still using .send
ok
also
oh my
ok now it wont respond to my reactions
.then((result)=>{req.session.token=result}) this isnt gonna work
...
.then((result)=>{req.session.token=result.body.access_token}) will
im not talking to you, tristan
oh
@hidden veldt put the return at the very very top
all g
like htis?
I think it is stuck on infinite loop
if bot:
return
# the rest of your code
return
@client.event
async def on_reaction_add(reaction, user):
if reaction.message.author.bot:
return
if reaction.emoji == "\u0031\u20E3":
await client.send_message(reaction.message.channel, "yay this works!")
like that...
no return at the top
that was an accident
copy pasta accident
nvm query fixed it
yeah, the rest looks fine
ok
thanks to everyone
cool
np @spring ember
@spring ember yw
oh...
if you used my code at first it would've work :p but its okay i forgive
um it still wont respond to my reactions
okay Tristan, you can have #development back
@earnest phoenix i never used snekfetch for my authorization code, i stored the URL in a variable and i posted using http
๐คฃ
whoah
there are these bot devs just goin online
im just watching the numbers go up
...
@austere meadow callback https://jaczaus.me/i/jgjdjl8yb7d4c34.png
user https://jaczaus.me/i/jgjdjyvabee9ef8.png
@austere meadow same, I use https


Why use https when snekfetch has no deps, make no sense
why use a dep if https is a built-in, makes no sense
HEY WHO WANTS TO HAVE #development NOW?
Tristan, what do you need right now
show code
kk
in a codeblock this time ๐
@client.event
async def on_reaction_add(reaction, user):
if reaction.message.author.bot:
return
if reaction.emoji == "\u0031\u20E3":
await client.send_message(reaction.message.channel, "yay this works!")
wat
how u do that
๐ฆ
```py
code
```
isnt that 2 reactions.. and does JS read it like that?
Yes but, snekfetch has no deps, uses https/2 which is faster then http/https :^) and provides a simple to use interface for doing requests with no deps and its made by a nodejs module team member so its good :)
er py
then use https/2 in your own code
"\u0031\u20E3":
me...
are those 2 different reactions?
someone not using a lib you like isn't a bad thing
1โฃ
find out where it gets stuck
u have to get the unicode character im pretty sure
yay
logging to the console
\1โฃ
1โฃ
wait wtf


