#development
1 messages · Page 1326 of 1
i have 2 events
One message removed from a suspended account.
Ctrl + F
Then search for.on(
that's fucking same for every text editor made by people with at least 1 IQ
One message removed from a suspended account.
who me those results
@earnest phoenix some 300iq editors might not have the same keybind
except vim
its showing 4 results
who me those results
@opal plank world health organisation is not a function
show me the results
One message removed from a suspended account.
those are all of your results?
those are all the events
it DID say emitter on the error though
why isn't there a
"aroundsorry
@earnest phoenix its an embed
express.js event listeners? I import that shit from my other files into my main bot code and run it so all errors trace back to the main bot code file
did you search across all files lol
try .on( and .emit( @tardy hornet
if they do ctrl + shift + f it might come with librbary results
One message removed from a suspended account.
okay, try with .emit(
possibly the reaction collector then
i have reaction collector
uuugh ngl its 10AM and im borderline sleeping rn
been awake all night
is there a way to check how much resources a single Chrome tab is using
because I'm about to do a for loop on an array of 100 elements and add an event listener for each
my goals are beyond your understanding
I'm making a high-tech ball pit
cant u do ctrl esc on chrome?
erwin
yes
@earnest phoenix shift + esc
ok
aight
is it normal to have a non-discord tab use 80KiB+ of RAM and 30% average CPU
not unless it's mining bitcoin 
update from windows caveman edition and most of your ram and security issues'll go poof
why would i do that for a private repl (which i made public because repl won't lemme make it private wihtout paying)
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
do you think they'll accept my shit school
any .edu email iirc
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
wat's dat
also i don't really need the student dev pack
you just need an .edu email or your school has to be enrolled in some online system
You have a college with a .org?
One message removed from a suspended account.
mine is @skole.hr but it still got accepted
i think they allow anything from jetbrain's SWOT
why don't they use .edu for their emails? lol
One message removed from a suspended account.
You have a college with a .org?
@faint prism my computer book says that extension is for non-profit organisations iirc
https://github.com/JetBrains/swot just see if your email TLD is here, if so you're qualified for github student pack
One message removed from a suspended account.
One message removed from a suspended account.
hey guys i would like some help with my code
hey guys i would like some help with my code
@sly marten elaborate
*proceeds to not elaborate*
im confused
hi confused
your idea is not intellij
i tried to do this:
if (message.content === 'NKBot') {
message.react('👀');
}
and got this: ReferenceError: message is not defined
wtf
lol
what did you define message as
is it inside a message event handler
look in your callback function
huh? (if you're not willing to deal with someone that has 0 discord.js knowledge, then say it now)
huh? (if you're not willing to deal with someone that has 0 discord.js knowledge, then say it now)
@sly marten You did look at the example on the front page of discordjs right?
https://discord.js.org/#/
One message removed from a suspended account.
One message removed from a suspended account.
what about that?
they gave an example
does your code look similar to what is highlighted?
wdym look similar
specifically where they define the variable msg
just show us your code
all of it?
sure
reset it
oh shit i forgot to remove it
ah yes a big brain moment right there
guys i told you im useless
learn about scopes
guys i told you im useless
@sly marten so were we
Not the point. You learn
lmao we just taught you common sense
@earnest phoenix dont go too hard on him, hes a beginner.
Guys I just started with mongoose database and I have a question
How can I set a value in a specific data collection?
if hes a beginner then he should learn the basics before getting started
mhm
if hes a beginner then he should learn the basics before getting started
@earnest phoenix smth i totally ignored and now my bot is hell
if hes a beginner then he should learn the basics before getting started
@earnest phoenix and there is still no reason to be rude to him if hes literally just getting started.
Guys I just started with mongoose database and I have a question
How can I set a value in a specific data collection?
@balmy anchor Any help please?
patience, it's a virtue
d.js
also this is a random question but is flaze the creator of chip?
please don't repeat questions
sometimes, being too honest is rude. and thats a fact.
+-
also this is a random question but is flaze the creator of chip?
@sly marten no he's not
timo is
no wait timo is not
there is absolutely nothing rude about telling someone they need to learn basics and common sense before making a bot
button {
color: aqua;
background-color: cornflowerblue;
font-size: 50px;
}
the font size ain't increasing tho
what's that code for?
browser console:
-> document.getElementsByTagName("button")[0].style.fontSize
<- ""
select the children of the button
what's that code for?
@sly marten CSS styling
oh i see
i need to learn how to make embeds
cus the help command looks disgusting lmao
select the children of the button
@earnest phoenix why should there be children for a button text? I just did this:
<button onclick="addbody();">Add random body</button>
that button be bachelor

just try it
so i just add innerHTML selector inside the button selector
wat
i was about to say
why is the javascript method working
your existing css should've been working
do you use any css frameworks
no
i only had matter.js loaded
it's probably brave then
wow it's repl not saving the file but showing me it did
hats off to repl
lol
I have a repot to verify bot hacked my server
What i need to do?
@Robot.ReVa💛✨#9368 epic your bot hacked your own server
such thing as hacking a server doesn't exist lol
you leaked your token
someone nuked it
your fault
discord can't and won't do anything about it
I wanna unverified this bot

discord can't and won't do anything about it
@earnest phoenix they can't because their privacy policy says they will NEVER go into any server unless something has been reported to them
why can't people just ask their question in proper english
i spend more time on trying to understand than answering the question
@earnest phoenix look privet
let user = msg.mentions.users.first() || bot.users.get(args[0]);
if (!user) return msg.channel.send("You forgot to mention a user!");
let embed = new RichEmbed()
.setDescription(Buffer.from(user.id).toString("base64"))
.setColor("#000000");
msg.channel.send(embed);
}```

what is this
you tell me
what the fuck
^
????????
read our messages again
this code use??
you explain
you'rre the one who sent the code
bruh
i got on online
let me guess
user token stealer
you googled "js command to hack user token"
this againest of tos?
fuck yes
thats not hacking the token...
you googled "js command to hack user token"
@earnest phoenix no i search self bot
LMAO
Selfbots are not allowed on Discord
i know


what you sent is just converting a snowflake to b64, which yes bot tokens use that algorithm but only for the first part (a bot token has 3 parts)
user tokens use a completely different algorithm + extra security for MFA tokens
tldr it's just a gag command

strange question, js
i saw this dude asking a reaaaaaly strange question which is easily solved if he changes the his logic
uhh gtg cya
fudgeee
Alrighty, I made a command but I want the bot to DM the whole message after I mention. Like if I type ,warn <user> Fuck off It only sends the first message that is Fuck. So what should I do?
k lol that was quick im back
also...
u split it by ``
*' '
meaning the spacebar
Should I send my code
i guess u have it get a specific part of ur array
but since ur array is split in spacebar
u understand now?
async def warn(ctx, user: discord.Member, message):
embed=discord.Embed(title=f"Succesfuly Warned {user.name}!" , description = f"**User warned by** : ``{ctx.author.name}``\n**Reason** : ``{message}``" , colour=discord.Colour.green())
await ctx.send(embed=embed)
emb=discord.Embed(title = f"You have been warned From {ctx.guild.name}!" , description = f"**Reason** : ``{message}``" , colour = discord.Colour.teal())
await user.send(embed=emb)```
I'll check it out
@viscid gale you're not helping
@earnest phoenix u might not know
slot, you're specifically (probably) looking for https://discordpy.readthedocs.io/en/latest/ext/commands/commands.html#keyword-only-arguments
sometimes it's the simple stuff like that that trip us up but ite
@viscid gale i know because whatever you just said is for basic js command handlers, not for dpy
just please shut up if you don't know the library, you're doing the opposite of helping
0..0
library babies
anywhoo.. ever heard what an array is
it exists, slightly different in the languages but same concept
hell that error i explained can happen even in c
quite toxic and immature for a full stack dev if u ask me
i'm a senior fullstack dev
@earnest phoenix so u should know how an array works
So, Stop it. It's just a fuckin messed up shit that you guys are arguing in between
and understand how people would write certain codes to come up with specific errors
why would you call someone "library babies"? like, if it already exists why reinvent the wheel?
why would you call someone "library babies"? like, if it exists already why reinvent the wheel?
@lyric mountain i mean that it's all they know and nothing else
plus he insulted me out of nowhere
:l
i never have or will insult you lol
@viscid gale i know because whatever you just said is for basic js command handlers, not for dpy
@earnest phoenix this counts bruh
from the get go u were on my case
and u didnt even get what i was saying to say this in the first place
he just said that ur comment is irrelevant given the different lang
on dbl vote wasn't printing anything/ send a dm
async def on_dbl_vote(self, ctx, data):
print("Received an upvote:")
await ctx.author.send(f"hey {ctx.author.name}, thanks for voting!")
```
at least u judged that one correctly
now as i was tryin to say for the longest while LOL
sloth, it depends on how ur reading it, to me it seems like u split the recieved message in spacebar since only the first word only was sent, and then u just sent the specific part of the array but, again, since it's split by spacebar probably, it only shows the first word
to prove what im saying, try separating ur command to the bot as prefix warn asdfasdf-asdfasdf
and see if the full message comes in
Gg's my codes worked all I added was a star and it worked
message.channel.messages.fetch({around: "766566025440788481", limit: 1})
im trying to get this to work where i can execute it in any channel but it only searches a specific channel. I've tried multipe .cache.get('channelid') but cant seem to get it to work
what was the code you tried and it didn't work
the thing in the quotes
message.channels.cache.get('channelid').messages.fetch({around: "766566025440788481", limit: 1})
message.channels? you mean guild? message.guild.channels?
when i remove the s it still doesnt work
because then it's a channel object
it doesn't have a cache
it isn't a cache manager
so i want it so when i type in any channel it searches in a specific channel for the message
you're probably looking for Client#channels: https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=channels
ah ok
ohhh... u wanna pull up messages by id basically
yeah
but im running into the issue where it only searching in the channel which i type in
looks like discord.js library so i think there's some documentation about specifically that
something like bot.getmessagebyid or something like that
cant remember off hand
thank you for saying the same thing like i did, except worse
see what i mean about the toxicity
if(message.author.id==='462554041440796674'){
message.channel.messages.fetch({around: "766566025440788481", limit: 1})
.then(msg => {
const fetchedMsg = msg.first();
fetchedMsg.edit(message.content);
});
}
thats the code im using, mainly just experimenting with editing messages
but ite, u said it first is what u wanted to hear
you're flooding the channel like a child trying to prove you're useful and it's very annoying when you've been feeding the wrong information to every single person you tried to help
wow a whole essay
bruh.. im not takin u so srs
so id appreciate u not being so toxic
tnx
settle down now, settle down
ikr
oh my
poggers
btw, what r u getting specific messages for?
guild.messages.fetch({around: "766566025440788481", limit: 1})
im 90% sure thats no better but would that work?
again, you need a channel object
;-;
read the docs and don't assume properties
i sent you a link above, read it, that's what you need
doesn't the message object contains the channel object?
yes but their goal is to access* it to a channel they want
yes but they want to access it from other channels
ah, I see
okay i looked at the website you sent and now im even more confused
then read carefully
don't read it as a guide btw
it's pretty well put together
you're supposed to use it as reference
^
but it won't spoonfeed u
okay... im still confused
ur spoon feeding can come by logging what u get from api
as in testing stuff out urself
the link i sent you tells you that the property is located on your client... so get your client then the property that was linked (in this case channels)
then click on the type that channels is in the docs
you'll find properties that you need to use there
oh also how do you get ytdl to work? ive tried so many ways of installing the discord opus but always get errors
woah there
that was a sharp twist in convo
music stuff is hard and very confuse
ah so thats explains why
I need help to invite giveaway bot in my server but it's showing I can't
well, you can't
link generator
u mean invite ur bot into ur server?
is it a discord error?
I need help to invite giveaway bot in my server but it's showing I can't
@earnest phoenix "this bot already reached guild limit" error?
Oh
oh if that, u cant help it LOL
And wut about other giveaway bots
i have that problem with the buycraft tebex bot... its getting annoying
Oh give me name of one good one
0..0
not only that, if you have non-granted intents enabled it'll be guild-locked even if you're verified
Oh
client.channels.cache.get('766544393460776961').messages.fetch({around: "766566025440788481", limit: 1})
is that better?
there are a lot of giveaway bots there
I do every time
But can't find the best one
@forest drift yes, that should work
look for more popular ones
u could even get a npm giveaway package if u were desperate?
Ok
so how do u get opus to work?
research
a lot
get the hang about basic stuff, then learn advanced stuff and only then, start opus
Or a stacktrace
guys when i put my token it says the token is invaild even i tried regenerate bot token 2 times it still not workin
are you sure you're using the token and not the secret
btw, i wanna know if this is possible.. saw it on stackoverflow a dude asking
the actual problem can be solved with a simple logic change, but the problem they faced with the current logic was very interesting. in javascript, is it possible to make an object which has one of the keys delete itself?
{key1: "asdf", key2: delete(itself)}
is something like this possible?
yes i am sure
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/discordjs/opus/releases/download/v0.3.2/opus-v0.3.2-node-v72-napi-v3-linux-x64-glibc-2.31.tar.gz
node-pre-gyp WARN Pre-built binaries not found for @discordjs/opus@0.3.2 and node@12.18.3 (node-v72 ABI, glibc) (falling back to source compile with node-gyp)
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/usr/local/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
i've never seen that object-with-a-key-that-deletes-itself before
js allows all kinds of crack
not exactly like ur saying because that looks like a json
js allows all kinds of crack
@earnest phoenix alas why JSFuck was born
xD
like 4.4.toString() lol
guys when i put my token it says the token is invaild even i tried regenerate bot token 2 times it still not workin and in another code i tried it worked without anyy problem
Esoteric langs lol
@lost stone are you putting your token directly in the code or
but srs.. the closest i got, i tried {a:1,b:delete(self)} but nah.. it don't work
obj.key2=deleteItself()... wildddddd
@viscid gale delete the key from self-reference
in config.json
what's your code
music

is it posible to use a bot to collect ips?
is it posible to use a bot to collect ips?
@forest drift no
no, unless you willingly click on a link
Discord isn't p2p
phew
{
"token: ""
}
no, unless you willingly click on a link
@earnest phoenix ah ok, and would u have to say where this link goes?
{
"token": ""
}
look, im gonna say it again, the actual problem is easily solved, but the logic that was given, solving it like that, means u have to call a key that deletes itself
no i am pc
an ip logger or something
Ye
but the acc is in mob
is it posible to use a bot to collect ips?
@forest drift if you want to get ur account banned...
it's where the the rule comes from "don't click on random links"
const arr = [{id: 123, val: 'abcd', other: 'abcd'}, {id: 123, val: 'abcd', other: 'abcd', show: true}, {id: 123, val: 'abcd', other: 'abcd', show: false}, {id: 123, val: 'abcd', other: 'abcd'}]
const expectedArr = arr.map(item => ({id: item.id, val: item.val? item.val: '', show: item.show? item.show: 0}))
console.log(expectedArr); //solved-ish
//but honestly, that's the furthest i can go with your strange code golfed syntax setup.. to be honest, using ? is similar to if but NOT if, it's closer to || but anyway
const theRealAnswer = arr.map(item=>{ const i={id: item.id, val: item.val? item.val: '', show: item.show? item.show: 0};if(!i.show){delete(i.show)}return(i) })
console.log('skip what was above, the moment of truth below')
console.log(theRealAnswer)
//now, the logical construct(what u gave the mapper) was impossible to do what u wanted. coding isn't just syntax, it's logic too. you cannot assign a key to completely delete the key itself```
this is what i was refferring too
but don't
Also against TOS if you're collecting data that the user isn't aware of
~~it isn't happening if nobody knows about it
~~
bruh
helpppp
i don't store much data on ppl, feels strange
r/FormatTheDamnCode
(click here)[shady link]
@forest drift if you want to get ur account banned...
@lyric mountain i dont wanna log ips, have no need at the moment, i was asking cause there was a kid who was trying to tell people that mee6 collects ips whenever you type and it was getting annoying
collecting ips directly from discord isn't possible
if mee6 did that it'd have been a quite short bot
you visiting shady links is on you
Like I said, it isn't peer-2-peer
so if u put in bold "This Link Collects IPs" and they still click it, you can't get in trouble or can you?
p2p is just a shadow of skype's failure
i miss selfbots
microsoft is the best at making self-destructing software
skype, explorer, hangouts
Explorer.exe has stopped working
i love what they've done with github and the new edge though
the best part is when you get windows you still gotta pay for a ton of security, its like theyre fully admitting to being completely securityless
win10 is also starting to get consistent and faster
I don't like how they installed edge like a piece of malware
i mean yeah they're trying to push it to people just to claim back some of the market share
anyone know a discord bot that can stream tweets (from many twitter accounts) to channels? the couple ive checked are limited
edge is nice an all but....don't shove down on my mouth please
This
anyone know a discord bot that can stream tweets (from many twitter accounts) to channels? the couple ive checked are limited
@covert tartan they would have the same program that running their bot running puppeteer or selenium
anyone know a discord bot that can stream tweets (from many twitter accounts) to channels? the couple ive checked are limited
@covert tartan done that with twitch, kinda sure it can be done with twitter or other social stuff
very possible
i miss vines
xD i dont
there's the lazy way of just having a push service on IFTTT/zapier
@covert tartan they would have the same program that running their bot running puppeteer or selenium
@viscid gale do you really need something like selenium to just get tweets? lol
I'm sure they have an API too
then just setup a webhook
well honestly, i find it faster to use one of those i already know and just browse twitter with it
i meant time to write bruh.... yea yea there's probably an api, but it would be far bigger and more complex, since the api wouldnt just be to scroll chats
I have this function but it doesn't seem to be running
//Node-Scheduler Function
nodeSchedule: async function nodeSchedule(data, bot) {
try {
(await messageReminderModel.find({})).forEach(data => {
let currentUnix = Date.now()
schedule.scheduleJob(data.time, remindUser(data, bot));
console.log("Scheduled a reminder.");
});
} catch (err) {
console.log(err);
}
},```
```js
//Start core function
core.messageReminderAdd(bot);
//Checks if anything was missed every minute
async function scheduleCheck(data, bot) {
(await messageReminderModel.find({})).forEach(data => {
let currentUnix = Date.now()
if(data.time <= currentUnix) core.remindUser(data, bot)
console.log("Reminded a user.");
});
}
setInterval(scheduleCheck(data, bot), 60000);```
Can anyone help?
like classroom api is a whole lot more than students, chats, rooms, it's all of google integration
cough ifttt
except login to google account thru controlled browser google picks up on and i cant :{
If This Then That
if you want to call a function in setInterval with parameters, you need to wrap it in another function
setInterval(() => yourFunction(a, b), 60000);```
@gritty bolt
is it wrong>? https://prnt.sc/v0n7ko
ew anonymous lambda in setInterval
wtf is that formatting
if you want to call a function in
setIntervalwith parameters, you need to wrap it in another functionsetInterval(() => yourFunction(a, b), 60000);```
@sonic lodge so just like that?
gl trying to shut that interval down
did you have a seizure on your space bar lol
@lyric stag I don't like the formatting. Make sure that the }'s are correct
Send the complete switch statement
xD
yeah that's why i sent an example
ok
tru if u ever wanna shut the interval down, at any time in life, put like a var varNameForInterval before that code snippet
but like kuuhaku said, it'll be a pain to clear that interval unless if you store the timeout object it returns
switch(args[0]){
case 'ping':
message.channel.send('pong!');
break;
case 'invite':
message.channel.send('');
break;
case 'info' :
if(args[1] === 'version'){
message.channel.send('Version 1.0.0');
}else
message.channel.send('Invaild args');
break;
case 'clear':
if(!args[1]) return message.channel.send('Error, Please choose number of Messages needs to be deleted')
message.channel.bulkDelete(args[1]);
break;
case 'embed':
const embed = new Discord.RichEmbed().
addField('Player name', message.author.username);
message.channel.sendEmbed(embed);
break;
oh my
please
kill me
``` puts it in snippet
Make sure you didn't forget the ending }
yeah, a fork with better uptime
you're not closing your else statement, or opening it for that matter nvm i saw the ; there
stinky timo
how often are randomly generated names pronounceable
Also, inconsistent use of curly brackets.
i have no clue xD
embrace the moment
stinky berry
log out how many guilds are within your ws ready event
How do I get all role ID a member have, as an array?
take the member's roles, map to their id
It's around 5000 per cluster
how
in which language and lib
How do I get all role ID a member have, as an array?
@carmine summit member.roles().map(r => r.id)?
per shard im saying
Also, inconsistent use of curly brackets.
@faint prism https://prnt.sc/v0nbro
im trying to see if you're receiving anything at all
ready even is fired when all shards in that cluster are ready
why is it so far away lol
hastebin re-formats the code, so there certainly is an issue with ur brackets
Does that show up in debug event
[WS => Shard 0] Shard received all its guilds. Marking as fully ready.
[ 2:55:10 PM ] [ Cluster 0 ] [ Shard ] WS Shard 0 is now ready
[WS => Shard 1] Shard did not receive any more guild packets in 15 seconds.
Unavailable guild count: 1300
and check ready.guilds
Sure, lemme log raw
??
😔
this.on('raw', (msg) => {
const event = JSON.parse(msg)
if (msg.t === 'READY') console.log(event.d.guilds.length)
})
2020-10-16T14:54:44.267115+00:00 app[web.1]: npm ERR! missing script: start
2020-10-16T14:54:44.275360+00:00 app[web.1]:
2020-10-16T14:54:44.275618+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-10-16T14:54:44.275708+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-10-16T14_54_44_267Z-debug.log
Read the error
Missing script
start
Yes
missing script? check the files ur calling i guess 🤷♂️
ok thx
And it isn’t sendEmbed
i think i am learning form an old video
Now we're getting
[WS => Shard 1] Did not receive HELLO in time. Destroying and connecting again.
${message.author.username}
It is message.channel.send(<embed>)
and
[WS => Shard 2] Failed to connect to the gateway, requeueing...
${message.author.username}
@lyric stag
it's your internet
You need to find a updated video
${message.author.username}
@tardy hornet no
someone know how to fix my thing?
Yes
how
Add the script your trying to run to your package.json

what to put there?
Your script
In package.json: scripts: start: "script"
This happened
start: "script"?
And then It couldn't reconnect any
start: "script"?
@wary flame
go ask in ddevs
I could try with more shards but /shrug
im not having any problem might be a region thing
@wary flame
@tardy hornet yes but not literally "script"[[
Replace script with the actual command/script to run
then like that?
@tardy hornet no
Yes
No
what about the test?
Script
oh ok
But please try to get a basic knowledge of npm/node
2020-10-16T15:08:20.830678+00:00 app[web.1]:
2020-10-16T15:08:20.830704+00:00 app[web.1]: > amongus@1.0.0 start /app
2020-10-16T15:08:20.830705+00:00 app[web.1]: > script
2020-10-16T15:08:20.830705+00:00 app[web.1]:
2020-10-16T15:08:20.842893+00:00 app[web.1]: Script started, file is typescript
2020-10-16T15:08:20.853346+00:00 app[web.1]: \[\033[01;34m\]\w\[\033[00m\] \[\033[01;32m\]$ \[\033[00m\]
2020-10-16T15:08:20.863774+00:00 app[web.1]: Script done, file is typescript
ahhhhh
@wary flame what do i do now
Thats an heroku error
Np
how dev. discord games
no
how dev. discord games
@earnest phoenix ahh
english?
so I'm using nodes built in PassThrough class to store streamable data and pipe it out to a 24/7 stream, but obviously after around 24h the memory size is quite large
the issue here is that i dont see a way to clear old chunks of data without resetting it
ie: losing the pipes / ending the stream and restarting
if anyone here happens to know how to go about doing this, please ping me lol
brooo
@wary flame
what do i need to do noww
2020-10-16T15:17:41.369923+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-10-16T15:17:41.387399+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-10-16T15:17:41.458002+00:00 heroku[web.1]: Process exited with status 137
2020-10-16T15:17:41.496326+00:00 heroku[web.1]: State changed from starting to crashed
how dev. discord games

how do you code voting rewards on top.gg
I have literally zero idea
Listen for votes using webhook
Or check if a user has voted using api when running certain commands
To vote-lock commands
well lets say you had a game and wanted to give ingame rewards to ppl who voted
youd just use a webhook
Yes i'd use a webhook for that
An update on how to clear the memory from a persistent stream, there is a mildly undocumented event called "drain" you can call that drains the buffer storage and doesn't close the stream
kirb!
so stream.emit("drain")
im posting it here incase someone searches for it lol, 4h of searching for that simple answer
👋
DB go vroom
Once I finish V4, I'm just going to drop this table and start from scratch
This is probably the least important table in the DB
The DB for my bot
I ment the db software
oop
Is it mongodb?
MongoDB, yea
yeah
How do you guys get these stats
atlas
Compass pog
The reason this collection was so large is because I had two features that were on no matter what
In V4, I'm going to make it opt-in only, and then drop the DB table so I can start from scratch
V4 won't be done for a while though
@wary flame if you remember my problem from earlier today, how do I make my code work with promises
I'm just learning about them btw
oh
Simply call the resolve function in the query callback
With the value you want to return
I don't see you using the resolve function anywhere
Instead of returning the first result, use the resolve function and put the first result as an argument
hm
i am confusion
i saw a 2013 guide lol

me too
case 'meme':
fetch( 'https://meme-api.herokuapp.com/gimme' )
.then( async response => {
const meme = await response.json();
const embed = new MessageEmbed()
.setColor( '#EFFF00' )
.setTitle( meme.title )
.setURL( meme.url )
.setImage( meme.url );
message.channel.send( embed );
} );
break;
not working
fetch( 'https://meme-api.herokuapp.com/gimme' )
^
TypeError: fetch is not a function
i think i do
I thought node had fetch in its base lib
case 'meme':
fetch( 'https://www.reddit.com/r/AmongUsMemes/' )
.then( async response => {
const meme = await response.json();
const embedh = new Discord.MessageEmbed()
.setColor( '#EFFF00' )
.setTitle( meme.title )
.setURL( meme.url )
.setImage( meme.url );
message.channel.send( embedh );
} );
break;
Why not, its not hard
error:
(node:9308) UnhandledPromiseRejectionWarning: FetchError: invalid json response body at https://www.reddit.com/r/AmongUsMemes/ reason: Unexpected token < in JSON at position 0
i already defined fetch
where can i get a url that rerurn json
Google the reddit api, see what kind of information they give you
still dont get it
You need to do research on how to use Reddit's public API. We can't hold your hand for you.
@tardy hornet add .then(res => res.json())
@earnest phoenix can i just do
fetch( 'https://www.reddit.com/r/AmongUsMemes/.json' )
no you can't
@tardy hornet add .then(res => res.json())
that didnt work as well
console log the response
i think i did it
MessageEmbed {
type: undefined,
title: 'undefined',
description: undefined,
url: undefined,
color: 15728384,
timestamp: null,
fields: [],
thumbnail: null,
image: { url: undefined },
video: null,
author: null,
provider: null,
footer: null,
files: []
}
@earnest phoenix here you go
smh
try
https://www.reddit.com/r/AmongUsMemes/hot.json
@earnest phoenix console log the response of that
im trying to set the thumbnail of an embed to a user image of a specific id to get the id of the user sending the message i have message.author.avatarURL(); and that works good for getting the user icon of the author but i want to get the avatarurl of a specific id 735777888971915314 what can i do to do this?
hmm sorry that i dont understand wdym by that!
or client.users.fetch('id').then(x => x.avatarURL()) 😳
k
console log the response of that
hmm sorry that i dont understand wdym by that!
case 'meme':
fetch( 'https://www.reddit.com/r/AmongUsMemes/hot.json' )
.then( async response => {
const meme = await response.json();
const embedh = new Discord.MessageEmbed()
.setColor( '#EFFF00' )
.setTitle( meme.title )
.setURL( meme.url )
.setImage( meme.url );
message.channel.send();
console.log()
} );
break;
You aren’t changing it to a json
or
client.users.fetch('id').then(x => x.avatarURL())
@earnest phoenix
once i run the command it printsJS (node:6572) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body embed.thumbnail.url: Could not interpret "{}" as string. at RequestHandler.execute (/rbd/pnpm-volume/3267f550-6812-430b-91fc-4ba423438cb0/node_modules/.registry.npmjs.org/discord.js/12.3.1/node_modules/discord.js/src/rest/RequestHandler.js:170:25) at processTicksAndRejections (internal/process/task_queues.js:88:5) (node:6572) 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: 1) (node:6572) [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.
You aren’t changing it to a json
@misty sigil then how?
.then(res => res.json()).then(response => code here)
https://reddit.com/r/some_reddit_page/*.json
but it can't be .json only
- you can replace with hot, random and popular iirc
.then(res => res.json()).then(response => code here)
@misty sigil
fetch( 'https://www.reddit.com/r/AmongUsMemes/hot.json' )
.then(res => res.json()).then(async response => {
const meme = await response.json();
const embedh = new Discord.MessageEmbed()
.setColor( '#EFFF00' )
.setTitle( meme.title )
.setURL( meme.url )
.setImage( meme.url );
message.channel.send(embedh);
} );
break;
like that?
Change it to response
then what is it
you're parsing it to json twice that way lol
then what is it
@tardy hornet log it and look at it
i still dont get what to log!
response[0].data.children[0].data
@tardy hornet the response
response[0].data.children[0].data
@misty sigil this is where you can take the title and url from
Yes
@misty sigil
{
kind: 'Listing',
data: {
modhash: '',
dist: 27,
children: [
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object]
],
after: 't3_jcaygs',
before: null
ok so console.log(response.children[0])
Weird
Can Someone help me make a bot with javacord?
else if (command === 'addrole') {
if (!message.guild.member(client.user).hasPermission("MANAGE_ROLES")) return message.reply("❌**Error:** I don't have the **Manage Roles** permission!");
if (message.mentions.users.size === 0) return message.reply("❌Please mention a user to give the role to.\nExample: `addrole @user Members`");
let member = message.guild.member(message.mentions.users.first());
if (!member) return message.reply("❌**Error:** That user does not seem valid.");
let rname = message.content.split(" ").splice(2).join(" ");
let role = message.guild.roles.cache.find(val => val.name === rname);
if (!role) return message.reply(`❌**Error:** ${rname} isn't a role on this server!`);
let botRolePosition = message.guild.member(client.user).roles.highest.position;
let rolePosition = role.position;
let userRolePossition = message.member.roles.highest.position;
if (userRolePossition <= rolePosition) return message.channel.send("❌**Error:** Failed to add the role to the user because your role is lower than the specified role.")
if (botRolePosition <= rolePosition) return message.channel.send("❌**Error:** Failed to add the role to the user because my highest role is lower than the specified role.");
member.roles.add(role).catch(e => {
return message.channel.send(`❌**Error:**\n${e}`);
});
message.channel.send(`:balancecheck: **${message.author.username}**, I've added the **${rname}** role to **${message.mentions.users.first().username}**.`);
}```
it says the role doesnt exects even though i pinged it
you say you pinged it
that's the reason why the role isn't being found
role pings are formatted in this format: <@&id>
a role with that name won't exist
and you're trying to do exactly that (find a role with the name of the ping)
what is the event for dpy for bot leaving guild?
for bot join its on_guild_join
but for leave?
Can someone help me setup ipv6 for bypassing lavalink yt block
Client.snipes doesn’t exist
client.snipes
i think u should make it a new Map() lol
why not just store last 10 msgs in whole server?
less ram usage
(if server has more than 10 channels)
how should I program the command to enable slow mode?
Im trying to make a music bot but it wont come online what should I do
are you running it anywhere?
what does that mean
cry are you here with the image
I am kinda new with programming
thanks cry
oof
case 'meme':
fetch( 'https://www.reddit.com/r/AmongUsMemes/hot.json' )
.then(res => res.json()).then(response => {
console.log(response.children[0])
const embedh = new Discord.MessageEmbed()
.setColor( '#EFFF00' )
.setTitle( response.title )
.setURL( response.url )
.setImage( response.url );
message.channel.send(embedh);
} );
break;
not working
ypeError: Cannot read property '0' of undefined
sorry i was trying to cope the error
response.children is undefined
ik
response.children is undefined
@solemn latch
i need to addesponse[0].data.children[0].data
?
you should really look at the data you are getting from that fetch
and determine what you need yourself
Hi
hello
In this Video, I discuss Discord WebRTC and Voice chat backend architecture, it is a very interesting article
0:00 Intro
3:30 WebRTC As a Choice?
8:0...
webrtc go brrr
also discord went from mongo to cassandra
mongo over party
@solemn latch i have this command,
case 'meme':
fetch( 'https://meme-api.herokuapp.com/gimme' )
.then( async response => {
const meme = await response.json();
const embed = new Discord.MessageEmbed()
.setColor( '#EFFF00' )
.setTitle( meme.title )
.setURL( meme.url )
.setImage( meme.url );
message.channel.send( embed );
} );
break;
which work just fine, but i want it to send among us memes
Does anyone know of good bidding? it's free?!
someone please
me?
yes
copy-paste?
should ask them
I'd suggest learning how that code works first
but i want to change the fetch( 'https://meme-api.herokuapp.com/gimme' )
it's absolutely easy to make it send among us memes
but I won't tell u how until you can explain that code
to fetch(https://www.reddit.com/r/AmongUsMemes/)
sorry if it might look harsh, but knowing your own bot is essential
if you want to change the url thats fetched, change it, look at the data structure you are being sent, and determine what you want from the structure.
i tried
the .json you had earlier was fine btw
but i only can with json
you can't simply fetch a whole subreddit
https://www.reddit.com/r/AmongUsMemes/hot.json
it send that
literally can just put it in firefox and look at the structure
https://www.reddit.com/r/AmongUsMemes/hot.json
^ that won't get u only images btw
you can filter manually iirc
you can
https://www.reddit.com/r/AmongUsMemes/hot.json
@solemn latch its sending the embed with "undefined"
don't simply copy-paste his answer
what can i put instead of .title?


🙏
I know this sounds lazy of me, for discord.py how would I make a vote command? That tracks if a user votes
Yes
We have an api https://top.gg/api/docs
You can setup a webhook to get votes on your bot
can you not simply just send an embed wiht the link to your botpage/vote ?
actually
i misread the question
Thanks 
does flask support pymongo? not flaskpymongo?
Whats the shape of response @tardy hornet ?
@opal plank
case 'meme':
fetch( 'https://meme-api.herokuapp.com/gimme' )
.then( async response => {
const meme = await response.json();
const embed = new MessageEmbed()
.setColor( '#EFFF00' )
.setTitle( meme.title )
.setURL( meme.url )
.setImage( meme.url );
message.channel.send( embed );
} );
break;
thats the command,
i want it to send memes from another web, https://www.reddit.com/r/AmongUsMemes/
and couple of people tried to help me. like to change the https://www.reddit.com/r/AmongUsMemes/ to https://www.reddit.com/r/AmongUsMemes/hot.json
and it just sent a embed that says "undefine"
wdym by shape?
k 1 sec
{
postLink: 'https://redd.it/jcbm6y',
subreddit: 'memes',
title: 'Oh ma hawt',
url: 'https://i.redd.it/jztvmzqw3ht51.jpg',
nsfw: false,
spoiler: false,
author: 'N_spohr',
ups: 7727,
preview: [
'https://preview.redd.it/jztvmzqw3ht51.jpg?width=108&crop=smart&auto=webp&s=e66125b72aa6a95b41b7f9af60fd6dc426498992',
'https://preview.redd.it/jztvmzqw3ht51.jpg?width=216&crop=smart&auto=webp&s=83752ad1cbae18bb9a094a40d7ef5d2851f036de',
'https://preview.redd.it/jztvmzqw3ht51.jpg?width=320&crop=smart&auto=webp&s=b4ac1f52f1db36cb491be41480517e1f200ddd10',
'https://preview.redd.it/jztvmzqw3ht51.jpg?width=640&crop=smart&auto=webp&s=deb5a29788ccfcc104ec29eb77d0ba2686d50400'
]
}
@opal plank
brb
he said he wants the other one 🤷♂️
yes, i want the https://www.reddit.com/r/AmongUsMemes/
message.channel.send({
embed: {
title: meme.title,
color: 16711680,
image: {
url: meme.url
}
},
})```
i doubt embed is the issue tbh
yeah but they dont even use description
thats just converting what they got in the embed builder with raw payload
when he changes the code(the other code he gave) he does
well he didnt give me the updated version then
@tardy hornet you might wanna give me what you got CURRENTLY, seems like you showed some old code
case 'meme':
fetch( 'https://www.reddit.com/r/AmongUsMemes/' )
.then( async response => {
const meme = await response.json();
const embed = new Discord.MessageEmbed()
.setColor( '#EFFF00' )
.setTitle( meme.title )
.setURL( meme.url )
.setImage( meme.url );
message.channel.send( embed );
console.log(meme)
} );
break;
thats what i have now
and the error is:
FetchError: invalid json response body at https://www.reddit.com/r/AmongUsMemes/ reason: Unexpected token < in JSON at position 0
you should use the hot.json url
that endpoint doesnt return json it seems
since thats the one with the format you wante.
^^
i added hot.json
meme =
{
kind: 'Listing',
data: {
modhash: '',
dist: 27,
children: [
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object]
],
after: 't3_jcaygs',
before: null
}
}```
okay, now look at that structure, to find what you want
then now access meme.data.children[index]
how?
can i use normal pymongo with flask?
i just gave u the code for it, basically
message.channel.send({
embed: {
title: meme.title,
color: 16711680,
image: {
url: meme.url
}
},
})
@opal plank that one?
then now access meme.data.children[index]
oh



