#development
1 messages · Page 805 of 1
wait how do you disable events in v12
nevermind
its possible
apparently it was b'locked on our network because the bot keeps trying to download MULTIPLE GIGS of data in a day
but its one ugly workaround
@grizzled raven js const PacketHandlers = require(require.resolve("discord.js").replace("index.js","")+"client/websocket/handlers"); const disabledEvents = ["evt1","evt2",...]; for(event of disabledEvents) { delete PacketHandlers[event]; }
thats what i came up with lmao
if you find a better way let me know
i need to find out why my bot is taking gigabytes of data transfer in a single day
yeah idk
and stop it
I told you how to stop it
Anyone know how I can get these to go inline how I want them to 🤦🏻♂️🤷🏻♂️ for the Long Description
EAI_AGAIN is a DNS lookup timed out error, means it is a network connectivity error or proxy related error.
i think the big bot is in 26 servers
you could also host it on a vps or something 🙂
it has a thing that sends images but it never directly handles them
it only serves images from a website
as a link
are you running on linux
can you try running nethogs?
it only shows my ssh connection on it
are both bots broken?
i think its because its still blocked because it was downloading so much data
my pi is blocked from accessing the internet
yes
does your isp have bandwidth restrictions?
no im talking about a block thats internal
you think your own home network/router is blocking it?
that makes no sense
why
your pi is in your home right?
weve got a PFsense that takes everything to the router
everything goes through that
and it ccan block stuff and throttle stuff
but i am not in control of it
ah so you think pfsense blocked it?
not think, i know
because the person who controls it told me
after i asked why my pi cannot access internet
then ask him to unblock it?
no way to find it without testing
because we have slow internet so he doesnt want it to take all of it even for a while
still waiting on nbn
got a 1 megabit connection
idk why but i feel like that disabled events thing would be useful for alot of people
well, im gonna tell you one thing
discord bots are bandwidth hungry
unless you use intents
for example
Id just move it off site tbh
you can get bot hosting for a dollar a month
do they auto download images?
this is my bot without intents, with default settings:
the bot
thing is i have no money for this
out of those 2000 guilds, discord bot list alone accounts for about 1/4th of users
its just a passion project and i had a pi lying around
so its safe to say this guild is responsible for at least 40-50kbps by itself
1mbit is 125kbps max
oh hmm
Im trying to think of solutions
so 2 bots in this guild will use almost 100% of your bandwidth
can you link a place where you can get the supposed 1$ host
if you have unmetered, all those stats dont matter, right?
now, the only solution is to use intents, which is a way to tell discord to send you only what you want
I would host it for you on my dedicated server but then you wouldnt have access (I cba to setup another ftp account and set perms)
because im hella unorganised
thats where i hosted my bot before i bought a server
$3 a month is probably the least you will find/get for a vps that can run a Discord bot but i might be wrong
for small bots, glitch.com is good enough, and its free
a decent vps starts at around $3
if you use it right
really?
its not a vps
and doesnt glitch only allow a certain number of hours?
Glitch is free but not suited for Discord bots especially if your bot gets big enough
another option is google/amazon, which both offer free for 12 months deals
^
but you need to sign for that
yes
@earnest phoenix people get around that by constantly pinging the host every hour to keep it running
meaning you pay in the future
no
wait whats this 18 bucks
128mb/512mb ram is not enough for a bot
never pay again?
lifetime hosting lmao
you pay 18$ and never again
thats for just a bot host
no vps just a control panel like minecraft hosts
Wait lifetime 
I'm here to plug galaxygate
my bot did fine on the 2$ plan with about 10 servers
im on galaxygate as well
only used a tenth of the resources
but it depends on your needs
music eats resources like crazy
@earnest phoenix is it a node.js bot? does that ram account for the node process?
according to them, a life lasts 18 months
lmao
lol
e.g. changing volume, filters, etc.
Yes it is, and im not sure what you mean but my bot used about 50% of the basic plans ram
100% all the time
i just want to run on my pi :///
because the node process by itself already uses about 50mb ram
so 128mb ram is very small for a node.js bot
because my pi means i can SSH to make any changes very quickly
you can ssh on any vps
but is it speedy
they have a free trial
so does galaxygate iirc
512mb ram for a js bot in this server will be screaming
c# will work though because it dosen't succ ram
if your internet is good, yes lol
lol
i have 1 megabit
Ouch
125kb/s
my suggestion is
if you want to start with something small and simple, give glitch.com a try
im not just starting tho
Huh, Changed my lavalink password and keep getting this
2020-03-01 18:33:42.649 ERROR 12648 --- [ XNIO-1 task-13] l.server.io.HandshakeInterceptorImpl : Authentication failed from /3.84.214.88:52772
2020-03-01 18:33:42.698 ERROR 12648 --- [ XNIO-1 task-14] l.server.io.HandshakeInterceptorImpl : Authentication failed from /54.152.134.66:54634```
Glad I changed it lmao
then if you feel you want a full machine, give google's free plan a try
then i recommend getting an actual vps
i has no money!!!!!
also, your bots will have very high latency in your pi probably
reee
a vps will fix that
get a job
@hybrid geode
he may not be able to work
true
@quartz kindle latency on pi is about 100ms
then your internet is not even that bad
i have no 3$ a month to pay
when i started, i used to host my bot in a spare laptop, in a third world 5mbit internet. the bots's latency was anywhere between 1s and 20s randomly
h3, do you have access to a credit card, or can borrow one?
no
@lethal stratus and latency was 20x worse than yours
not untill like next year can i legally get a job either
nor are parents concerned about paying for a thing for me that has no real purpose to them
but the domain is useless and im gonna replace it for something I'll actually use
then your only option is glitch/heroku, both of which are free with some bypassable restrictions, but they are not full machines, only app instances
cause my bot is gonna be no more
parents will not pay for my stuff
i just wanna keep using my pi ;-;
maybe gotta hold out a few months for NBN
then youll have the bandwidth issue
then internet will be able to support my pi being online
i can help you debug your pi, but you need it to be unblocked first
maybe move it to google till you get the better internet?
Or move it and have tim help
also holy shit you cant do anything with 2GB storage and 128MB ram
or that
on sparked
@topaz fjord you can host a Tekkit 3 server
you can turtle XD
I did it while i made the first version of my bot
I should start up my bot for a bit
indeed
but that's not gonna happen
oof
tbf my bot was an open source bot but i redid almost all of it now im starting from scratch so it can truly be mine
Only like 2 of the original commands are the same
btw
?
aight scp'd files over
what is intents
how do you use them @quartz kindle
intents are a discord option, where you can select what kind of stuff you want them to send to you, instead of simply sending everything
you can disable certain events with intents
how do i use it timmy boy
then i may have a good argument to unblock bot
probably not
??
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
images are part of message events
if you disable images
you disable messages as well afaik
in discord.js you can use them with the ws client options
yeah they aren't seperate
new Client({
ws: {
intents: bitmask
}
})```
i need to see if JDA has something for this
how do i tell it not to download the images
the problem is not images
90% of the bandwidth is presence updates
aight i am running my bot
try adding this to your bot: js client.on("raw",r => { console.log(r.t) })
and you will see
it is immediatly maxing out my connection
I can probably get rid of ```
DIRECT_MESSAGE_TYPING,
GUILD_MESSAGE_TYPING,
DIRECT_MESSAGE_REACTIONS,
GUILD_PRESENCES,
GUILD_INVITES,
GUILD_WEBHOOKS,
GUILD_INTEGRATIONS,
GUILD_EMOJIS,
GUILD_BANS,
GUILD_MEMBERS
also, can i see your code?
god damn that's a lot
it says
@topaz fjord the most problematic part of intents is that disabling GUILD_MEMBERS also disables guildMemberAdd, guildMemberRemove and guildMemberUpdate
other than that its fine
READY
GUILD_CREATE
GUILD_CREATE
GUILD_CREATE
GUILD_CREATE
GUILD_CREATE
null
null```
yeah, but if you use any kind of user count tracking, it wont be updated
yup
fuck
@lethal stratus thats all? nothing more?
ok now im REALLY confused
the incoming traffic for my bot is
143 bytes/s
now
what if i boot up the other bot
thats in discord bot list
ah so that one is not in the list?
yes
alright, now try the one in the list lul
you'll see what 80k members do to your bot
kk
wut
my old bot thats on bot list
its so badly written
the code burns to look at
its booting
holy crap
thats a LOT of GUILD_CREATE
how many guilds are you in?
26
ah thats not much
imagine 2000
your code may give you cancer but this gives me joy
exactly
like wat
thats what discord does to you
discord api is good software™️
people coming online and going offline
thats what it is
I wanna make a new bot but im bored af
im secondthinking ever putting my bot on the list
look at the timestamps
thats like 30 updates in 50 milliseconds
tim im taking that as a yes
writing my image server
in rust
while I finish the application that goes with it
in obj-c
do you think i should get my bot removed from the list so i can actually have a functional bot
you're gonna rust now
guys?
lmao
aight im gonna remove it from the list
goodbye bot dev role, and goodbye h37 from this server
F
@lethal stratus what does your bot do? depending on your needs, you can use intents
what about message events
you don't have to leave
what do intents dooooooooooooooooo
@grizzled raven what about them
nothing
@topaz fjord if its stopping me from having a bot at all, yes i do
i already told you want intents do, they tell discord to only send you XYZ instead of sending you EVERYTHING
but intents have certain restrictions, so depending on what your bot does, you might not be able to use them without developing workarounds
ahhhhhhhhhhhhhh
It will actually be really helpful to save memory usage so you dont get events for stuff you dont use
well my bot only really does random stuff with messages
alternatively, you can try using my library, which takes care of all that crap for you
It's just privileged intents are garbage
^true
when gateway v7 gets released
intents can only do so much
the issue is just having the bot in such a massive server
as such
it makes sense for me to remove it from the list
thats not an issue
and keep it as a thing in just a few servers as something for fun
it only becomes an issues if the hosting decides to die
@lethal stratus try doing this: js client = new Client({ ws: { intents: 1+512 } })
that will enable only guilds and messages intents
ah
k
ah
yes
no perms
looking at console
things look good
its only getting MESSAGE_CREATE
which is actually all it needs!
thanks!
now you need to care for certain things
for example
with the intents i gave you, there is no roles, no permissions, no emojis, no dms, etc
ah
it doesnt need anything but messages lol
my other bot however
i type faster than i think
:^)
needs to know who has what roles, needs reactions, dms, and messages.
you can enable the roles, reactions and dms intents
k
check this
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
for example, 1 is guilds, and it includes all these
512 is messages, and it includes all these
my bot has gone from eating all resources
and maxing bandwidth
to requiring a similar level of network as my other
you're welcome
Anyone know how I would setup a lavalink node on heroku
is there a link on a step to step guide on a music bot?
Yeah
As easy as google
lol
I mean, I googled my question, wish it was easier
where do I put the touch commands?
the documentation is the best guide available
Is it a problem that my bots mostly only reacts to the guild owner?
it shouldnt be a problem
unless you set it up that way
for getting on dbl i believe so (see modlogs) but maybe that was the intent?
if it was let them know 🙂
I think having it in the site description would be okay. but tbh idk
ive never heard of this
I asked xig in #general
how come it wont join the voice channel?
2020-03-02T00:50:30.460013+00:00 app[web.1]: Error: Unable to access jarfile target/Lavalink.jar```
This is on heroku btw
Im not sure how to make it work
@earnest phoenix cause you need to be in a voice channel for it to join it
What version of discord.js?
try
if(message.member.voice.channel) { ....
if you're in V12
how do I check version?
so
if(!message.member.voice.channel) return message.channel.send("Must be in a voice channel...");
Oh
require('discord.js').version
Theres an npm command just forget what it is
Why do you have 2 message events
Also, I dont recommend using ytdl-core, I recommend lavalink lmao
its a broken code
There's no need for 2 message events
oops
its 12.0.1
turtle I was the same way when I started coding lmao
Okay so try the if command I sent you
instead of Member.voiceChannel
its <member>.voice.channel
send me the whole code
:/
so where do I put this code at?
(!message.member.voice.channel) return;
he told you
instead of Member.voiceChannel its <member>.voice.channel
just replace it 🙂
where do you see member.voicechannel?
lol
this one?
Yep
Thats why i dont like the new update XD so much has changed
but ig its meant to be easier /shrug
and yes
and the if command below it
replace the if command
if(!member.voice.channel) {
do stuff
}
member is your member object, so message.member
message.member.voice.channel
the if command below that line
yeah
so 1,2,3 or 4?
var memberchan = message.member.voiceChannel
memberchan.join()```
This work
:)
well V12 just came out so
I know
message.member.voice.channel.join();```
how do I change my discord.js version?
@quartz kindle hey about your disabled events thing,
const PacketHandlers = require(require.resolve("discord.js").replace("index.js","")+"client/websocket/handlers");
const disabledEvents = ["evt1","evt2",...];
for(event of disabledEvents) {
delete PacketHandlers[event];
} ```
couldnt you change the `.replace("index.js", "")` to `.replace("index.js", "client/websocket/handlers")`?
is it really that complicated lmao
@earnest phoenix what version you want?
yeah lmao


