#development
1 messages Β· Page 428 of 1
Anyone got any ideas why:
response = await client.wait_for('message', check=lambda m: m.author == message.author and m.channel == message.channel)
mentions = response.mentions
print(mentions)```
prints an empty string when roles are mentioned?
what library is that 
Am i the only one here use dbm
no there is a few more around here that use dbm
No you can't. Learning isn't free
Learning requires time and time isn't free. That's what my dad said.
it depends how much free time you personally have
if you don't have free time...well fucc
only coding will set you free
I am a free man thats for sure
i mean free without money π
you can easily learn basic javascript, python and other languages on codecadamy
Does someone have a login example with discord (in express or Koa)? or can someone teach me how to do it?
discord has documentation examples for this; granted, it's in python, but if you actually know basic express/request it's not like it would be hard to convert
https://discordapp.com/developers/docs/topics/oauth2#authorization-code-grant
like i said passport is good for that stuff
okay thanks
learning how to use node yay
glhf
Is anybody experienced with sharding in discord.py? I'm not sure if I'm doing it right
Do you use rewrite?
How long do refresh tokens last?
refresh tokens as in?
For oauth2
well idk... is it not stated on discord api docs
I'm not 100% sure
when the expires_in is reached
that's probably token expiration
you use the refresh token to get a new access token
I'd assume as much
@inner jewel do refresh tokens last a little bit longer after the access token expires?
but if that refresh token expires u need to get a new token
it's 86400 btw, 1 day @quasi marsh
the loli needs some help pls help me pls ```nginx
Main: augu.me
server {
listen 80;
listen [::]:80;
# Don't enable gzip while in Production
gzip off;
server_name www.augu.me augu.me;
location / {
proxy_pass http://localhost:3001/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-ForwardedFor $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
}
}
hmm?
yes
i don't think you need all the extra headers 
and yeah
do you have a express server running
502 means server down
yes
is that the right port
lol
let me test again
and nope
I did a minor change
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
is it 3001 or 3002
you wrote 3001
:oof:
oof
502
521 then 502 for some reason
lmao
# node Website.js
[Website]: rembot.xyz is online~
change the server_name
same
am using ```
server {
listen 80;
listen [::]:80;
# Don't enable gzip while in Production
gzip off;
server_name www.rembot.xyz rembot.xyz;
location / {
proxy_pass http://localhost:3002/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
}
}
I'm dumb
also why no gzip in prod
idk
lol
I like it off
ok
and this is when I see the nginx status ```sudo systemctl status nginx.service
β nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2018-06-09 09:11:04 CEST; 2min 58s ago
Process: 25357 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCC
Process: 25367 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 25362 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 25369 (nginx)
Tasks: 2
Memory: 1.8M
CPU: 17ms
CGroup: /system.slice/nginx.service
ββ25369 nginx: master process /usr/sbin/nginx -g daemon on; master_process on
ββ25370 nginx: worker process
Jun 09 09:11:04 no_u systemd[1]: Starting A high performance web server and a reverse proxy server...
Jun 09 09:11:04 no_u systemd[1]: nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument
Jun 09 09:11:04 no_u systemd[1]: Started A high performance web server and a reverse proxy server.```
that / after the port is bothering me a bit
it looks bad ok
you don't want it to rewrite internally to http://localhost:3002myfile.html
Hmm
it doesnt do that
see my config
this is what I use @vital lark
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:3001/;
}
let me try it
works fine for me
nope returns a 502
then your express is fukt
let me check logs
yes
Hmm [09/Jun/2018:08:46:50 +0200] "GET / HTTP/1.1" 200 2440 "-" "Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)"

you need express logs not nginx logs
oh
and access the url
nginx just shows that's it working
it doesn't show the backend working :p
try connecting directly to the express using port forward

are you connected using ssh
yes
and wuts your machine os
Ubuntu 16.04
okok
just disconnect from the ssh server
then for the ssh url, you put this
ssh [username]@[server_ip] -L 3002:localhost:3002```
then once you've connected
open up your browser and go to http://localhost:3002/
wait
@knotty steeple i download free dbm from chrome
@fluid basin for the OS machine, were you taking about like my PC machine?
oh, I use Windows.
ooh ok
The #1 cross-platform terminal with built-in ssh client which works as your own portable server management system in any situation.
not sure on terminus, but if you have putty you can use plink to do the port forwarding thing
try curling the express from your terminal
so like curl -i <url>?
HTTP/1.1 301 Moved Permanently
Date: Sat, 09 Jun 2018 07:34:42 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: max-age=3600
Expires: Sat, 09 Jun 2018 08:34:42 GMT
Location: https://rembot.xyz/
Server: cloudflare
CF-RAY:<no_u>```
wait wot
no
Mantaro does

plus this is the wrong channel
If you use embeds you can add them as a footer but this isn't really the right chat for that
Ouh wrong chat
yeah so
So what?
curl -i localhost:3002
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 1804
ETag: W/"70c-r54GfRuYEfQCr6S8rt16TXPwUHg"
Date: Sat, 09 Jun 2018 07:50:29 GMT
Connection: keep-alive
<!--
_ _
| | | |
_ __ ___ _ __ ___ | |__ ___ | |_ __ ___ _ ____
| '__/ _ \ '_ ` _ \| '_ \ / _ \| __| \ \/ / | | |_ /
| | | __/ | | | | | |_) | (_) | |_ _ > <| |_| |/ /
|_| \___|_| |_| |_|_.__/ \___/ \__(_)_/\_\\__, /___|
__/ |
|___/
Author: August (Chris)
Page: Homepage
-->
<!DOCTYPE html>
<html>
<head>
<title>RemBot • Home</title>
<link rel="icon" href="https://cdn.discordapp.com/avatars/447229568282132510/63ab015184c99b3546ae87202cffa226.png?size=1024" />
<link rel="stylesheet" href="css/index.css" /> <!-- ModestaCSS Helpers uwu -->
<link rel="stylesheet" href="https://modesta.alexflipnote.xyz/css/modesta.min.css" /> <!-- ModestaCSS -->
</head>
<body>
<section class="fullscreen">
<div class="center-object">
<section class="me">
<img draggable="false" src="https://cdn.discordapp.com/avatars/447229568282132510/63ab015184c99b3546ae87202cffa226.png?size=1024" class="image-title" />
<h1 class="title">RemBot</h1>
<span class="undertitle">Rem is a discord bot made in the Eris library.</span>
</section>
<div class="buttons">
<a href="/invite" class="btn hover amethyst-nodark" target="_blank">Invite me!</a>
<a href="/discord" class="btn hover discord" target="_blank">Discord Server</a>
</div>
</div>
</section>
</body>```
hmm weird
wait it's my HTML page
yeah it is supposed to be that
Maybe its CF
Login to your cloudflare and either clear cache or enable development mode
Let me do it on my browser
yes
ok
just purge everything to be safe
I did it
alright
weird its returning 521
Are you sure the IP of rembot.xyz points to your VPS
disable cf for now? or that ^
Yes
Date: Sat, 09 Jun 2018 07:56:41 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: max-age=3600
Expires: Sat, 09 Jun 2018 08:56:41 GMT
Location: https://rembot.xyz/
Server: cloudflare
It is on full (strict)
and ```nginx
server {
listen 80;
listen [::]:80;
# Don't enable gzip while in Production
gzip off;
server_name www.rembot.xyz rembot.xyz;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:3002/;
}
}
thats all?
No
there is more
server {
listen 80 default_server;
listen [::]:80 default_server;
# Don't enable gzip while in Production
gzip off;
server_name www.voided.pw voided.pw;
# OwO
location / {
proxy_pass http://localhost:3000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
}
}
server {
listen 80;
listen [::]:80;
# Don't enable gzip while in Production
gzip off;
server_name www.augu.me augu.me;
location / {
proxy_pass http://localhost:3001;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
}
}
server {
listen 80;
listen [::]:80;
# Don't enable gzip while in Production
gzip off;
server_name www.rembot.xyz rembot.xyz;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:3002/;
}
}
Yeah there might be something else thats constantly redirecting
I showed rembot.xyz because that's what I'm using to test
well something is redirecting it in an infinite loop
can you check if apache is running
sudo systemctl status apache
β apache2.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
Jun 09 08:32:04 vps149491 systemd[1]: Starting LSB: Apache2 web server...
Jun 09 08:32:04 vps149491 apache2[4943]: * Starting Apache httpd web server apache2
Jun 09 08:32:05 vps149491 apache2[4943]: *
Jun 09 08:32:05 vps149491 systemd[1]: Started LSB: Apache2 web server.
Jun 09 08:42:55 vps149491 systemd[1]: Stopping LSB: Apache2 web server...
Jun 09 08:42:55 vps149491 apache2[24123]: * Stopping Apache httpd web server apache2
Jun 09 08:42:56 vps149491 apache2[24123]: *
Jun 09 08:42:56 vps149491 systemd[1]: Stopped LSB: Apache2 web server.```
here is nginx @fluid basin ```
β nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2018-06-09 09:22:48 CEST; 38min ago
Process: 25455 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCC
Process: 25465 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 25460 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 25467 (nginx)
Tasks: 2
Memory: 1.8M
CPU: 16ms
CGroup: /system.slice/nginx.service
ββ25467 nginx: master process /usr/sbin/nginx -g daemon on; master_process on
ββ25468 nginx: worker process
Jun 09 09:22:48 vps149491 systemd[1]: Starting A high performance web server and a reverse proxy server...
Jun 09 09:22:48 vps149491 systemd[1]: nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument
Jun 09 09:22:48 vps149491 systemd[1]: Started A high performance web server and a reverse proxy server.```
alright
interesting...
something is redirecting to use https and its redirecting to https again which causes a loop and then 502
it just doing loops for me https://i.imgur.com/W6S9DZS.png
yea
nothing is redirecting tho
look at the url bar
it's just passing localhost:3002 aka the express server
its constantly loading
aight
Ohhh man
hi hoister
Hi
btw augu can you go to the crypto section of cloudflare and see the type of SSL used?
I not You say
it's using pem
is this bad? https://i.imgur.com/7JTSIyC.png
I turned it off
fyi augu's on my vps
alright clear cache
Lil xan
Done
it is π
Tira a mΓΊsica cara
weird why is it redirecting to https
Pela amor de Deus
@warm igloo #memes-and-media pls for non-english stuff thx
Tira a mΓΊsica (Google Traslatert)
No
it's off https://i.imgur.com/9YBqTvj.png
You've been told to go to #memes-and-media - go there now
Either that or start speaking English
How about this @fluid basin https://i.imgur.com/iO1nIfT.png
@languid dragon help
what
I From Brazil
thats ok
other langs in development
π
@vital lark its fine having that enabled, we will need to figure out why is it redirecting to https and constantly redirecting to https again even when on https
yes
A Music issos good
can you dm me your express code?
@warm igloo Please go to #memes-and-media, this is for Development only.
Ok @vital lark
You posted it a while ago, but I didn't really catch it
const express = require('express');
const path = require('path');
const app = express();
app.disable('x-powered-by');
app
.set('view engine', 'ejs')
.set('views', path.join(__dirname, 'views'))
.use(express.static(path.join(__dirname, 'public')))
.get('/', (req, res) => {
res.render('index.ejs');
})
.get('/discord', (req, res) => res.redirect('<discord server>'))
.get('/invite', (req, res) => res.redirect('<invite>'))
.listen(3002, () => console.log('[Website]: rembot.xyz is online~'));
<!--
_ _
| | | |
_ __ ___ _ __ ___ | |__ ___ | |_ __ ___ _ ____
| '__/ _ \ '_ ` _ \| '_ \ / _ \| __| \ \/ / | | |_ /
| | | __/ | | | | | |_) | (_) | |_ _ > <| |_| |/ /
|_| \___|_| |_| |_|_.__/ \___/ \__(_)_/\_\\__, /___|
__/ |
|___/
Author: August (Chris)
Page: Homepage
-->
<!DOCTYPE html>
<html>
<head>
<title>RemBot • Home</title>
<link rel="icon" href="https://cdn.discordapp.com/avatars/447229568282132510/63ab015184c99b3546ae87202cffa226.png?size=1024" />
<link rel="stylesheet" href="css/index.css" /> <!-- ModestaCSS Helpers uwu -->
<link rel="stylesheet" href="https://modesta.alexflipnote.xyz/css/modesta.min.css" /> <!-- ModestaCSS -->
</head>
<body>
<section class="fullscreen">
<div class="center-object">
<section class="me">
<img draggable="false" src="https://cdn.discordapp.com/avatars/447229568282132510/63ab015184c99b3546ae87202cffa226.png?size=1024" class="image-title" />
<h1 class="title">RemBot</h1>
<span class="undertitle">Rem is a discord bot made in the Eris library.</span>
</section>
<div class="buttons">
<a href="/invite" class="btn hover amethyst-nodark" target="_blank">Invite me!</a>
<a href="/discord" class="btn hover discord" target="_blank">Discord Server</a>
</div>
</div>
</section>
</body>
</html>```
oh nope this looks okay
weird...
it must be something else
yes now its 521
web server down
can you check if nginx is running and having no issues?
β nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2018-06-09 10:15:38 CEST; 32s ago
Process: 26873 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCC
Process: 26882 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 26879 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 26885 (nginx)
Tasks: 2
Memory: 3.0M
CPU: 24ms
CGroup: /system.slice/nginx.service
ββ26885 nginx: master process /usr/sbin/nginx -g daemon on; master_process on
ββ26886 nginx: worker process
Jun 09 10:15:38 vps149491 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Jun 09 10:15:38 vps149491 systemd[1]: Starting A high performance web server and a reverse proxy server...
Jun 09 10:15:38 vps149491 systemd[1]: nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument
Jun 09 10:15:38 vps149491 systemd[1]: Started A high performance web server and a reverse proxy server.```
yikes
aight
?
@fluid basin can we settle this thru DM's?
how long does it take for bot verifacation
ok
just wait patiently
yes
i will im just exited
The notification thing?
including the little triangle
no
the black rectangle
when u hover something
when u hover a badge e g
how to have a shape like that
Umm are you on iOS?
Umm you can try and inspect element
tru
i'm dumb
@spring ember yeah i don't manage to get the source of it in inspect mode
i mean i can't inspect just the badge
it's discord
Oh really?
@austere meadow So my bot @lyric hollow, nuggetbot was kicked because it started DMing users, I have resolved the problem and it wont be doing that anymore. Would you be so kind to add nuggetbot back into the DBL server.
alright
As i know discordbot website upvote are having problem right
The upvote not send back to the bot, so pokecord daily now does'nt work
Yo guys, do you know how can I get Channel object if i know channel id (in python api)
There is also one for the server if that is what you want http://discordpy.readthedocs.io/en/latest/api.html#discord.Server.get_channel
Do the server one
The client one is more versitile as it returns them globally instead of a specific server. At leats I guess it does that
The client one should be avoided
That's strange
Yeah, I don't know server.Well I could store the server id, but then I'd need to get server with that
Do you use async or rewrite?
async
Ok go with client then
Thanks a lot
Np
is it possible to edit a message without knowing the channel id?
i presume its not i was just wondering
If you have reference to it
@low rivet so is it by cache?
Oh ok
.
@austere meadow Nope, unless your lib has some interesting cache stuff, ddev docs endpoint for message delete is `/channels/{channel.id}/messages/{message.id}
`
ah cheers
hye guy i want to ask, i making a musik command and the error is Cannot read property 'replace' of undefined
and that is
args[1] is undefined on const url
i follow it on youtube Musik bot the series
possible to send a message and an embed at the same time.. without sending 2 messages
@mental solstice what lib are you using
also why make it return undefined 
discordjs
message.channel.send("content", { embed: <embed> })
you can provide an embed in the options argument
ok, <> required?
no
thank you, i must have forgotten the comma earlier
...
:-/
he is accessing an array
Yeah
the 2nd item in the array just doesn't exist
I've noticed that now
anyone can't help me?
If you want to access the first element in an array just write 0 instead of 1
in here?
yep
Actually
Error log could specify the exact line
I can't see the number from screenshot
So
Oh
Wait
server.js:30
Yep
Thats it
whats probably happening is that the guy is running the command like
[prefix][command] [args[0]] [args[1]]
but he's only using args[0] and not args[1]
If there is no [1] then it errors. If there is no [0] then it'll be an empty string
Just check if the array is bigger than 1 
const url = args[1] ? args[1].replace(/<(.+)>/g, '$1') : '';
what are you think when i use this
In python, is there a way to run 2 python functions at once and it will not continue unless both are finished executing?
Try to use threads maybe and check every cycle for a function state
You got any external links I could look over?
You'll have to write a class for every function tho
give a sec
Here's official an doccumentation https://docs.python.org/3/library/threading.html
And a simple tutorial to follow https://www.tutorialspoint.com/python/python_multithreading.htm
Python Multithreaded Programming - Learn Python in simple and easy steps starting from basic to advanced concepts with examples including Python Syntax Object Oriented Language, Methods, Tuples, Tools/Utilities, Exceptions Handling, Sockets, GUI, Extentions, XML Programming.
Ah, that doesn't look complicated.
Thread is deprecated in pyhton 3.x.x so use threading.thread
If I understood you correctly, no it shouldn't
How does it go with returning variables within functions!?
You there?
and does threading support async?
Manually await it?
I need to await wait_for_message() function at the same time for both users.
and return what they said to a variable
I think that may work
asyncio.ensure_future(do_some_work(5))]
loop.run_until_complete(asyncio.gather(*tasks))```
They said it waits for both to complete and assign the results to a list.
The problem is, does the functions run at the same time.
Will anybody who uses python test this?
I'm on mobile so.
The code is on the url and the example I provided above is a snippet they used. I don't have an editor on my phone to paste things
@sour saddle
Ok, I'll do it a bit later as I'm a bit busy right now
Alright.
Thanks
Does your bot need to re-approved after you edit it?
no
Nope it doesnt need to be
idk what's wrong with this . Discord.py async and requests.
# fox command
@bot.command(pass_context=True)
async def fox(ctx):
url = 'https://randomfox.ca/floof/'
response = requests.get(url)
embed=discord.Embed(title="Yip!", color=0x176cd5)
embed.set_image(url=url[image])
await bot.say(embed=embed)```
Don't use requests, it's blocking, Use aiohttp
so I just put images?
which is a variable that's not defined
*image
what does variable response return?
{"image":"http:\/\/randomfox.ca\/images\/39.jpg","link":"http:\/\/randomfox.ca\/?i=39"}
I'll try that now, thanks
js is easier β’
xD

