#development
1 messages ยท Page 400 of 1
120ms min rainbow role 
You need to install the sqlite3 package
i did but it says manually
try to download it via their github page ๐คท
i think i cant do that on evennode ๐ค
ยฏ_(ใ)_/ยฏ
where do i host my bot then ;_;
cant host in heraku cuz bot is too big
AWS wants credit card information .-.
DigitalOcean
is it possible for my bot to edit a file on github? since im making a chat bot, the chat bot records pretty much records and save all messages it can read and for my pc it edits the sqlite3 file automatically, but how can i make it so that once i host my bot it stills edits file
I don't think you can, unless you do commits with a given interval (idk if you can get ratelimited on github either)
oh fk
Halo
Hi
anyone got a huge dataset?
Use a database
i need free node.js host, anyone know any ?
ffs. i cant upload my node_modules ! GREAT
use .gitignore
you don't upload node_modules
^
use git cli
Inb4 doesn't have git repo for bot
It doesn't matter what git client/service you use. Don't upload node_modules
GitLab has free private repos too
I am trying to run my bot, but it doesn't response
I tried to do it with the same files just different bot and it works
this is 100% problem with the bot client
I tried to regenerate token, change name, run it from each one of my servers and I got nothing
what should I do?
โฌ
What I'd do is go step by step and pin point the issue
the daily outage, I forgot :yay:
You could also take a binary search like approach
Or I will just wait until this outage will be over ๐คท
Start with something easy: Is your bot receiving the message? Yes: Is your bot sending the message? No: Issue must be somewhere between there
ok
no is my deal
between there;s no problem
I tired with other bot
works fine
its problem with my specific bot client
( @earnest phoenix )
(try restarting)
tried
and run it in debug to see if it's even receiving messages (as Brian said)
multiple times
yea, probs
Discord at its best ๐
is it possible that discord is semi-random determining the endpoint based on the client id, just speculating
What do you mean?
discord is mean
lets say that client ID % 5 is 3 and discord selects an endpoint (API) that is a multiplier of 3 for example endpoint-9.discordapp.com
similar to how guilds are sorted to each shard
Yo
who tested my bot?
I was testing something
I've seen the request but just after I have seen it I closed the bot
woops
how do I update Node.JS to the lastest version on Ubuntu 16.04?
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
and then
sudo apt-get install -y nodejs
Can anyone give me some help with this?
const Discord = require(`discord.js`),
bconf = require("../config.json"),
errors = require("../utils/errors.js");
module.exports.run = async(bot, message, args) => {
message.delete();
var Role1 = member.guild.roles.find('name', 'Offline');
var Role2 = member.guild.roles.find('name', 'Offline Premium');
var Role3 = member.guild.roles.find('name', 'Offline VIP');
var user = message.author;
if (args[0] == "help") {
return errors.cmdhelp(message, "`$redeem (code)`", "Redeems your role that corresponds to the site.", "Redeem");
}
}
module.exports.help = {
name: "redeem"
}```
it returns an error
one min
(node:8104) UnhandledPromiseRejectionWarning: ReferenceError: member is not defined
I have no clue why
you're trying to work with an object called "member" but you never declare an object called "member"
Yeah but when I declare member as message.author I get the same thing
Have you tried message.member?
well member works as message.author
but now im getting undefined as guild
correct me if im wrong, but shouldn't guild be recognized as defined?
message.guild.roles I think also is ok
I gtg now, bye
Lib docs
Debuging code
What is the best way for a bot to listen for different commands? I have one command !roll 1d6 (where 1d6 is dynamic) and another !roll help
I was originally listening for the message .includes(!roll ), but that is no longer viable
in general, the algorithm is to strip the message of a prefix, split by space characters, then look up the command in a hash table using the first element
Thanks @glossy sand , but how would I handle my dynamic command (since the first element can be either an integer or d)?
I wonder if I should listen for a regex?
you wouldn't handle the whole command as one string
that's the point of splitting by the spaces
you can separate the command name from the arguments
then, by keeping a hash table of command names to command executors, you can perform efficient lookup without having to write a huge switch tree
since the first element of the split should be just the command name
@stray cedar the best options are blocking bot users, adding something like If Message.StartsWith("!") or any prefix that you choose then use that to filter based on "!help" or in your case "!roll" then you split it into 2 string 1 the command and the other the input text.
@stray cedar you'd want something like this https://kotlin.is-a-big-me.me/3157f93bb2.png
when a command runs, it checks if the first argument is a subcommand
if yes, it drops it and lets the subcommand handle from there
if no, it handles the message
So
let g = client.guilds.get("429810117832081408")
console.log( g.memberCount + " are in Hyther")```
can someone tell me how memberCount is undefined?
Thanks for the help, @inner jewel @prime cliff
๐
Any regex enthusiasts out there? I need an expression to check for [integer]d[integer]
\dd\d
or if you want a specific amount, \d{1,6}d\d{1,6} would match up to 999999d999999
replace {1,6} with a + and you have no limit
Nice one. Thanks ๐
serverowner.addRole(role)
console.log(`${message.author} claimed ownership of ${servername2}`)```
It keeps returning:
```(node:3208) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 1): TypeError: Supplied parameter was neither a Role nor a Snowflake.
I'm pretty sure im defining the role correctly ๐ฎ
What is serverowner defined as
Also, it should be find not get
serverowner might be fine, but change get to find
@slim heart
.find returns with unkown role now
also ```connection.query("SELECT * FROM censorbot WHERE idcensorbot = " + arg1, function (err, rows) {
if(err) throw err;
let ids2 = rows[0].idcensorbot
let servername2 = rows[0].servername
let censor2 = rows[0].censor
let serverids2 = rows[0].serverid
let server2 = bot.guilds.get(serverids2)
let serverowner = server2.owner```
Make sure it's spelled exactly as the role
watch out, you could inject sql there
Well I gtg now
wait nope never mind you couldn't 
Bye
can it not have a space ๐ฎ
role name? yes it can
TypeError: Supplied parameter was neither a Role or a Snowflake.
It probably wants a Role object or a snowflake (role id)
catch that error and make a role
which lib?
js
discord.js?
yes
maybe check some docs and google that error (not really a js dev)
What if someone did ".find 0; DROP censorbot"?
@slim heart also make sure that if your role has a space. arg1 includes it
If youre splitting arguments by a space, and some does.. .find my role
Arg1 = my
i already have all that like set up, it's just the role that isn't working
because showing one line of code will give us enough info to help you
if(!message.guild) return;
if(!message.guild.id == "399688888739692552") return;
const args = message.content.slice().trim().split(/ +/g);
const command = args.shift().toLowerCase();
if(command === "+mmo") {
message.delete()
if(message.content == "+mmo") {
message.reply("Error: Too little amount of arguments | format: +mmo jsid | Get JSID by running +jsid in your discord server")
return;
}
let arg1 = args[0]
connection.query("SELECT * FROM censorbot WHERE idcensorbot = " + arg1, function (err, rows) {
if(err) throw err;
let ids2 = rows[0].idcensorbot
let servername2 = rows[0].servername
let censor2 = rows[0].censor
let serverids2 = rows[0].serverid
let server2 = bot.guilds.get(serverids2)
let serverowner = server2.owner
if(message.author.id == server2.owner.id) {
message.reply(`You have claimed ownership of ${servername2}`)
let role = message.guild.roles.find("name", "Server Owner");
let member = message.member
member.addRole(role)
console.log(`${message.author} claimed ownership of ${servername2}`)
} else {
message.reply(`Error! You are not the owner of the server you specified, make sure you are using the correct jsid by running +jsid in the server you are claiming ownership of, if that still doesnt work feel free to contact MCninja for manual confirmation`)
}
})
}
})```
there
hf ๐
nvm i fixed it
okay
I needed to grab message.member not message.author ๐ฎ
hey does someone in here use vs code and could help me for a sec?
same
@vestal timber explain
soo
you know there is the CTRL+P to quick search
for a file right
in here when im coding
on the right
hitting CTRL+P doesnt do shit
i first have to click a random file
in the browser
for it to open that window
thats majorly annoying as i have to jump between files alot and i want to be able to use this quick search while in the file on the right
instead of having to take the mouse
click a random file in the browser
to then search another one
so you want to find a certain term in all files or what
so you're looking for a file with that name in your whole project directory
hmmm
you do know that you do CTRL-P and type the file name in that box right?
and it will bring up file that match that keyword
i found the problem
yes that window didnt show up
bcs i had some intellij shortcut extensions installed
and apparently that fucked with the ctrl P in file
but not in the browser
so it worked 50% of the time
you could always bind it to a diff key
๐
it was more the working in one place but not the other
that confused the shit out of me
If I'm passing a string to message.reply(), how do I break the string to a newline? <br> and \n have failed me
I use \n and it works
Have you tried using the key under the escape button instead of double quotes?
Sometimes that works for me
@stray cedar
make sure it's \n
back tick?
i've seen a lot of people use /n
I probably fall into the latter category
it needs to be a \
Am I being silly here? I'm trying to store a regExp in a variable const REGEX_DIE = new RegExp(/[d][0-9]+/);
nice regex name
can anyone understand why this isn't working? (discord.py)
https://gyazo.com/c71822e8736239c07a8ae342b8106742
discord.Embed is not a valid function?
Read your lib docs for the embed function
*class
the thing is
i tried it for other bots, and it's not working for this one
maybe it's the discord.py prolly
show me your module imports
@earnest phoenix your discord.py installation/import is incorrect
yeah it's your installation prolly
try reinstalling discord.py
^
hi
I need....
HELP
HOW DO U GET EMOJI ID
I TRIED say uh... \๐ช
but
it gives me THAT
๐
๐ช
438111850433871872
default emojis are just :cookie:
how did u do that
etc
right click on the emoji
๐ช
not the emoji id
i dont think it has an ID
it's just a couple of characters
1-4 in UTF-8
yes
just type :cookie:
default emojis have no id
hmm...
only custom do
no
yes
๐
that's an ID for a message
still an ID for a message
so that aint the emoji id
if you want the id of a custom one, just do \:yourCustomEmote:
๐ค - doesn't have it
- has id
if its a default one, just type in the default characters
just type :cookie:
wait...
like :cookie: would work
ok...
it'll work
yay
you can't get the id of a default emote
ids are only for custom
@low owl zoomeyes better
If you are not sure whether something is an emote or emoji you can just escape it
else it's unicode
if message.content == "!!react":
emoji = get(client.get_all_emojis(), name= "cookie")
await client.add_reaction(message, emoji)
this is my code
Im using pythin 3.6 btw
that only looks for custom
get() is not a function
\๐
yes
\๐ช
you can make a react command
no spoonfeed zone
That is the unicode cookie
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "C:\Users\edwar\Desktop\Bot-Lib\CV\DLT Path XXIII 1.15.3.py", line 104, in on_message
await client.add_reaction(message, emoji)
File "C:\Python\lib\site-packages\discord\client.py", line 951, in add_reaction
raise InvalidArgument('emoji argument must be a string or Emoji')
discord.errors.InvalidArgument: emoji argument must be a string or Emoji
You can literally copy paste it
ik
rewrite or async?
wat
ik this is no spoonfeed
but i looked it up online
and NOBODY KNOWS FOR SOME FRIGGIN REASON
๐ฆ
โน
thats better
...
Good that you looked it up by yourself first, thank you ๐
people want to help, we just need you to specify if you're using is async or rewrite
async
If you knew how many people don't and just ask straight away..
just do if message.content == "!!react": await client.add_reaction(message, "๐ช")
np
wait,,,
\๐
python just crashed...
what is the error
wait
like the window closed
oh
well
I was copying and pasting
drag the file in the command file
no
...
do not do that
ok
that is not how to run programs
๐
soz
...
just restart the program
i meant command prompt
ok good
iirc droping files in the cmd will paste the file path
wait..
not sure about that though since I don't use cmd
it will
hmm
lemme try it
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "C:\Users\edwar\Desktop\Bot-Lib\CV\DLT Path XXIII 1.15.3.py", line 103, in on_message
await client.add_reaction(message, "๐ช")
File "C:\Python\lib\site-packages\discord\client.py", line 956, in add_reaction
yield from self.http.add_reaction(message.id, message.channel.id, emoji)
File "C:\Python\lib\site-packages\discord\http.py", line 200, in request
raise HTTPException(r, data)
discord.errors.HTTPException: BAD REQUEST (status code: 400): Unknown Emoji
I got that
this is my code btw

if message.content == "!!react":
await client.add_reaction(message, "๐ช")
...
Wait what was that bit about cmd prompt
no
Not relevant
Wait are you using async or rewrite
it says "unknown emoji" in the error
async
async
Oh
That's why I do C#. Typesafety rocks. /s
Check docs.
i did
did you put an emoji?
c# is pretty hawt
yes
no
what
It might be add_reaction(emoji, message)
i said (๐ช)
no
Let me check tocs
it isn't
oh wait
like an actual emoji?
ok
Oh
ok
like that
no
is that ok
that is not what i said
do await client.add_reaction(message, "๐ช")
not await client.add_reaction(message, ":cookie:")
that crashes whenever I try
ok python just crashed again
...
wtf
this weird
:?????
i think you're just closing the window
KeyboardInterrupt
why are you using ctrl+v in a terminal
Right click and paste
don't paste anything into the terminal
...
paste it into the actual file
copy and paste doesn't work in cmd btw
paste it into the actual file
which one
the file of the program?
oh im not using the terminal
\๐
what are you even pasting
๐ช
oh wait
no
๐ช
that
no wait
\๐ช
that
yeet
the C++ cookie
idk whats its actually called
I read something that said that the weird smaller cookie is like... smaller...
C++
what are you talking about at this point


What?
what im pasting
Oh
Unicode
If I may give you an advice. Discord bots might not be the best way to start your dev journey.
...
They can become complex really fast and documentation can be difficult.
learn python first before making a buttโข
some
key word some
well enough to like make games...
and that cool stuff
bots beat games
its more fun




saying you know "some" python and being able to make a game out of py 
I don't even think Python is your problem. It might rather be researching. Using documentation and understanding it can be key to succeeding. Or knowing which questions to ask to get the answer you want.
Well, then you probably just need experience
like I looked it up hard
heh wait
I think I got an IDEA
:lightbulb:
no
wait
thats not an emoji
oh well ๐ฆ


\๐ช
ok u know what
screw reactions
ima try something else
๐ฆ
ok thx for help though ๐

props.help.name .. name is undefined
check in commands/help Directory.. and make sure name is listed
where? I'm still on the guide of command handlers
do you have a folder named commands along with your Main JS file?
yes
inside that folder is there something named help.. a file or a folder?
I'm coding help.js now
help.js needs a property named.. name
Ok
Code: https://hastebin.com/dujepomige.coffeescript
Error: https://hastebin.com/efopujikuq.css
Help!
where is ur prefix defined
^
Oh i did something
How did you get the hex for the color value
i tried it and it doesnt work
Mine will only accept the 7 digit ones
how would i do a command that would only work for one person
like if(message.member !== "id" return message .channel.send("Couldn't do that sorry!"))
oh
u can eitehr put it only for the command
or for a whole set of commads
i did it
using the id of the author
if you fixed your syntax errors that should work
ok thanks
np
Anyone know of a bot that can delete the last massage by a user whenever a new message from them is made (basically to automate it so that only peoples most recent message is shown, and any time they make a new post and forget to delete their last one, the bot would've already done it for them automatically)?
I doubt that exists
in a busy server
It would be better to build it yourself
^
Sometimes people forget to delete the last message themselves and it would be more streamlined to have a bot that could do it.
Does anyone know of any that could prune all except the most recent message by every user?
can you code?
No I would only do it if a bot already existed. Wasn't sure how niche the task was.
I'll keep looking, thanks ๐
It would be easier to code it your self
and you can customize it to your hearts content
Coding is a great skill to have
You won't need it to work at McDonalds but it is very useful
It wouldn't work for me to host it even if I made a bot. Not for my servers purposes.
And it's a small thing in the grand scheme of things, but would be nice to have it automated.
free hosting is a thing
what you mean automated?
It would be automated either way, just one requires you to learn a life skill, and one takes time searching for something for weeks.
That type of bot would be very easy
the lag would be real
well u could always add ratelimits so people cant spam ur commands
@ashen quail ez fix
name: "Richest Account" //missing a ","
value:`${guildRichest} with ${guildRichest$}```
people cant c errors like it is a problem
lol
is it fixed?
My guild command wont work after that I have done that:
https://hastebin.com/icohoruzif.js
error?
also u dont need the "," after the value
also why dont u use the richembed feature?
its just json
so wait which one should I remove
ur code i presume has too much )
@lament meteor Should I give you the whole code because if I remove anything it makes a new error
not rlly
cause i dont rlly like reading json it gets messy and hard to read at a certain stage
lol
(Reformatted so it is readable: https://hastebin.com/lerawadapi.js)
oh god json dbs
lol
switch to sqlite right tf now
What does endsWith () do
Exactly what it sounds like...
Ok.. and his loop is useless
If user.money = 0.. set to richest?
I feel like there is code missing a lot of the loop is pointless
var richest = [{"name":"a","money":1},{"name":"b","money":5},{"name":"c","money":3}].reduce((max, p) => {return p.money > max.money ? p : max})
{name: "b", money: 5}
its better than json lol
not really
w0t
sqlite made me have to reset my bot's database
then I switched to postgres
much better
var guildMoney = [{"name":"a","money":1},{"name":"b","money":5},{"name":"c","money":3}].map(p => p.money).reduce((a, b) => {return a + b})
9
postgres is hawt
whats u guys doing?
What was a way to iterate over an array of objects? For ... In and of are not working
???
Which lang
js
Yes
@faint cedar
for (var i = 0; i < number; i++) {
//do stuff
}```
also number can be yea....
that wont work for objects with non sequential keys
elements.forEach(el => {
//do stuff slower https://jsperf.com/foreach-vs-loop
});
the first solution should work for arrays though
use for..in or for..of
Hmm
I want to ask a question but I don't want to look stupid.
It's regarding php and discords oauth2 login.
Anyways here it is:
How would you fetch soemones avatars image or name after having them loging in your website using discords oauth2
I am using this and so can't seem to actually get information onto a HTML page after them logging in.
cant u like grab data from the oauth2
do you know how to grab their username?
$user->username ?
well itโs $user->avatar
its differnt
Oh what I was confused on was that the login page is separate and then they get redirected back to a dashboard after they authorised.
On the dashboard is HTML how would I grab info from their oauth2 login and transfer it to the dashboard.html
i am also figuring that out
Why not have your bot lookup their discord avatar
cdn.discordapp.com/avatars/userid/useravatarcodethinghere.png
I wanna make a web dashboard, do I need an ssl certificate?
you don't need one but you really really really want one
besides, it's really easy to get it done nowadays
Why do I want it? What does it really do?
encryption of any data sent over https
without one, you'd be using http and you'd be susceptible to leaked data, e.g. attackers being able to use the dashboard of people they shouldn't be able to
obviously not guaranteed to happen
It's easy enough to use SSL that you should use it
and easy to attain
letsencrypt or cloudflare 
But it's expensive
It is pretty good but moderate to setup
Buying a ssl certificate is even harder to setup
I've completed it and done it once so msg me if you need a little help or just ask here I guess
what language?
python
ty
and for listing their names you'll have to use the for loop
I think
no wait, it will already be a list, so .join() will work fine
So my bot was declined for being offline.
I'm a little confused on what to do here? The only way I am able to run my bot atm is to attach it to my server and run node index.js in my terminal.
How do I set it up properly for testing, other than settings the Public Bot option to true in My Apps
Lmao for a second I thought you were implying that ticking "public bot" would make it "run" online
Mh, that is perfectly fine then. Are you sure your bot wasn't offline from the timespan on when you applied?
So if I submit my bot for approval, I'll need to leave my terminal running until I receive a response?
What are you hosting it on?
Self hosting by the looks of it. What would you recommend?
Get a vps
Repo is on Github if that influences the decision
Mmm, that sounds wrong
Phunk how are you self hosting it? You said terminal as in linux right
Yea. If we find your token on a public repo the bot won't get approved.
Oh
Ah
Ok, so here is what you want to do. By the time of testing, so from the moment you apply you should have your bot running. Because testing requires a functional bot. We test for different things, such as "has it any actual features", "does it have a help command or otherwise obvious point of entry" etc.
So either you get yourself a server to run your bot on or you will unfortunately have to self host it. I'd highly recommend a server tho, otherwise it makes no sense to add it to DBL.
Sorry I got pulled away for a sec there
Yeah, I'm going to add it to a server
Any recommendations?
Is Heroku still a thing?
Do not host on Heroku.
Take a look at pins
@stray cedar I'd recommend servercheap.net
Thanks. I'll check out servercheap.net and the pinned messages
Thanks for the help @frail harness @prime cliff @low owl
np
One last thing. Is it ok to submit a bot and then submit additional features post-release?
Ah, so there's no review after it's been initially approved?
No, unless someone reports your bot for something. Then we'd take a look at whatever the person reported.
Cool, good to know. Thanks
@stray cedar yea i use servercheap aswell i recommended it here and have had no issues with it
Servercheap will
Ping i wonder
Standard ssd server at 20% off lifetime atm from servercheap
Does anyone have issues with discordjs where the users presence becomes stale, as in the bot thinks the user is online but is actually offline (idle etc)
i think d.js still caches a planet ๐คท i dont
how to deal with Error: socket hang up?
get better internet
man its vultr hosting
@keen anvil i saw you on github, dealing with same problem, did you realize it how to fix?
afaik no
how to detect an error when u do
$.ajax({
method: 'POST'
link: "link"
})```
its html
so i should switch on Eris
- that's js, not html
- did you try google?
i did try to google but it aint working
wich one is better discord.io, discord.js or eris?
eris
d.js and eris is debateable
afaik discord.io is abandoned
but i say eris in the long run
if you're working with voice, consider using a different language
why node doesn't support multithreading ๐ญ
because the language wasn't designed with multithreading in mind
javascript was never supposed to scale beyond simple scripts on web pages
you'll have a fun time trying to maintain thread safety though lol
yeah that's a downside
a what about js libraries vs python libraries?
tbh it's good that js is single threaded
multithreaded code is way more complex
harder to maintain
and harder to debug
same
source: experience
debugging a deadlock that takes 40 threads spamming to happen isn't fun :^)
Deadlocks are the best kind of failure
Especially when absolutely nothing is logged ... no errors, no info.
Can someone help me understand webhooks more
webhooks are like http requests but in reverse
instead of you sending a request to the server to tell it to do something, the server sends a request to you to tell you that something has happened
essentially it's a callback that's invoked through an http request
just google it
you just need to run a web server that listens for the http request from the webhook provider
can anyone help me out? im kinda new to this mysql thingy
i dont know what i should get
uhm anyone know how to fix this ?
@earnest phoenix a little late here, but do you have an index.js file in that directory?
how long does it usually take for a bot to get verified?
24h-1w
could be under 24h
What ssl certificate provider do you guys use?
Who's "you guys"?
Everyone here
CloudFlare
Free?
I mean do you use the free tier
Why would I pay for CloudFlare ๐
i use free tier
There is nothing off the free tier I need
not like im a big business and need it
You just need to set an a record to cloudflare and from cloudflare to the hosting?
You have to setup TLS on CloudFlare also
Setting DNS records doesn't magically give you HTTPS
its just a slider
@elder rapids shhhh
Lel
Is auto https redirect also in the free tier?
yes
Noice so I only need to listen at 443
there are multiple clodufalre ports that work
HSTS preferred
You can listen to 443 but then you need a certificate on your origin server
i listen on random ports
So what should I do
sometimes it works sometimes it doesnt
Lel
Wait so what do I want to listen to 80?
If you use flexible CloudFlare connects to port 80 on your server
If you choose strict then it goes to 443 if HTTPS
If everyone is always on HTTPS (redirect and HSTS) then it will connect to 443 on your server if you use anything above flexible
It's an interesting setup ;P
well it doesnt work on port 2000 for all i know
What doesn't
listening a http server on it
You can listen an HTTP server on any port you want
80 and 443 work fine
I do that right now
is there a batch set /p equivalent in bash?
you mean set an environment variable?
you can just prefix the command with VARNAME=CONTENT
e.g. A=B node [file.js]
process.cpu_percent() returns this
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 15849.9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
I called it like 100 times.
How would I get the percent of my cpu of the current process via python.
lol
http://cf.can-fuck.me/mNbcqzhRstWhBZUH.png ยฏ_(ใ)_/ยฏ
It returns 0.0 alot above, as show in quote.
There's that 1 not 0.0 or 15849.9
This is also with a linux server
I'm going to bed, ping me if y'all got something. All my research returns to nothing.
http://prntscr.com/j9rqam
anyone tell me how to get rid of this all embed and link message edits I tried if var old=var new stop the command
@tiny turtle ez fix
if (oldmsg === newmsg) return
ty ty ty
don't compare the object
that'll be different
make sure you compare the content itself
@inner jewel i will invite you natan
what i mean is looks at the msg.content
?
Pm me
dont talk non-dev stuff here
anyone knows how to get a server id using the server name? im using discord py
i cant seem to find it
You use ext.commands?
yes
I think you must iterate in client.guilds sadly
hold on
yeah i don't think thats possible. As dondish said, you may have to iterate through the guilds
server name to server id is not a one-to-one mapping since server names aren't unique
^ primary keys have to be unique
is dbl posting to webhooks slow or is it just me
Its not just you it has been acting funky
oki
How do you get members with a certain discriminator in async Discord.py? 
Yea webhooks not working at all for me
Shivaco dont u have to do client.get_all_members() and stuff first
Iโve just received a bunch of webhooks in one go, so might be working again
https://stackoverflow.com/questions/45381469/finding-a-user-by-discord-discrim-via-python @slender thistle dont use py so not sure if it works
lul
Discrims are string. Fixed my issue. ๐
ok kool
It's most likely the client.shard.id because you don't have shards yet (assuming here, you might have shards)
but most likely not
without token right ..
You need a token
i know
Comment out the client.shard.id
client.on('ready', () => {
console.log(`\nLogged in:
Bot: ${client.user.tag} / ${client.user.id} / v${version} (Codename ${description})
Shard: ${client.shard.id} (count ${client.shard.count})
`);
TypeError: Cannot read property 'id' of null
at CommandoClient.client.on (C:\Users\frisby\Desktop\jColour-master\index.js:52:23)
at CommandoClient.emit (events.js:185:15)
at WebSocketConnection.triggerReady (C:\Users\frisby\Desktop\jColour-master\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:125:17)
at WebSocketConnection.checkIfReady (C:\Users\frisby\Desktop\jColour-master\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:141:61)
at GuildCreateHandler.handle (C:\Users\frisby\Desktop\jColour-master\node_modules\discord.js\src\client\websocket\packets\handlers\GuildCreate.js:13:31)
at WebSocketPacketManager.handle (C:\Users\frisby\Desktop\jColour-master\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\frisby\Desktop\jColour-master\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\frisby\Desktop\jColour-master\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users\frisby\Desktop\jColour-master\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:180:13)
still same
oh fuck im dumb .-. i was using "bot" instead of "client" just changed client to bot
it worked
Hey guys. I'm new to creating Discord bots. Literally just made my first locally hosted bot that just does the whole ping pong reply. Just curious, if you create a bot, Discord offers free public hosting so I don't have to leave the bot running on my PC all the time, right?
Take a look at our pins for this channel ๐
@spring ember Thank you @low owl Oh nice, thanks I appreciate it.
Unclosed connection
client_connection: Connection<('discordbots.org', 443, True)>
Unclosed response
client_response: <ClientResponse(https://discordbots.org/api/bots/424606447867789312/stats) [200 OK]>
<CIMultiDictProxy('Date': 'Wed, 25 Apr 2018 16:09:06 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '2', 'Connection': 'keep-alive', 'Set-Cookie': '__cfduid=d493a322a3addf6fea8c00a650296559d1524672546; expires=Thu, 25-Apr-19 16:09:06 GMT; path=/; domain=.discordbots.org; HttpOnly; Secure', 'X-Powered-By': 'Express', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': 'Authorization', 'Etag': 'W/"2-vyGp6PvFo4RvsFtPoIWeCReyIC8"', 'X-Varnish': '597692118', 'Age': '0', 'Via': '1.1 varnish-v4', 'Accept-Ranges': 'bytes', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains; preload', 'X-Content-Type-Options': 'nosniff', 'Expect-Ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', 'Server': 'cloudflare', 'Cf-Ray': '411212764f7a21c8-EWR')>```
how to fix that error on startup?
using d.py
weird error, never seen it before
probally has something to do with the server count thingy on discordbots.org
or idk
It only happened after I moved the bot to my VPS