var memberchan = message.member.voice.channel.join();
memberchan.join()```
not recommended but still doable

lmao
well, i want my library to hack discord.js programatically
without touching any original files
:^)

its a pain though having to redeclare an entire function just to change 1 line
Hmmmm
when I type my sb!play command the bot joins but when I provide a link it doesnt play anything any fix?
the fix is learning programming, so you can understand what your code it doing, and be able to fix it yourself
Nice
😂
2020-03-02T00:50:30.538728+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-02T00:50:30.520009+00:00 heroku[web.1]: Process exited with status 1
2020-03-02T00:50:30.455447+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-03-02T00:50:30.460013+00:00 app[web.1]: Error: Unable to access jarfile target/Lavalink.jar``` my heroku bein bad
@grizzled raven this is a screenshot by yeet
for (event of x) should be for (const/let event of x) because event isnt defined 
xdd
it doesnt really matter, although yes, its good practice
Oh okay
its the same as for(i = 0; i < something; i++)
it wont throw i is undefined, it will treat it like a var
ok so how do I make the bot play music because the joining part is done
Get the connection
var connection = message.member.voice.channel.join()
instead of { voiceChannel }
so do I put it in { connection }
that code is so wrong
Why tf do you need that 3rd line
trying to join twice, trying to destructure voiceChannel from a pomise
Also checking if the command was sent in a text channel....
oh really?
😂
oh ok nevermind then
checking if its a text channel is good practice tho
thought you had to define the iterator lol
you do, but javascript treats anything followed by a = as a variable
No I'm saying a message handler would never trigger for a voice xhannnel
Channel *
So why bother checking
to check for dms
Eh. True.
!== "text" is the reverse === "dm"
@earnest phoenix remove the var, and the if statement, replace it with js if(!message.member.voice.channel) { return message.reply("Please join a voice channel first"); }
Then replace voiceChannel.join()
with message.member.voice.channel.join()
I mean, not the most organized but should work?
¯_(ツ)_/¯
it does
did you read the discord.js installation guide?
node-opus is deprecated, dont use it. and no need to install both, only one of them
lavalink
still no music
whats the error
The preferred audio engine is @discordjs/opus, as it performs significantly better than opusscript. When both are available, discord.js will automatically choose @discordjs/opus. Using opusscript is only recommended for development environments where @discordjs/opus is tough to get working. For production bots, using @discordjs/opus should be considered a necessity, especially if they're going to be running on multiple servers.
it is an error lol
it just doesnt play music
Tim, you take this. idk discord.js LMAO
I recommend using lavalink @earnest phoenix instead of ytdl-core
i dont use voice
but try adding a catch statement to join
message.member.voice.channel.join().then(connection => {
// do your stuff here
}).catch(console.log) // add this```
I throw errors instead of using if-statements
throw an error to catch it later
its true that its kinda easier to throw errors into a global error handler :^)
microoptimizations