how would i get role is some said !agree set <role>
an invalid token was provided. fix ur token :p @earnest phoenix
or try resetting your token
he is on glitch
@west raptor get the role id and give it to the author
idk how you would give someone a role with discord.js
i want people to set the role they want to assign

GuildMember.addRole(role)

no
i mean
i can do that but
i want the user decide which role will be assigned when they do !agree set <role>
fetch the role that they want, and then add the role to the author... (?)
@quasi hearth I've used a new token but still like that
i mean when a user does !agree they get the role that you specified i want it to be where the user can do !agree set <role> to decide what is assigned when a user does !agree
what is <role> though? an id or a name of the role?
name
@earnest phoenix weird
:-|
Break them into args
"name", "role"
no
Someone here who is good at hardwares?
but then if the bot restarted it would reset?
roles dont reset
@gleaming summit ask away
Oh thanks
in discord.js, you could so something like this: (?)
/*var role = msg.guild.roles.filterArray(function(item){return item.name == your_args[2]})[0];
var id = msg.author.id;
msg.guild.users.members.get(String(id)).addRole(role);*/ //You saw nothing```
whether to calculate the GOOGLE_API_KEY token should wait several weeks?
@west raptor are you talking about setting a default for everyone
you coul;d say that but the user would get the role when they did !agree
@quasi hearth spoonfeed 
I want to know which is better to run some web stuff and personal apps
Intel Celeron B815 with RAM 4GB
Raspberry Pi 3b+
his spoonfeed is wrong anyway
@west raptor so like an admin sets it and the users have no other option?
yea
web stuff could go on a pi
Celeronβs performance
right?
I am currently using celeron
@knotty steeple yeah very small web stuff
the users have to do it if they do not have the specified role @night imp
But it is slow
is it to use GOOGLE_API_KEY token to wait several weeks before I can use it?
@west raptor so they get to pick what role
But i want to know raspberries are faster
@earnest phoenix are you asking about getting a Google API token?
You should be able to get a free one if you put in your credit card
yes, the admins pick the role what is given when !agree happens
Google Cloud Platform lets you build, deploy, and scale applications, websites, and services on the same infrastructure as Google.
oh
to get an api token for like youtube data you just need a google account
And accessing it on command or caching it
@night imp for general, celeron is better?
yes
It has more power
I've got it, but do I have to wait a few weeks before I can use it?
i dont feel like i really helped but no problem :p
@earnest phoenix you shouldn't?? Is it not working for you?
Un invalid token was provided
Go to line 164
Your token is invalid
Make sure that it is the exact token
Or that you have the right kind of token
Or that you aren't restricting domains
token bot?
Make sure that your bot token is valid
You didnβt input api key or input was invalid
It isn't the bot token @quiet bobcat
I've been using a new token but still like that
then click on your bot account
and get your token from there
@earnest phoenix refresh token
@gleaming summit @quiet bobcatI've been using a new token but still like that
@quiet bobcat π€¦ββοΈ
Then try force re install your node modules
@earnest phoenix please send line 164 to us leaving out your token
To confirm it is the original problem
Where do you define token
Please check you various TOKEN
from file .env
Also, make sure you are using the token under BOT on the discord developer website
@earnest phoenix do process.env.TOKEN
π
π
defining?
Remove various TOKEN
And try using process.env.TOKEN
Then I can know which is invalid
Or try console.log(TOKEN) and check result is same
Insert console.log(TOKEN) and check output is same
Me too π¦ i am not good at eng too
were can i insert
put console.log(TOKEN) after (or before) bot.login(TOKEN) la
^
ok wait
So, I need help with some code I have. Please note that I'm intending to work with the rewrite version of the library, as well as that I'm an idiot when it comes to the commands module.
from discord.ext import commands
bot = commands.Bot(command_prefix='DDT!')
bot.load_extension("Utility")
with open("DEVTOKEN.txt", "r") as auth:
bot.run(auth.read())```
This code here is my main file. Not big for now.
```python
from discord.ext import commands
class Utility:
bot = commands.Bot(command_prefix='DDT!')
def __init__(self, bot):
self.bot = bot
async def say(self, ctx, *, msg):
await ctx.send(msg)
def setup(bot):
bot.add_cog(Utility(bot))```
This is my extension, named "Utility.py". Also relatively short.
The command inside of the extension isn't recognized by the bot, as well as is missing from the help command. Any help on how to fix it?
By the way, I work with R. Danny's discord.py
Oooh py
The magic lands
yeh, seems like TOKEN is undefined
i has use it at top
thats fine
We dont know why that line is not working
try removing the brackets on const {TOKEN}?
dont code on a phone iirc
Or environment variouses didnt defined?
remove brackets?
const TOKEN
^
wait
const TOKEN = process.env.TOKEN
hmm
π
maybe just replace TOKEN with process.env.TOKEN instead in the bot.login
and error π’
@nimble star where's your cog file? is it cogs/utility.py?
no its not
Phew.
so whats the file name?
Utility.py
@quasi hearth
any errors?
May I have a question
Nothing.
I don't think process.env.VAR works
The only error is trying to run the command.
oh wait what dont define a new bot in the cog
I want to make a music bot but do not know why it always does not work @quasi hearth
I got the code from a Python professional from another server.
And without it, I would get the error that bot is missing.
@earnest phoenix Dont use upper words and retry
@earnest phoenix I would suggest putting the token in your code instead of using a environment variable
undefined from which line? @nimble star
@quasi hearth May I have a question about optimization of my bot?
sure
I can't recall now, because I had that error long ago. I think it would hint to the line where the extension is attempted to be loaded.
will take a lil while to test, because VS Code is slow in turning my bot off
Traceback (most recent call last):
File "C:\Users\cojo\Documents\Dimmadome-Service-Bot\DevBot.py", line 5, in <module>
bot.load_extension("Utility")
File "C:\Users\cojo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\bot.py", line 704, in load_extension
lib.setup(self)
File "C:\Users\cojo\Documents\Dimmadome-Service-Bot\Utility.py", line 13, in setup
bot.add_cog(Utility(bot))
TypeError: object() takes no parameters
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x042476D0>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x04247A70>```
oh wait thats something else
@gleaming summit I don't understand "how can I remove if" What are you asking?
I want to optimize app by removing βifβs
hmm
But I cannot think the best way
add a py @bot.event async def on_ready(): print('Ready') in bot.py as well so u know when ur bot has started
you can check out https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator
Are these things probably same with βifβ?
sure:
Hmm
i don't either and i donr see how this plays a part but ok
for example, js const foo = msg.author.bot ? "isBot" : "isNotBot"; //foo would be equal to "isBot" if the message is a bot
I just need some extra time to turn my bot off.
Also, I got from another server a basic example of how cogs work.
I do have to define the bot again.
it's already defined in your init, self.bot = bot
That can be optimized
anybody have some sort of code for this thing?
some examples because im going to sleep
@sand roost are u asking for free code?
that you can just copy? 
i have an idea how to do it
ok then goodnight
basically you just listen for reactions and determine whether it is the correct message and what reaction it is
Send message then add reactions and then confirm with userβs reaction
I am on mobile
So I cannot do some stuffs for you
Sorry about that
i have an idea how to do it
But I am on mobile
I can send you some examples when I am on PC
i do know how to code one
dude i got it
Washing : P
what link are you requesting ?
from discord.ext import commands
import random
class Utility:
def __init__(self, bot):
self.bot = bot
@commands.command(name="say")
async def say(self, ctx, *, msg):
"""Makes the bot say something!"""
await ctx.send(msg)
@commands.command(name="rand")
async def say(self, ctx, num1, num2):
"""Randomizes 2 numbers!"""
await ctx.send(f"Your number is {random.randInt(num1, num2)}")
def setup(bot):
bot.add_cog(Utility(bot))```
I managed to make the commands work, but now when I try to make multiple commands, only the last one gets noticed by the bot. How do I fix *that* now?
SUBSCRIBER LA DWONLOAD :http://www.flvto.biz/ #BreakBeat___ FOLOW me INSTAGRAM :https://www.instagram.com/hafiz_truna/ FOLOW me FACEBOOK :https://www.faceboo...
@earnest phoenix #memes-and-media ?
nope
What is that
thats is link youtube
how does this relate to #development
console.log your GOOGLE_API_TOKEN and see if it is undefined?
@sand roost that is the link hes trying to requrest
@earnest phoenix That's not related to #development, isn't it. 
lads, he's answering https://why-are-you-buying-clothes-at.the-soup.store/3ade54.png
My bad, sorry. 
simpel-youtube-api?
did you get the youtube key the proper way?
how could i fix this? (node:5454) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): DiscordAPIError: Privilege is too low...
your bot doesn't have permissions to do the action
^
yet it seems it has administrator?
What are you trying to do?
did you give it admin on your server?
change a nickname
yes... i know
hmm, whose nick are you trying to edit?
the user that runs the command !afk
what code are you using to edit the nicknames?
@west raptor It appears that you cannot edit the nickname of the owner / admins of the guild with bots
For example, in my own server, i tried editing my nick, and my other bot's nick (who has admin) and they both had the same error. However, it worked on other members
Heirarchy is a thing on discord, im not sure if admin supercedes that, but i know permissions dont
Admin permission doesn't bypass the hierarchy.

However for bots, they do not automatically take the users hierarchy into account
Make sure to factor that in in your code
how should I sort a map into different categories
i have a list of commands and they should be sorted by category
like an array with maps of commands
sorted by category
Well, just make some arrays with functions in them or something..
How would I know when a new video is posted for a youtube channel?
Would use a webhook service for that
@gilded blaze would this do it?
@gilded blaze a webhook?
So what's with the vote webhook
why is it when i send my webhook this , it works, but when i press test it doesnt
i have given it the correct authorization
and it used to work
i havent changed anything
You might want to ask in #topgg-api since it's meant for these kinds of things
Also currently there seem to be issues with webhooks
@slender thistle you there bro
btw
anyone have any idea on how to host your bot
online
like instead of it being hosted on your PC?
A VPS?
it costs money
most of them will be linux, which is enough for most programs
and free vpses isn't worth it
but you could find some windows ones if you need, but they tend to be more expensive
depends on usage
Yea generally you can install whatever software but you might wanna look at whatever Provider's ToS and see if they have limits.
to like idk MySQL
relies on postgres a little much
depends on your usage
or is there other better options
I use mysql
it requires a lot of writing
MySQL/MariaDB
@floral stone what are the costs?
I'd rather use Maria personally
depends on the provider
hmm
@buoyant oak check the channel pins!?
Maria works with python?
there was a message
okay
but you pay for the server as a whole, then install whatever software you need
don't use a free one, trust me @buoyant oak
you don't need an expensive server either
Yea defo don't trust a free one for real stuff >.>
Only buy what you need, VPSes scale fairly well and have lots of options.
yea I'm slightly confused tho, pvs, and a MySQL server are too different things tho right
oh
yea
DO is a good option, Vultr was good, but I started having trouble
Galaxygate though 
yea I'm in year 11
GalaxyGate is a good vps
sign up for github students
You get free $50 with GitHub educay
If you have a school email you can sign up for GitHub education (probably)
wow the synergy
you can get a 50$ gift card for digital ocean
okay
Or just a school id
ah
Only if your school qualifies
ya beat me
idk it has a domain
If it is an official school
It's not every schoool π
And you have an id
Idk if high schools are counted.
@neon schooner they are
I'll check it out
Most High Schools don't have student IDs
High schools are counted for me
or emails
Just say something like wanting to follow a CS major or something
at least around here
@neon schooner what HighSchool did you go to 
XD
We had school IDs in elementary
Cedartown High School π
The GA school system didn't have IDs the entire time I was going through it π
Granted no one used them and all were lost but still
wait guys just to clarify, a pvs, and a mysql server are two different things right.
no
You can run mysql on a vps
a vps is a virtual server
oh really?
I hate mobile
thats cool
a vps is like a computer
(It literally stands for virtual private server)
It's just a computer that the host set up for you to use (as a vm/container depending on their hosting structure)
yea ik but I thought you had to rent out a MySQL server to run it
No
You can have a separate server running mysql if you want
But you can also run it on the same machine
mysql is public 
okay thanks for the clarification
it's free
why would u need to pay for it
damn, complex language. I like it.
some companies charge extra for mysql
right, lemme check em out
but it's probably a separate vps
oh#
which you might not need
hmm
Like I said, just make sure whatever provider you choose doesn't make you pay more
does DigitalOcean charge extra for MySQL then?
no
No afaik
no




