#development
1 messages · Page 1187 of 1
selfhost, vps, or some free host that isnt heroku or glitch
link to what?
const invited = invites.array().filter(o => o.inviter.id === message.guild.members[i].id);
message.channel.send(invited)
why does this say it is sending a empty message
message.guild.fetchInvites()
.then
(invites => {
if (args[0] === "leaderboard") {
const invited = invites.array().filter(o => o.inviter.id === message.guild.members[i].id);
but what do I do
?
"invites"
()
oh
" is quotation mark
that wont fix the issue but its good practice not to do that
okay
check what your o is returning
o isnt defined
remember when i told you to wrap invites in parenthesis?
guess what?
o also isnt wrapped in parenthesis
¯_(ツ)_/¯
ok
now try logging o
if that still is undefined that means you have no invites fetched
do a check if its nullish
undefined
i need help
i'm doing the snipe command.
@opal plank actually I did it in a different server and it didnt log anything
How do I get the date of the deleted message?
746115866340360196
@earnest phoenix that is prob breaking tos
^
yeah
STORING it on the other hand will get you in poor situations
ah ok
first you'd need encryption
Not Erwin do u use discord.js
idc which version
i tried something like this: moment(new Date().toLocaleString("tr-TR")).fromNow())
erm
Sorry to ask but do u know the eval to
lemme check
yeah of course
using messageID
do u know how?
of course
i told u how
you'd need to have it cached or at least know the channel id
is any of those true?
746115866340360196
im hoping you dont expect me to grab it for you @indigo flax
@opal plank DMChannel.messages.fetch()

you'd need more options ontop of that
without query it'd default to 100 iirc
also idk which type of channel you trying to pull from
;eval client.messages.cache.get('ID').delete()
username: 'NUAGE',
discriminator: '7052',
avatar: '202704889c8194aacf38e0ad22a3d12d',
flags: UserFlags { bitfield: 256 },
what's on flags?
what do i have to understand?
flags are like badges
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
you need to resolve your promise first
that snippet wont work btw
¯_(ツ)_/¯
crossing my fingers that this works

how would I get an accurate user count for my bot as apparently bot.users.cache.size isnt good enough
how accurate we talking here?
without marging of error or a good aprox?
a good aprox would be looping the membercount of each guild
an accurate count would be fetching member list from each guild and mapping each user, then getting its size
I mean I dont cair about a user being counted twice if they are in more than one server that the bot is in i just whanna stop this
For a bot to show as online on the website does it need to be apart of this server?
@earnest flare yes
Ok thanks
what do you mean loop the guilds?
I mean I dont cair about a user being counted twice if they are in more than one server that the bot is in i just whanna stop this
@wooden ember that's a cool cli
literally loop your guilds cache @wooden ember
ah yeah im just using bot.users.cache.size as the var
as in add all the guild.memberCount up from all the servers
yeah
for that you need to iterate thru all the guilds you have cached
hence why i said, loop them
or reduce them
either is fine
ah nice but then id have to do that in all the places I needed that value tho
cuz atm its use in like 3 places
you dont
oh yeah I expect I can just export it
indeed
ah nice
or attach it somewhere handy
just a random question, but how do i make a command prompt type script in python?
example of what i'm talking about:
if i did test after doing py -3 file.py, it would respond with "hi", and i could do that as many times as i wanted
anyone can help?
(node:3240) UnhandledPromiseRejectionWarning: #<Collection>
(node:3240) 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(). To termina
te the node process on unhandled promise rejection, use the CLI flag `--unhandle
d-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejectio
ns_mode). (rejection id: 1)
(node:3240) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code.
(Not giving any line number.)
is that not cut out?
Full.
In main file.
do a massive try {} catch(e) {console.log(e)} on where you think that might be
Okay.
preferably you'd step debug it
I don't know debugging.
Source?
how do you add a loop command for a public music bot
specifically my music bot
with python
wut
256 is 1 << 8
hu?
user.flags.toArray()
ok
I still wonder why discord hasn't made nitro or boost badge a flag
now i want to show the flag but just house balance is shown off

i think you can get nitro on gateway @split hazel
isnt subcription/subsriber a thing?
or was, at least
you can only get it if you self bot (use user token to access endpoints not available to bots) or check for things like discriminator or animated pfp
premium something i think
ngl would be really handy if you could use some normal users endpoints with bots
like connected accounts
would make auth much easier since you just have to check which account the user is connected to
without forcing the user to auth thru your app/bot
shit like searching for messages would be nice too
assuming you're using discord.js, guildMemberUpdate
though that triggers on member updates, like avatars, usernames, nicknames, etc
you can compare both role stores and see which ones have been added
@split hazel using python
i'd recommend sending a payload directly
though you could use d.js's embed builder
but there isnt a reason to
Either create a MessageEmbed class (https://discord.js.org/#/docs/main/stable/class/MessageEmbed) or create an object and pass it to <Channel>.send() (https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=send refer to example)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
let prefix = await db.get(`prefix_${message.guild.id}`)
if (!prefix) prefix = config.prefix
if (prefix != db.get(`prefix_${message.guild.id}`)) return;
let messageArray = message.content.split(" ")
let cmd = messageArray[0]
let args = messageArray.slice(1);
can someone help me when I test if the prefix is the prefix it bugs and allows all prefixes
@split hazel
let commandfile = bot.commands.get(cmd.slice(prefix.length));
if (commandfile != db.get(`prefix_${message.guild.id}`)) return;
how can i make it like if command not found say command not found?
Hi
So I just checked my SSH and there seems to be something that caught my eye
(node:15534) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Access
at RequestHandler.execute (/root/bot3/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:15534) 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:15534) [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.
I have no idea what this means lol
It means you tried to do something you don't have access to do, such as trying to get info on a guild you aren't part of
Sounds like they're removing error handling for the unhandled promise error in a future version. You may want to upgrade for that one
Lol, which apparently will actually cause the process determinate
What an awful thing to deprecate
That deprecation warning happens when a promise throws and it isn't handled (e.g. .catch()). The description is good enough to explain it.
Thanks
Auger they're actually hosting a poll on the Node.js website to ask for feedback about it
oh I don't think it's there anymore
it was there yesterday I think
But it's been a warning for a while
At least from Node 8
What method in discord.js lets me send a message to a channel by id (or {Channel} class instance)?
The channel class doesn't have a method for sending
.send on what
<client>.channels.cache.get().send
i geniunely cant remember
Check docs
lmao
It appears to be of type {Channel} extends {Base}, is {Base} where send exists?
No
Well client.channels.cache.get() doesn't have a send method according to the docs
const filter = (collected) => {
true
};
let optionMessage = message.channel.send('Chose')
console.log('Creating await.')
message.channel.awaitMessages(filter)
.then(collected => {
console.log(`collected`)
})
.catch(e => {
console.log('caught!')
console.log(e)
});
is there a reason why it's not even collecting anything/logging pass the first one
i've been tinkering with this
for a while now can't figure it out
filter always returns true (I don't know the context of your code)
Thats the point lmao
you can create an array from one and then reduce
well if you wanted the keys, values, or entries you can create an array from the map
yeah im aware
then use Array.prototype.reduce
i just dont wanna use for or set another variable
use for or set
hmm?
use for or declare
i want to make my bot change the color of the members name but how do i do it?
What language are we talking about?
js
Node.js?
well, ts technically
hi
i need help
who can help me
i have 3 different things
to code on
the basic for mac- terminal
Visual Studio Code
Python
on terminal, i use node and nvp or what ever its called

By not wanting to use for, you mean you don't want to iterate over the array you make from the map?
i mean its a map
Maps aren't arrays, if you want to iterate most efficiently use the map iterator
i could for it and solve the issue
can anyone help with how make a bot with the commands to change the name color of the member by chosing a color they like
and i could deconstruct it aswell
I don't understand why those are relevant
You wanted to use reduce
Do you understand why reduce exists?
hi
i need help
who can help me
i have 3 different things
to code on
the basic for mac- terminal
Visual Studio Code
Python
on terminal, i use node and nvp or what ever its called
pleaseeee
@sand skiff there's no question in your message
array.reduce()
i dont know how to use any of these
@opal plank because it describes what reduce does and how it should be implemented (and Node.js is an ECMA compatible language)
i literally posted above that i knew what it was
So don't
please
myself
reduce, forEach, for (... in) ... what is "myself" and what is not?
cuz efficiency
to develop your bot
and im bored
@sand skiff to code in? I use vi in a terminal
or @opal plank
@sand skiff to code in? I use vi in a terminal
@grand finch vi?
on mac?
i use Ts not python
@sand skiff it's platform independent but you can use any text editor, vscode, sublime text, vi, emacs
@sand skiff what language do you want to use?
I can't figure out where in the docs that a {Channel} is an instance (potentially?) of {TextChannel} (which has a send method
@sand skiff I mean node.js, python, c++ etc?
Your bot needs to be executed by some language runtime/compiled etc
the first is called terminal
Yes I am familiar
No I don't know python, refuse to learn slow languages
Terminal is a software that provides a standard input and output for you to interact with your command-line programs on your system - it is not a language per se
I would reccomend you begin in VSCode
You need to use VIM to be a real coder 
Haha
@sand skiff can I reccomend you google how to start a node.js project in VSCode? You mentioned you have npm, did you install it with nvm?
what do you get on your terminal if you run node --version ?
And are you familiar with git
You probably want to manage your code each time you save/update it
im not familiar with git
const a = new Map();
//case each
let int = 0;
a.forEach((c) => {int + c})
return int
// for
let int = 0;
for(let c of a) { int + c};
return int
//reduce
return Array.from(a.values()).reduce((c,d) => c + d);
// descons
return [...b].reduce((c,d) => {c+d})
//got tired of writing the rest
@grand finch
this is what i mean
trying to declare as least variables and use the smallest amount of stuff to accomplish the same goal
@sand skiff well luckily vscode can do the git stuff for you
nice, it's the latest
how do i run a code on uh
no?
vsc
v12.18.3 (Latest LTS: Erbium)
6.14.6```
@sand skiff when you begin a discord bot project your project will want to use discord.js which is a package available through npm
So you're going to want to add discord.js to your dependencies in VSCode for a new node.js project'
this will allow you to run npm install on your project and have discord.js downloaded automatically
@sand skiff it's going to be a bit of a learning curve probably - be prepared 🙂
I figured it lmaoo
it’s required that you add the max parameter
even though they say it’s optional
😔
@sand skiff do you know how to use the terminal to move through your file system, make folders etc?
Also check you have git installed git --version
it has a lot of commands you can run, pressing tab initiates auto-complete on a command so you can type stuff like mkd<tab> and it will auto complete to mkdir - if you press tab twice it wwill show you all the autocomplete options
ok its downloading
are you installing it with brew?
oh interesting
(╯°□°)╯︵ ┻━┻
┬─┬ ノ( ゜-゜ノ)
/afk
nope
but anyway
im back
(╯°□°)╯︵ ┻━┻
so
how do i get started
git version 2.5.4 (Apple Git-61)```
k
wait a sec
do i enter it all at once?
cd ~/git
git init
touch ./index.js
npm install discord.js --save```
mkdir ~/git
mkdir ~/git/my-project-name
cd ~/git/my-project-name
git init
touch ./index.js
npm install discord.js --save
const nodes = [{
host: "localhost",
port: 2333,
password: "youshallnotpass",
}]
Node error: connect ECONNREFUSED 127.0.0.1:2333
do i put it in all at once or one by one line
this will make a folder git in your home directory, and in git it will make my-project-name folder, initialise an empty repository and install discord.js for you
all at once, because it has new lines each will execute one at a time
the last line won't execute until you press enter
ok i put it in all at once
Susantas-iMac:~ SiaYT$ mkdir ~/git/my-project-name
Susantas-iMac:~ SiaYT$ cd ~/git/my-project-name
Susantas-iMac:my-project-name SiaYT$ git init
Initialized empty Git repository in /Users/SiaYT/git/my-project-name/.git/
Susantas-iMac:my-project-name SiaYT$ touch ./index.js
Susantas-iMac:my-project-name SiaYT$ npm install discord.js --save
npm WARN saveError ENOENT: no such file or directory, open '/Users/SiaYT/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/SiaYT/package.json'
npm WARN SiaYT No description
npm WARN SiaYT No repository field.
npm WARN SiaYT No README data
npm WARN SiaYT No license field.
+ discord.js@12.3.1
added 14 packages from 17 contributors, removed 14 packages, updated 1 package and audited 15 packages in 3.029s
found 0 vulnerabilities
Susantas-iMac:my-project-name SiaYT$ ```
type ls -arctl ~/git/my-project-name
total 0
drwxr-xr-x 3 SiaYT staff 102 Aug 25 22:30 ..
-rw-r--r-- 1 SiaYT staff 0 Aug 25 22:30 index.js
drwxr-xr-x 10 SiaYT staff 340 Aug 25 22:30 .git
drwxr-xr-x 4 SiaYT staff 136 Aug 25 22:30 .```
I don't think your shell navigated to the directory, what about pwd
run that (pwd)
whats that
echoes the path to the directory you're in
Susantas-iMac:my-project-name SiaYT$ pwd
/Users/SiaYT/git/my-project-name
sorry i feel lazy to put these "`"
okay in that directory run npm init
and follow the instructions
if it asks for things you don't know about just press enter
😮
imagine the parents' face
I mean I don't really have time to read silly stuff like that
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See `npm help init` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
package name: (my-project-name)
version: (1.0.0)
yeah just press enter and enter a description if you want etc
main will be index.js, this is what you want
this command npm init is creating a file for you called package.json
which is metadata required to create a node.js module
next you'll run npm install discord.js --save and it will download and install discord.js into that folder, and save it as a dependency into package.json
yes
ok
Invalid version: "npm init"
version: (1.0.0) npm install discord.js --save
Invalid version: "npm install discord.js --save"
version: (1.0.0) ```
i tried two times
two diff
unfamiliar
with code
you should probably get a base on js before coding a bot otherwise you'll struggle
new window req?
no sia, just you didn't follow the instructions
oh
version: (1.0.0) is asking you to provide a version, by default it will be 1.0.0 whjich is fine
just press enter
next it will ask description, just press enter until it is finished
yes
wut is this
this is the file that gets run if you run the program using npm
which is what we made earlier when you ran touch ./index.js
so i just press enter for everything
ok
About to write to /Users/SiaYT/git/my-project-name/package.json:
{
"name": "my-project-name",
"version": "1.0.0",
"description": "nothing",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "",
"license": "ISC"
}
Is this OK? (yes)
looks good
ok
│ │
│ New patch version of npm available! 6.14.6 → 6.14.8 │
│ Changelog: https://github.com/npm/cli/releases/tag/v6.14.8 │
│ Run npm install -g npm to update! │
│ │
╰────────────────────────────────────────────────────────────────╯
Susantas-iMac:my-project-name SiaYT$
yes
yea so that text Susantas-iMac:my-project-name SiaYT$ is called your prompt or PS1 if we're being technical
ok
if you see it it means your terminal (or shell) is free to do anything new
if you don't see it come up when you type or press enter it means some software is using the terminal
ohhhhhhh
okk
Susantas-iMac:my-project-name SiaYT$ npm install discord.js --save
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN my-project-name@1.0.0 No repository field.
- discord.js@12.3.1
added 15 packages from 17 contributors and audited 15 packages in 3.412s
found 0 vulnerabilities
Susantas-iMac:my-project-name SiaYT$
done
ok wait
Setting up workspace?
sorry my grandpa dropped something on my keyboard
You are doing smthing wrong
Uou on linux or macos
Alright so why you neet git init
Node error: Unexpected server response: 200
question, with Discord.js' rich embeds:
It says it takes a buffer as a valid argument for
let rich=new Discord.RichEmbed()
rich.setImage(buffer)
BUT, I get the following error (attached image) when passing it my giant buffer string:
I'm not sure how to proceed with setting an image from buffer in Rich Embeds; please ping me if you have any insight
yea but I want to pass it a Buffer. The documentation states that it takes a Buffer Resolvable as a valid argument
Since you're using RichEmbed, I'm assuming you're using v11. The only argument it takes is a string, which I don't see it taking a buffer.
"You can upload images with your embedded message and use them as source for embed fields that support image urls by constructing a MessageAttachment from them to send as message option alongside the embed. The attachment parameter takes a BufferResolvable or Stream including the URL to an external image."
Oh perhaps I'm interpreting this wrong. When it says BufferResolvable, is that not the same thing as a Buffer string?
I have this error TypeError: Cannot read property 'members' of undefined when I do one of my commmands
what is your command?
const Discord = require("discord.js")
const canvacord = require("canvacord");
//const canva = new Canvacord();
module.exports = {
name: 'bed',
description: "",
async execute(client, args, message) {
let member = message.mentions.members.first() || message.member,
user = member.user
let image = await canvacord.bed(user.avatarURL({ dynamic: false, format: "png" }), message.author.avatarURL({ dynamic: false, format: "png" }));
message.channel.send(canvacord.Attachment(image, "bed.png"))
}
}
Idk why it didn't happen before but it happened since yesterday
try message.member.user
okay
Perhaps you're looking for .attachFiles?
Same error
I want it to populate in the actual .setImage field of the embed though. The documentation says " source for embed fields that support image urls", so I thought it was possible
@earnest phoenix you may want to inspect what the value of message is. It may not be a Message instance.
Hmm how?
someone help me! I can't put Carl bot on my server! always the error what do I do?
can you translate your page to English? I can't read that language sadly
Yeah sweet but you're trying to give it a buffer. The only way I see you doing it with the RichEmbed class is by using that method (.attachFiles).
can you translate your page to English? I can't read that language sadly
@clever rampart yes
I see
I'm braziliam
someone help me? I can't put Carl bot on my server! always the error what do I do?
@earnest phoenix simply log the variable (such as console.log(message))
@neat crystal use a browser
we don't offer support for specific bots
oauth2 isn't supported by android app
Error: Unexpected server response: 200
at ClientRequest.<anonymous> (C:\Users\Owner\Desktop\discordjs2\node_modules\ws\lib\websocket.js:576:7)
at ClientRequest.emit (events.js:321:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:610:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:116:17)
at Socket.socketOnData (_http_client.js:479:22)
at Socket.emit (events.js:321:20)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (_stream_readable.js:273:9)
at Socket.Readable.push (_stream_readable.js:214:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
Emitted 'error' event on WebSocket instance at:
at abortHandshake (C:\Users\Owner\Desktop\discordjs2\node_modules\ws\lib\websocket.js:694:15)
at ClientRequest.<anonymous> (C:\Users\Owner\Desktop\discordjs2\node_modules\ws\lib\websocket.js:576:7)
[... lines matching original stack trace ...]
at Socket.Readable.push (_stream_readable.js:214:10)
why am I getting this error
It works fine now. Thanks
can someone help me pls
@solemn leaf it's coming from the ws module but we don't know what's causing it. Can you track down where it's coming from in your project
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('Hello World!'); // This will serve your request to '/'.
});
app.listen(2333, function () {
console.log('Example app listening on port 2333!');
});
const nodes = [{
host: "localhost",
port: 2333,
password: "youshallnotpass",
}]
@sudden geyser
This "OAult2 scope is not yet supported in the application." but we have good news it works in browsers "but I click and go back to the beginning
@sudden geyser ?you good?
Thanks
I don't work with websockets so I won't be of much help but is there more to your code?
can anyone tell me if coding a bot with python, also have embed,
yea
oh thx
Error: Unexpected server response: 200
at ClientRequest.<anonymous> (C:\Users\Owner\Desktop\discordjs2\node_modules\ws\lib\websocket.js:576:7)
at ClientRequest.emit (events.js:321:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:610:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:116:17)
at Socket.socketOnData (_http_client.js:479:22)
at Socket.emit (events.js:321:20)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (_stream_readable.js:273:9)
at Socket.Readable.push (_stream_readable.js:214:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
Emitted 'error' event on WebSocket instance at:
at abortHandshake (C:\Users\Owner\Desktop\discordjs2\node_modules\ws\lib\websocket.js:694:15)
at ClientRequest.<anonymous> (C:\Users\Owner\Desktop\discordjs2\node_modules\ws\lib\websocket.js:576:7)
[... lines matching original stack trace ...]
at Socket.Readable.push (_stream_readable.js:214:10)
why am I getting this error
.setfield("") .setdiscriptions("") .setimage("") .setthumbnail("")
MY BOT GOT VERIFIIED
anyone here
?
NICE!
Can someone help me with this error
@commands.command()
async def beg(self, ctx):
@commands.command()
^
IndentationError: unindent does not match any outer indentation level```
this is the error i get
@delicate shore
Can someone help me?
I am js
oh
@commands.command()
async def beg(self, ctx):
error message:
@commands.command()
^
IndentationError: unindent does not match any outer indentation level```
yeah
@torn ravine can u help?
@commands.command()
async def beg(self, ctx):
error message:
@commands.command()
^
IndentationError: unindent does not match any outer indentation level```
this is the problem
I’m javascript
Oh
have you tried the discord.py server?
thanks
you can use partials
discord.js caching every data. But they will delete if you restart the bot
how do i check if a specific user is a twitch follower?
@grand finch You can fetch a message's reactions
how to get someone's pfp with their id
how do i make my bot delete a message in a specific channel if its something else than a certain text
if someone does s!avatar 53235235235235
client.users.get
ok
client.users.cache.get for v12
but how to check if user is giving mention or id
currently i use msg.mentions.users.first() || msg.author
so i wanna check for id
Well try if client.users.cache.get returns a user or not
oh
All you have to do is put it in the code you sent above, in the middle
console.log(strings.join(' '))
if (!strings.join(' ').endsWith('?')) return message.channel.send(EmbedFail);
Im doing this but the console logs the string and the string shouldnt be running the if
if you understand
hi?
hi will it rain?
but it still runs the if
@cinder patio dont ask pls im lazy
let strings = [
args[0],
args[1],
args[2],
args[3],
args[4],
args[5],
args[6],
args[7],
args[8],
args[9],
args[10],
args[11],
args[12],
args[13],
args[14],
args[15],
args[16],
args[17],
args[18],
args[19],
args[20],
args[21],
args[22],
args[23],
args[24],
]
I realised something
is it helping me
.setInterval
setTimeout
setInterval would do it every one second
sry then, mb 
can you send the code you have by far?
I cant now
I can't spoonfeed but i actually easy to do
I'm trying to edit a message after a second or so
setTimeout(f(){
});
and all that stuff
whats the f?
function
I mean, if you type: nodejs settimeout example on google
you'll have 100 examples
its something easy to do
2 days ago
trust me isnt that hard to do something, theres a lot of tutorials, docs, examples..
and people here is helpful
so I could do
setTimeout(function () {
message.channel.send('hi');
}, 1000);
yes
how would u do that with editing a message
or arrow functions
use .then or await
setTimeout(() => message.channel.send("ye"), 1000) arrow function
you can use message.edit to edit a message, you'd just need the message object
so I could do
setTimeout(function () {
.then(message => message.edit("new message"));
}, 1000);
?
you send the message
yes
message.channel.send("something").then(m =>...
and use .then to do something after sending it
not just .then
you can't edit other person's message
I know
You have to send the first message and then use .then to do something after sending it, in you case edit the message.
use channel.send().then(sent => setTimeout(() => sent.edit(), 1000));
https://github.com/GagePielsticker/Secure-Rest-API If anyone has any wisdom to add i made a quick REST api boilerplate with the intention of it being secure as possible. Please make a pr if you got and cool ideas or dm them.

Hello all. May I know how do I play a certain playlist from my Spotify
hello,
So I'm having a problem where sometimes my bot will lose its variable settings. I've been told this is because the variables need to be stored on some sort of secure Sequelize or something, anyone know why the variables would just sometimes reset and how to fix this?
define variables
theres 3 specific ones, 2 of them hold user defined IDs, and the third holds a timestamp
I dont know about the timestamp one yet, but last night i set the 2 id variables and this morning theyre both reset
look into mongodb or mysql/sqlite
@sick cloud k
would that work?
yes
for learning about it?
try it and see
k thanks
banned
lol
also, refering to my origional first question, what causes the variables to reset?
if (condition1 = args[0] === 'PAPER'){}
if (condition1 = args[0] === 'SCISSORS'){}```
these were wereing only if args[0] was either `ROCK`, `PAPER` or `SCISSORS` which was fine, but as i changed it to this,
```if (condition1 = args[0] === 'ROCK'.toLowerCase){}
if (condition1 = args[0] === 'PAPER'.toLowerCase){}
if (condition1 = args[0] === 'SCISSORS'.toLowerCase){}```
it only works with `rock`,`paper` and`scissors`, not even `ROCK`,`PAPER` and `SCISSORS`.
how can i make it work without having to be case-sensitive?
actually call the to lower case function??
wot?
who the fuck
thats what i did
hi discord.py is hard discord.js is easier k thx
selfbot?
args[0].toLowerCase() === 'rock'
@west raptor @sand skiff reaction spam
and who is staring all messages?
sorry
wow
selfbots are fun
im confused of how twitch API works
@pale vessel sorryyyyyy pls
reaction spam
@pale vessel april has dnd better ping timo
im confused of how twitch API works
@carmine summit you're confused on how oauth works
how to know if user has opt for voting reminder?
im confused on how everything works
timo is on mobile
pls help
it doesn't matter anyway, it's not ruining the conversation
@wooden jacinth
yup, all my messages deserve to be starred anyways
bruh
@fossil oxide

loll
let oliy punish them or something
What do you want?
punish WHO
@sand skiff you
smh
:O
how to know if user has opted for voting reminder?
Hello?
hiii
no reason at all lmao
nice to meet u
Why are you disturbing the people of development
he starred thousands of messages
Oliy scroll up
@waxen cloak don't think that's included in the api
oh wow that fella removed the reactions
okay don't answer me then
rejected
wait who me?
-m @sand skiff Spamming stars in development | 1 hour
🤐 Muted Sia (ALT)#9417 (@sand skiff)
too generous
learn how to use oauth
too generous
@pale vessel
client.user.setActivity("with Linky", {type: "STREAMING",url: "https://www.twitch.tv/eviesiconworldbot"});
shouldn't that set the status to streaming? (btw not advertisement, u can check the twitch account, its literally just for the link)
oh wait nvm, just forgot to update the bots heroku page, nvm then
args[0].toLowerCase() === 'rock'
@sick cloud same problem
@waxen cloak don't think that's included in the api
@pale vessel i am a newbie, can you guide me how to work it out, when user selects to remind so my bot can remind the user to vote agian
that's not possible afaik
<@!> same problem
@hazy sparrow that should work
if + else if perhaps
@carmine summit which programming languages do you know
javascript
https://npmjs.com/twitch
https://github.com/twitch-js/twitch-js
useful packages for interacting with twitch api
whats the difference
how to fix this
pls help twitch api
stop begging for help
@fickle dune to many characters
ok
@fickle dune did you read the error
The error literally told you the error
i doubt anyone here other than me uses twitch IRC dude @carmine summit

what for?
then read the docs
their docs are absolutely user unfriendly
if you dont have a habit of reading docs, you will never get thru twitc's docs
Read the error and then ask here again
unlike d.js and shit that has pretty guides n stuff, twitch docs are bare bones
sad sad sad
u still havent answered my question
cant help you with 'bleh' purposes
either tell me what you need help with so i can help or try figure out urself
¯_(ツ)_/¯
i wanna see who follows me on twitch so i can just do ?verify <twich name>
ik
you dont
eh?
err: endpoint is undefined
you know what an api is?
users/follows
I already sent you that smh
thats the endpoint
dont use a lib
use manual requests
you arent doing anything fancy with twitch, completely waste of time to add heavy libs for one request
those 2 endpoints are freely open
i was expecting https://api.twitch.tv/helix/users/follows?from_id=<user ID>
send a request to /user to get it and save on your bot
READ THIS FUCKING DOCS
just need to do it once
REAH THIS FUCKING DOCS
@summer torrent its a lie
all of it is a lie
to get yourself use login and /users endpoint
create a god damn oauth application
you do
oh
how do i create an oauth application
you dont need that
I DONT EVEN KNOW WHATS THE MEANING OF OAUTH
getting the user id requires oauth
you are just spamming "pls help me", "pls teach me". But not trying to do anything
nope, oauth token is missing
theres only 2 params needed
i used the api
If you have the target user’s login/username, you can request their user id with this endpoint: GET https://api.twitch.tv/helix/users?login= Include the Client ID for your application in the header, no other authorization is needed.
and i needed oauth
i dunno
im newb
aight i give up, i tried
ok ty tho
@pale vessel
you dont need auth for that endpoint
just token
oauth is used very rarely
@hazy sparrow that should work
@pale vessel its not
How do i get twitch user id?
i told you
I dont understand
Gn 
I want the user ID for a different user
Huh
its not called /users endpoint for a reason

you can fetch any user in there with their login name
Whats /users endpoint?
the api endpoint uses where you fetch, guess what, users
Whats the url for this endpoint?
Define no
you need to target the api
if you ping that you'll get no response
just like discord
discord.com/api/v5(version api here)/endpoint
there we go
thats your token
and you'll need client id to
as for april's change, twitch helix requires those 2 on every endpoint
I need my bot token and bot client token to use this thing?

how to set autorole
using role id is easy
but
how to make it as custom roles in each server
database + cache
like zira,mee6,dyno
ask the user to set a role, if no role is there, use default
hm
to add role, add it to cache and then send it to database to keep it persistent
then just check the server's cache
¯_(ツ)_/¯
pro
What is oauth redirect url and how do i get one
figured out mongodb atlas
Is it possible for someone to see my databases if I leak the URL?
I need it cuz its a required feild
yep
cuz
where will oauth send the token to
<your redirect>?code=token
Your code can read the code query to get the token
Finally someone that agrees with me