when you're 5 levels deep into nested code, its either throw or having to handle a return 5 times
its not a error
@earnest phoenix are you dumb? it's an error, it fucking says error, learn to read, then learn to code
That’s why I am waiting. I’ve already started redoing my entire bot don’t wanna restart the revamp
isnt
voice.channel.join()
lowercase C ?
and if (message.channel.type !== "text") return;
why a filter just let ppl in a txt ch to use it
@copper cradle who tf was talking to you
@earnest phoenix this is lowercase
isnt it
connection.play(stream)
voice.channel.join() is correct
In v12
v11 =
voiceChannel

i don't understand why people think v12 is an easy upgrade from v11
v12 breaks a lot of shit
who the hell even requested them to change from "Attachment" class name to "MessageAttachment"
Lol
v12 had too much changes
Don't go to v12 directly
"Removed Attachment in favour of MessageAttachment"
V12 of, um, d.js?
my lib is only on v3 lol
Yeah of d.js
Lol v3 upgrade no?
what is this "d.js"
@earnest phoenix well if you do npm i discord.js now its all v12
Yeah
:c
I know
But we can
npm i discord.js@version
npm i discord.js@11.5.1
npm i discord.js@11.6
npm i discord.js@11.6.1
etc...
I honestly stopped updating my bot because of the changes and commits that were flowing in constantly
No more updates for v11
It is?
But this is a good choice i think
I'ma switch from PageKite to WebhookRelay for my projects I think
Because I have no credit card
Though I have to check if the free plan will be suitable
Oof
their create account page gives a 404 error
I logged in with GitHub already anyways though
@earnest phoenix this channel is for asking dev questions, anybody can answer to u regardless of how rude they are, if you don't like it then you can leave
Ok, I ran this in glitch ```js
const config = require('../config.json');
let prefix = config.prefix;
module.exports = (client, message) => {
if (message.author.bot) return;
if (message.content.indexOf(prefix) !== 0) return;
client.message = message;
const args = message.content.slice(prefix.length).trim().split(/ +/g);
//console.log(args);
const command = args.shift().toLowerCase();
//console.log(command);
const cmd = client.commands.get(command);
//console.log(cmd);
if (!cmd) return;
//console.log(cmd);
cmd.run(client, message, args);
};
and it saysjs
cmd.run
you're exporting the function the wrong way
@copper cradle you legit called me dumb but what ever
you're trying to do cmd.run
but you didn't export the run function
which proves my point on the first message
@pine bear
Mmm
also eww glitch
and yes i'm a hypocrite
@copper cradle You legit have down syndrome and your retarded dog profile pic is ugly that trend is dead
chill lmao
or dont fight in development before I mute you both
^
"regardless of how rude they are"
are you "not stopping"?
I'm trying to make an event handler but then it says this. ```js
emitter[once ? 'once' : 'on'](event, (...args) => eventFunction.run(...args));
what is event function
eventFunction is a read
log that
^
Mmh guys I get an error when supplying client on the DBL constructor (bad request), is it relative to the new d.js@12 update and DBL api not updated for that purpose ? (a .cache to add ?)
Note that it happens only after updating the library (and reinstalling all of them at the same time).
(node:18762) UnhandledPromiseRejectionWarning: Error: 400 Bad Request
at IncomingMessage.res.on (/home/cata/Dev/Discord/./node_modules/dblapi.js/src/index.js:118:25)
at IncomingMessage.emit (events.js:198:15)
at endReadableNT (_stream_readable.js:1139:12)
at processTicksAndRejections (internal/process/task_queues.js:81:17)```
most likely dbl api is still not updated for v12
you can just post the request your own
on dblapi js
yess
do that instead
a raw post should also work right
ok here is the event handler is was able to come up with. ```js
fs.readdir('./events/', (err, files) => {
if (err) return console.error(err);
files.forEach(file => {
const eventFunction = require(./events/${file});
if (eventFunction.disabled) return;
const event = eventFunction.event || file.split('.')[0];
const emitter = (typeof eventFunction.emitter === 'string' ? client[eventFunction.emitter] : eventFunction.emitter) || client;
const once = eventFunction.once;
try {
emitter[once ? 'once' : 'on'](event, (...args) => eventFunction.run(...args));
} catch (error) {
console.error(error.stack);
}
});
});
So i'm a bit confused on how I would do this. This is my ban code as an exmaple.
const mysql = require("mysql");
const fs = require("fs");
module.exports = {
config: {
name: "ban",
description: "Bans a user from the guild!",
usage: "!ban",
category: "moderation",
accessableby: "Administrators",
aliases: ["b", "banish", "remove"]
},
run: async (bot, message, args) => {
if(!message.member.hasPermission(["BAN_MEMBERS", "ADMINISTRATOR"])) return message.channel.send("You do not have permission to perform this command!")
let banMember = message.mentions.members.first() || message.guild.members.get(args[0])
if(!banMember) return message.channel.send("Please provide a user to ban!")
let reason = args.slice(1).join(" ");
if(!reason) reason = "No reason given!"
if(!message.guild.me.hasPermission(["BAN_MEMBERS", "ADMINISTRATOR"])) return message.channel.send("I dont have permission to perform this command")
banMember.send(`Hello, you have been banned from ${message.guild.name} for: ${reason}`).then(() =>
message.guild.ban(banMember, { days: 1, reason: reason})).catch(err => console.log(err))
message.channel.send(`**${banMember.user.tag}** has been banned`).then(m => m.delete(5000))
let embed = new RichEmbed()
.setAuthor(`${message.guild.name} Modlogs`, message.guild.iconURL)
.addField("Moderation:", "ban")
.addField("Mutee:", banMember.user.username)
.addField("Moderator:", message.author.username)
.addField("Reason:", reason)
.addField("Date:", message.createdAt.toLocaleString())
let sChannel = message.guild.channels.find(c => c.name === "modlogs")
sChannel.send(embed)
}
}
It has a modlogs feature where it would put the log into that channel, how would I make a seperate command so that when someone does like !modlogschannel #mod-logs, it would save and put logs into that on there server? Would I need a database to do that?
adding basic analytics to my bot was well worthwhile
im able to see where people are getting confused with my commands and such 🙂
thinking of just making it a bit more fleshed out and releasing it for other discord js users 🙂
could easily dockerize it as its own little app/database
wondering if yall think it might be a good idea?
no its just being displayed as json at the url im using to access it, its not even being stored anywhere except memory atm, but i can easily add it to a database
ah ok
(node:4344) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions11:34 AM
at item.request.gen.end (/rbd/pnpm-volume/04d2b97d-b6b0-4096-bd33-46a980d362e6/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15)11:34 AM
at then (/rbd/pnpm-volume/04d2b97d-b6b0-4096-bd33-46a980d362e6/node_modules/discord.js/node_modules/snekfetch/src/index.js:215:21)11:34 AM
at process._tickCallback (internal/process/next_tick.js:68:7)11:34 AM
(node:4344) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)11:34 AM
(node:4344) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.11:34 AM```
What should i do?
Give the bot the perms it needs?
idk
No like. That's what you do
It says it's missing perms
Looks to be at line 215
i did only ping
As per 3 rd. Section
Then see if your bot has write perms
Or, if [he bot deletes the original command, it needs manage messages
hi, can you change text color in an embed?
wait what
really?
since when
i know you can change the bar on the left side of an embed
Oh
uses a hex code
:p
closest thing to changing text colour would be using code blocks and their types
This Is ProLog
['hello']
1, 2, 3```
?info
#355951168339443713 and ? is a common prefix so you can't use it
guys need help regarding hosting
what do you need help with
or uptimerobot or your own script
Yup
🤔 interesting never heard of them, they good?
yeah
its
not
free
ffs
ppl need to stop saying google cloud is free for 12 months
Lol
you get $300 in credits for a year
Yeah
so its free for 12 months?? lol
NO
yes
You can use your credits to pay for it yes but not for the full 12 months
i lasted 5 months running a mc server off it
or
you can like
do 300/12
and get $300/yr = $25/mo
but yea, it can be free, or certainly not free
it all depends on what you do with it
google cloud also has an always free tier
1 vCPU and 512MB of RAM IIRC
and access to a lot of apis, tho its quota-ed
anyone know how to get a user's connections thru d.py? i'm assuming you'd have to go thru oauth
well
yes and no
you can access that with bearer tokens too
aka oauth
so
my best bet would be to read up on how oauth works?
cuz rn, a bot that keeps track of connections without actually verifying them isnt very useful
@earnest phoenix bearer token = user i think
This isn't possible to view connected accounts with bot????
yeah it isnt
it isn't
and it isn't
uset tokens are user tokens
Oh
bearer tokens are temporary access tokens from oauth
bearer are from OAuth and user tokens are permenant
yes
so basically. i could make a command in my bot to send the user an oauth link and grab their connections?
yeah
How can we make this for get connected accounts ?
that would be the only currently known way
that is okay with tos
Only if the user click he can say his connected accounts or he can autorise for view another also??
you need a webserver for oauth, keep that in mind
Yeah cry
why tho?
redirect urls
and down the rabbit hole i go
https://discordapp.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes consider reading this too
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
im reading it rn
Ty i go on my pc
but this is a tad over my head
so
why doesnt something like this work?
(that is a valid url - just dont click accept xD)
So logically in that way we can do everything only selfbot can do but temporarily?
doesnt it give the bot access as soon as you click the button?
&scope=connections
Oh okay this is really precise
@earnest phoenix
so im guessing the "code" is the bearer token?
well
no
you need to exchange that code for the token
oh.
How?
which is why you need a webserver to get the code and exchange it
https://gyazo.com/09dd14ba31b4d03e0f896eb3c651670a @earnest phoenix lul don't work
ye
ik
ok
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Ty cry you're helpful
^
wait
but
so this server would have to be the same one the bot is running on, wouldnt it?
nope
@earnest phoenix and why you don't have the developer roles where are your bots 

unless you just stored the token temporarily and grabbed it with your bot?
well if you want to easily access the properties with d.py then yes
yeah
that
@earnest phoenix i think you just have to grant the access and this work for 1 request per 1 request
1 baerer token = 1 time get connected accounts
No?
so, set up a thing on heroku to do oauth and get token, and grab token w/ my discord bot, and that canbe used normally?
@earnest phoenix i used to have a bot but i quit public bot deving and i dont publish bots on top.gg cause they take ad revenue from your bot page
@earnest phoenix ?
@earnest phoenix oof bad thing i don't see that i have an ads blocker
yeah same but some people dont
@earnest phoenix yeah
if you can, use a vps instead of free hosting
yea
ik
i'd just use it as a test ground
if you don't have a backend server there is an implicit auth flow which sends the token instead of a code
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
ty
but wait this still doesnt solve the problem of getting the token to my bot
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
with that you can use your client id and client secret to get an access token for your account
as long as i pass client_id and client_secret as environment vars
= bearer token
right
ohh
thats only for ours xD nvm
i misread that
so then i'd have to use a backend anyway
yes
oki
ok so
new thought
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
what exactly does this give
like - i see user access token, for the user that invited the bot
that it?
you can have other scopes while inviting the bot
you get these details if you exchange the resulting code to an access token
for the member who did the inviting only tho right?
@commands.command()
async def role(self, ctx: discord.ext.commands.Context, r: discord.Role):
e = discord.Embed()
e.title = "Role: " + r.name
e.colour = r.colour
e.add_field(name="Members", value=" ".join([
m.mention for m in r.members
]))
await ctx.send(embed=e)
@role.error
async def role_error(self, ctx: discord.ext.commands.Context, error: Exception):
if isinstance(error, discord.ext.commands.ConversionError):
await ctx.send("Oops. I can't seem to find that role. Double-check capitalization and spaces.")
my error handler isnt working ):
it just doesnt even trigger
How can I create a voting link instead of ID making it the name of the robot؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟
I mean, how do I make it in the name of the bot
you mean top.gg/bot/botname?
YEP
your bot needs to be certified
How
THX
Wth is this? It had 30+ votes
Rip


