#development
1 messages ยท Page 1237 of 1
Why doesn't ts await message.guild!.members.kick(user); kick the GuildMember? The error is
"Property 'kick' does not exist on type 'GuildMemberManager.'"
Nah, my assignment says x must be 5
Well you're getting Abs() which wouldn't be needed then if youre doing a sqrt
yeah?
Try message.guild.kick
(Abs(1 - x) ^ (1 / 2))
did you mean?
(Abs(1 - x)) ^ (1 / 2)
assuming Abs is absolute value
๐ you're welcome
:d
still doesn't work though
Then break you're calculations down into steps
And debug that way
Set breakpoints and check the results along the way with what you do on paper or whatever
The "IDE" points at x^(1 / 2), the very first calculation in arr(1)
your* but who really asked/cares
what is x
better make sure x is positive
Unless my multiplications that only rely on x somehow edit it, I don't think that's an issue?
It's equal to 5 before the first exponential operator used on it
๐ค
๐
is this of any significance
https://stackoverflow.com/questions/25172899/type-declaration-character-does-not-match-declared-data-type
Someone knows a package or API to know the status of a ARK server?
nope
@ember lodge you need to use steam api for that
Can anyone give me advice about hosting a website/dashboard for my diiscordjs bot
afaik there isnt a package for that, only a wrapper to easily communicate with steam
thxs

but the servers are from PS4

Hmmmm that might make things more difficulty
i am unaware of how to meddle with ps4/xbox servers
@sonic lodge One issue solved, now I'm getting division by zero somehow. This will be a rough night for my mind... ๐
Thanks
i tried using gamedig but it doesn't work
i dont think theres an open api for touching ps4 servers that you can acess
most of this stuff should be handled by ps4/microsoft servers
ive used the steam api to connect to ark servers before, but not on console
Thanks for help, i am created music bots ๐
thanks then 

if you add the infinite many numbers between 0 and 1 do you get 2 or less than 2?
offopic but should be 2
use parseInt
parseInt(string, radix)
so hex
a character's encoding is just representations of hex
Do you know what the encoding is?
nope
do you know if it's even a character?
is the text "1101101001 "
You could try ascii
a is a character
the hex representation is 61
the decimal representation is 98
and the octal representation is 141
binary is just one of the representations
it's actually easier to go from something -> binary -> something else
so going from binary -> is fairly simple
Can anyone give me advice about hosting a website/dashboard for my diiscordjs bot
@earnest phoenix
separate the discord bot logic from the website. host the discord bot on your computer and host the website on some cheap hosting somewhere.
Well you can integrate via a custom API
.bumbum {
color: "pineapple green";
}```
@misty sigil why
because it just makes things easier
[BOT] --> [API] <-- [WEBSITE]
|
v
[DB]
yeah they both connect to the same db
separate the discord bot logic from the website. host the discord bot on your computer and host the website on some cheap hosting somewhere.
@proven lantern I'd consider architecting it like this
https://discordapp.com/channels/264445053596991498/272764566411149314/754424744438267924
unless you want the bot making db calls directly as well
@pure lion I added the to my bots long description and it just adds that code to the text
@faint prism agreed, that's how i have mine
@hexed zinc is it in style tags?
Im not sure how to do that
[BOT]-->[API]<--[WEBSITE]
|
v
[DB]
@faint prism how would i do this?
Well it's a pretty full stack dev project
yeah it seems like it
right now mine is fairly basic
the bot and the dashboard are seperate
they both make a connection to the same mongodb
what
Any idea why this is not working?
<style>
.bot-name {
color: "pineapple green";
}
</style>
@faint prism
you cant host something like that for free really
idk i've never really explored free hosting
that aside
you would need a node app, and most free web hosts dont allow those
the official discord api is interacting directly with your database
Hi everyone. I moved my bot from Heroku to Vultr VPS to avoid the dynos reset putting it to sleep. I start it with nohup node bot.js command. But it still stops every few hours. Anyone here experienced with that? Trying to run it 24/7
the data from the api is stored in the db
use pm2 process manager
the api cant directly do that
Vysion so I have actually tried using PM2 but for some reason my bot goes online for a second and then back offline when I do that
yeah my website is a node app
so basically im pretty sure pm2 has logs that you can read through
if you run pm2 ls what shows up
oh yeah pm2 logs appname
@faint prism [diagram]
@proven lantern The discord api won't be calling your db lol
lmao that was confusing
Thank you I will try that now
well what i need to see is the logs
so just grab a screenshot and report back

commands through message listener sounds like a fancy way of saying discord wrapper
but
like honestly the fuck is going on here
what do i do about the website api
do you want to display bot stats on the website
commands through message listener sounds like a fancy way of saying discord wrapper
@valid frigate this message listenerclient.on('message', messageListener);
AElawema,manAWIOEKWLA
for editting the bots settings
oh hm @valid frigate
oh, you mean an api library?
catch(){}?
this means you didnt close the catch block right
wow that is weird
discord.js is based off js
now
catch () {} can be substituted with catch {} (discards the error)
in later nodejs versions i believe
thank eyesight man
lol
kk thank you, I'll uninstall that and install newer.
so is the conclusion: its way too confusing and complicated to do so i just shouldn't?
the fuck is the discord.js error then
can some one help me im in testing 1 vc
I think you may be right though, I think I had node 8 at some poitn I may have both and should uninstall 8 or something
can you run pm2 describe bot
i have a functional dashboard
right
it allows me to edit shit like the prefix per server
but i need to properly host it
yes it's showing version 8.10! I didn't know it didn't switch when I install new version
ok well in that case
you should delete that pm2 entry and completely restart it
pm2 delete bot first
and then start it again
you could access your own api directly from your vps ip
depending on your host though you might not want to expose your ip so if you really want to keep it secure then get a domain and hook it up with cloudflare
i just dont understand like
.xyz is <$1 for most registrars
yeah
wow thanks a lot Vysion, this fixed it! I'll be paying forward for your kind and timely help.
i have a domain
lmao no problem bro
wdym pay for file hosting
like i have the domain
im a bit lost
but
domain isnt a vpn
right
there is nothing on the domain
yeah
and somewhere is free
there isnt file storage in a domain
https://freenom.com is not my sponsore
exactly
it points to an ip which you can then use
:))
so i see that you need help with perhaps setting up dns?
yes
but putting the domain into my node app doesn't work
just point to where your nodeapp is
who is your domain name provider
be it locally
www - CNAME - UR_DOMAIN.DOMAIN
or in a vpn
...
i man
i mean
if you have the domain set up and whatnot and the ip is pointing to your vps
@proven lantern if you really want a diagram it's this
yes
right
funny name
it is like "go dad pay it for me"
is the a record of your dns settings pointing to your vps ip
:))
is the a record of your dns settings pointing to your vps ip
@valid frigate im not sure how to do that
this is optional ^
in your domain name settings there should be an option to manage dns right
u have to do that
cname is optional

yes
bruh if u want to add domain
there is options
its A you want
yes
ok ok cool
no.
now add an a record pointing to your vps ip
they're different
ok
you shouldnt worry about setting up a domain until you are ready to advertise your bot
imma read docs about that
A record**
Understanding the differences among the A, CNAME, ALIAS, and URL records.
you shouldnt worry about setting up a domain until you are ready to advertise your bot
christ
hes making a dashboard

nice
this is what i have
most hosting comes with free domains
now click the edit icon next to the a record
The A record maps a name to one or more IP addresses when the IP are known and stable.
The CNAME record maps a name to another name. It should only be used when there are no other records on that name.
and under value, make that your vps ip
*..web.app is one google gives for free
should i make a email with my domain name ?
very challenging
why
no you dont need an email
it is ez
points to?
yes now replace "points to" with your vps ip
@charred geyser idk
use a free gmail account
ok

: /
yes...you can
how can i get my vps ip
i use github pages
its aws
uhhhhhhhhh
try using what i used to use
sudo apt-get install net-tools
dig +short myip.opendns.com @resolver1.opendns.com
ifconfig -a
oh yeah that works too
and u done
yes its the ipv4 address
paying for a vps is overkill unless your bot is getting lots of traffic
but with ifconfig u can get all ur network info
so i assume you know about nginx
but will learn it soon
HAHAHAHAH
for exmaple shivaco
i think i got the ip
that looks very javascript to me
lol
ok nice
colour or color?
do you have nginx setup on your vps
color
colour = self.0x#7289da
ubuntu@ip-172-**-**-*:-$
why u hide it
ddos
lol
thats right isn't it
i closed all ports except for 443
nice
yes that is right
nah use PORT 6969
shut up dude
443 is good for vpn bypass
seriously
lol
yeah
6969 is the best port
i use that at school cause it-support 

correct
@earnest phoenix are you prepared to pay $5 a month for that
good luck
btw who use cloudflare for there domain ?
me
ok so basically @charred geyser at this point what you need to do is install nginx and set it up as a reverse proxy to your application
sorta
nginx
when i was setting up my smtp server cloudflare didnt allow me to upload a custom ssl certificate
on the vps?
how do i send an image with python?
so ill give you a few resources to do it
are tk domains cheap?
well at this point i feel like you can do it on your own
@valid frigate ๐ซ
dude a part of being a programmer is asking for help bt at the same time i cant guide you all the way
dont worry though
@proven lantern if you really want a diagram it's this
@faint prism the apis are separate

What do you call this
Bot.tag or bot.tags
@drifting wedge tk domains are free, but with domains you sort of get what you pay for.
I highly, highly, recommend you shell out even just a dollar or something for a domain on namecheap or get a free .tech domain off of the github student pack
install nginx: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04
setup nginx as a reverse proxy: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-18-04
Nginx is one of the most popular web servers in the world and is responsible for hosting some of the largest and highest-traffic sites on the internet. In this guide, we'll discuss how to get Nginx installed on your Ubuntu 20.04 server.
also .tk domains are typically highlighted as spam domains so sending email from them has a high chance of ending up in the trash
yeah np and good luck
What do you call this
Bot.tag or bot.tags
if you need help just ask again
What do you call this
Bot.tag or bot.tags
should i use https
yes
Does anybody else have an eval command on their bot? :d
Great, I arrive and kill the chat lmao
gg
okay there is a bit i dont understand now
Step 5 โ Setting Up Server Blocks (Recommended)
When using the Nginx web server, server blocks (similar to virtual hosts in Apache) can be used to encapsulate configuration details and host more than one domain from a single server.
i have one command that can create up to 12 voice channels, but they aren't all created at once. would this command be considered api abuse/spam?
infinite
@valid frigate in this part they are starting to make folders on the vps and make index.html
step 5?
where is your application
should i just ignore that
well i mean
if you have a front end setup for your bot's website then yes
make the folder as they say
What the actual fuck is the difference between Sqr and WorksheetFunction.Power in VBA?
x = 5
we1 = Sqr(x)
we2 = WorksheetFunction.Power(x, 2)
locations_found.slice(0, 10).map(location, i) => {
const flag = locations[i].split(": ")[0];``` it is giving me the error malformed arrow fucntion parameter list
that arrow is also red underlined. Why is that?
@slender thistle it looks like WorksheetFunction.Power can do more than square
i think arrows have to be inside the brackets?
Sure, but it should be the same operation, no?
the function isnt closed
like (blah blah => {
});
no
no?
not at all
oh
Oh my God, what is this ugliness
your mouse is coving it
nice
i think that my syntaxes are good
that's a weird number format
It's just a simple output with concats
oh, you put in the period at the end
we1 is Sqr, we2 is .Power
yeah, I don't intend to rely on that fully. It's just a simple MsgBox procedure I used
nothing happens when run
vs code reports no problems, no console error
using quick.db, btw
put it in a bin pls
alrighty
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
you mean the js (await db.get(`${message.guild.id}_SETUP`) == undefined)?
yes
bumping this questing
https://discordapp.com/channels/264445053596991498/272764566411149314/754437256370192464
how do i claim my github education thingy?
i got it
but how do i like get the domain?
what do you mean get the domain?
the github student thing
you get a free domain
a .tech domain
how do i like make one?
instead of undefined?
nope still doesnt work
i am getting UnhandledPromiseRejectionWarnings though
the undefined you're seeing is the field with no second value
"top.gg widget", "second value"
i think
that's weird
bumping this question
https://discordapp.com/channels/264445053596991498/272764566411149314/754440275597721711
nothing happens when that script is run
const member = await message.client.users.fetch(match);
if (!member) return await message.reply("Couldn't find that user in this guild!");
if (!member.banable) return await message.reply("I can't ban that user!");``` how come that does not work?
The error is on the last line and it says that property 'banable' does not exist on type 'User.'
.w.
member.banable?
check where member is defined
if i try it with kickable it also doesn't work
even though I know that kickable is valid
that's because it's bannable not banable
maybe because you need a guild user?
I can't just use client.user?
I have to use guild.member is what you are saying
const reason = args.length > 1 ? message.content.slice(
message.content.split(/\s+/)[0].length
).trim().slice(args[0].length).trim() : "No reason provided"; // Reason as a "greedy string"
await member.ban(reason);```
maybe member.ban({reason})
but its a promise, so I have to use await
with await
oh
just put reason in an object
I don't understand how or why that works, but ok
it's the same as member.ban({reason:reason})
Then finally, why does this return an error at ${member.tag}: ```ts
const banConfirm = new MessageEmbed()
.setColor("#00ff00")
.setTitle(${member.tag} has been banned by ${message.member})
.setDescription(Reason: ${reason});
message.channel.send(banConfirm);```
I can take .tag off and it works just fine
const member = await message.guild!.members.fetch(match);
All member objects have a .user property
bumping this questing
https://discordapp.com/channels/264445053596991498/272764566411149314/754437256370192464
it's fine as long as you have a sensible delay between each creation
can any1 help me?
i got the domain with get.tech
the github thing
but how do i move it to cpanel?
you're asking how to build a house basically
how do i build a house?
sounds go--
ah i see
i havent used much cpanel but from logic you should be able to point your domain to the servers ip where cpanel is hosted on and add it to cpanel
if you add a domain to cpanel it should guide you through the process
also where can i get a tk domain?
Uhh yeah my bot isn't going online even though nothing changed in client.on("ready", async => {})
client.on("ready", async() => {
console.log("Ready!");
// Set user presence
client.user!.setPresence({
activity: {
type: "PLAYING",
name: "with Archigan and Terrain",
},
status: "idle",
});
await reloadCommands();
});```
What's with the exclamation point in client.user!
And you should check where you try connecting/logging in with your bot (.login(token)).
have you heard of TypeScript?
I've heard of it, but I didn't know it had that operator.
Also i login after the client.on("message")
Are you sure the token is valid? You could also listen to the debug event and log the trace to see what's going on internally
Even if you didn't explicitly change it, there are other reasons your bot may not be online. Like I said, could you listen to the debug event and log the trace to see if something interesting is going on internally.
Also can you try console.log(process.env.TOKEN) just to make sure it's there (but still try what I said above)
client.on("debug", console.log)
ayo๐approve๐my๐bot๐
That isn't how it works
So you got temporarily banned
If you got a 429 on trying to connect it means you got rate limited (aka temporarily banned). I don't know the reason for your case.
what are you even doing to get ratelimited
no clue
maybe
Although I couldn't switch to anything but repl.it, it is just really easy for me
Try running your bot locally (to test)
ok
I forgot how to run main.ts using npm
Im in the target directory
is it just npm run main.ts?
npm run is for scripts
ok
If your scripts include one to compile and run TypeScript then use that script (npm run <script>)
what you open json with notepad?
I'd use something that has syntax highlighting and points out syntax errors
coughcoughrepl.itcough
online code editorโข๏ธ
yus
though is this site useful? https://www.typescriptlang.org/docs/handbook/compiler-options.html
A very high-level overview of the compiler options in TypeScript
anyways, vsc is more recomendable
if you have a pc who runs it btw
but if you not
My laptop can run VSC
Mine is an IdeaPad
oh ok
how should I avoid making database calls every message & why? I see it being said often here
Why?
You'd be asking your database for data on every message. As your bot grows in servers, the message activity will grow as well. You could be receiving hundreds of messages every minute. Databases are strong, but they're not immune.
How?
When you request something from your database, cache it in memory (such as a map). Look up the data in the map before you hit the database (repeat step one if you hit the db). Caching will put pressure on your app's memory instead which is the downside.
ty qt
oh
hi there
how do you separate the settings for different guilds?
for example guild 1 is playing this audio file and guild 2 playing the other one
Is there a place to inquire about how to enter my bot on this server?
Caching will put pressure on your app's memory instead which is the downside.
you can't overwhelm a programs cache memory even if you wanted to purposefully, memory exists for a reason
Is there a place to inquire about how to enter my bot on this server?
@William.#0008 read FAQ, you have to go onto https://top.gg and enter your bot for application, wait around five weeks or so, get accepted
More specifically, #rules-and-info message
@crisp meteor
+5wks, rip
If the bot was not verification
Is it accepted?
Verified = Accepted
But Accepted != Verified
Pretty sure it's used interchangeably in this context
why is this not deleting the messages? https://i.callumdev.pw/v0sxo.png
Is there a way to fix this, it doesn't happen always it only happens sometimes
prov a video
prov a video
@opal plank oh is that it? Do u know any solutions like to not accept the videos
@slender wagon im assuming you fetching reddit post which may contain videos, and you trying to put them in the image payload, which wont work
Oh yeah probably that
Is there a way that i can stop the posts that contain videos
if its a video, either return or set it on the video message payload
There is one for video too?
on embed, yes
Oh but what if i use video can it support images too?
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
images for images, video for videos
Aight ty
use them accordingly
Yeah i gotta make the difference before sending
do you guys know any 24/7 app host?
no free ones though
heroku dies at day 23 or so
can anyone help me with like hosting a website+bot combined and linking it to a domain
heroku dies at day 23 or so
misleading to say the least
prob meant 23h/24h
wait
what
its in days


yikes feels bad
erwin pls halp me
with?
use google
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
there
i helped with google

kek
i need help with
hosting my nodejs app which is my bot and my website combined and making it connected to my domain
i saw the question, usually i ignore the ones i dont know, believe it or not i dont know everything like Tim
cant help if i dont know the answermyself
i thought you were my lord and saviour
havent played with domains or anything of the sort so i wouldnt even know how to use one properly


maybe willi can help?
website: learn how to configure apache/nginx proxy
domain: go to your domain provider and add your server ip there
i do use apache though
yeah
i have done that
i am just stuck on
nginx
i cant quite figure out how to set it up
i'd assume there'd be tons of guides for ngix
literally theres like 38752 examples on google if you searched
sorry I'm just being rather mean today >.<
its ok
at least give us your config or something
then maybe someone could take a look and hopefully help you
config for what
nginx
ok one sec
server {
listen 80;
listen [::]:80;
root /var/www/snailcorp.xyz/html;
index index.html index.htm index.nginx-debian.html;
server_name snailcorp.xyz;
location / {
try_files $uri $uri/ =404;
}
}
listening to port 80?
this is just what i pulled from one of the guides

a "nginx nodejs proxy" in google should give you more than enough examples
Anyone know how to find the 2's complement binary representation for -30 (which is in decimal)?
If I did it right, it's 11100001
if im gonna use something liike this
const http = require('http');
const hostname = '192.168.43.31';
const port = 5000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Sysmon App is Up and Running!\n');
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
would i set the hostname to my domain or my vps's ip
i might try angular soon tbh
waiting on my keyboard to arrive first
coding on this shitty keyboard i got rn is a big nono
coding on this shitty keyboard i got rn is a big nono
@opal plank You gonna rearrange the letters to DVORAK ?
lol
smol
it triggers me to have to go all the way up there to press DEL
that plus the space half way working and some keys kinda stuck
https://discordapp.com/channels/264445053596991498/272764566411149314/754508911842820108
(30)_10 = (11110)_2
(11110)_2 = (0001|1110)_2
(0001|1110)_2
(1110|0001)_2 1โs complement
+ 1
(1110|0010)_2 2โs complement (carried)
(1110|0001)_2 = -1*2^7 + 1*2^6 + 1*2^5 + 0*2^4 + 0*2^3 + 0*2^2 + 1*2^1 + 0*2^0
= (-30)_10
This is what I've got so far
already triple checks, nothing underneath, its just the tile thats bad
Like flaz said, there's no "best" IDE, but one IDE may be better at something. For example, IntelliJ IDEA is the go-to for Java/Kotlin (then there's eclipse and vsc)
@client.event()
async def on_message(message):
with open('users.json', 'r') as f:
users = json.load(f)
await update_data(users, message.author)
await add_experience(users, message.author, 5)
await level_up(users, message.author, message.channel)
with open('users.json', 'w') as f:
json.dump(users, f)
I get an error:
missing 1 positional argument: 'coro'
How do I fix?
I don't think you're supposed to call .event()
ohh
OMG
IM STUPID
Ive used python for a year and i forget thatlike omg im retarted
Nobody has any clue as to how long my bot will be rate limited lmao
Just hope it ainโt indefinite
If you send an HTTP request to the /gateway/bot endpoint and look at the headers, you can see how long the rate limit lasts.
curl -I <url here>
Ah
so for my repl would that be
curl -I https://Rick-Astley-Bot--archigan.repl.co/gateway/bot
Correct
noop
It should start with Discord's API base URL. In your case, https://discord.com/api/
-dottumpostum
-dotpost
It is rest. You send an API request to the endpoint and see what you get. In this case, it should be 429 since you got rate limited. The base URL is what I posted above, then append the /gateway/bot part as the endpoint.
Ok
@client.event
async def on_message(message):
with open('users.json', 'r') as f:
users = json.load(f)
await update_data(users, message.author)
await add_experience(users, message.author, 5)
await level_up(users, message.author, message.channel)
with open('users.json', 'w') as f:
json.dump(users, f)
async def update_data(users, user):
if not user.id in users:
users[user.id] = {}
users[user.id]['experience'] = 0
users[user.id]['level'] = 1
async def add_experience(users, user, exp):
users[user.id]['experience'] += exp
it just keeps updating the json to 5
I donโt Python
i changed my level to 10 and it changed it back to 5
I didnโt know that you could use JSON with python
really?
JSON was made for JavaScript, no?
Im not sure
It has it in the name
i dont use javascript
JSON can be used for more than JS.
I guess it is also used by C#
JavaScript Object Notation
So it was made for js
Btw, anyone know python?
to help me lol
My first language was python and now I know nothing of it lmao
something's wrong, i can feel it
Actually, I know something is wrong, but i dont know where to put what
When you say "keeps updating the json to 5" do you mean it always stays at 5 or it only updates by 5.
stays at 5
Yerrin remove the /bot part at the end (mistake of mine) and make sure you're running that on the project which got you rate limited (repl)
like, i changed my level to 10 and i sent a message and it want back down to 5
ah
@sudden geyser
my repl keeps running for some reason
From my perspective, it looks correct. Unless update_data's if condition was always returning True, causing it to create a new entry for your user data, I don't see the issue (or level_up is doing something weird).
You should try debugging it to see what's causing it to always stay at 5. See what functions are being called and aren't being called (in update_data and add_experience). I also don't know if using JSON as a database is the best choice of design, especially since you're doing it on every sent message.
@sudden geyser its update data returning true
I think it's trying to invert user.id because you specify the not keyword before it. Try doing this instead: if ... not in ...
yeah try it
Not helping
Using JSON for this is suicidal
SQLite - Python - In this chapter, you will learn how to use SQLite in Python programs.
Then again, Postgres would be better
Oh fuck me life
when i try to run my discord bot running discord.py it will say 1. "syntax error" or 2. "module discord not found" 1. is running with python 2.7 2. is running with python 3.8 | this only started happening after i switched to Zorin OS
SQlite and me dont get along
Why's that?
Either way, SQL is very easy & there's no reason why you shouldn't learn it
ive never had good luck with it
yeah SQL is fairly easy and very helpful once you learn it
@dense nest Try Postgres with asyncpg (the later is for if you are using Python), all you'll ever need in life

python 2.7 returns ```Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "/usr/lib/python2.7/runpy.py", line 114, in _get_module_details
return _get_module_details(pkg_main_name)
File "/usr/lib/python2.7/runpy.py", line 119, in _get_module_details
code = loader.get_code(mod_name)
File "/usr/lib/python2.7/pkgutil.py", line 281, in get_code
self.code = compile(source, self.filename, 'exec')
File "/home/juls07/Joke-Bot/main.py", line 8
async def on_ready():
^
SyntaxError: invalid syntax
and python 3.8 returns ```Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/juls07/Joke-Bot/main.py", line 1, in <module>
import discord
ModuleNotFoundError: No module named 'discord'
i was able to run this on fedora and once i switched to Zorin OS i started having this problem (Zorin is made off of ubuntu)
The first one is because the syntax isn't in Python 2. discord.py requires Python 3 (3.5.x I think).
The second error means it couldn't find the module discord, which would mean it wasn't installed somehow, but you say it only happens on Zorin. Did you do anything different between the two
i dont believe so as i legit just coppied the Joke-Bot folder and put it on a drive to move to zorin so if anything it would be a package thing
and import discord is a module from a package
So you didn't install the package(s)
oh right
The first one is because the syntax isn't in Python 2. discord.py requires Python 3 (3.5.x I think).
@sudden geyser 3.5.3 but that's because aiohttp requires it
there i finally managed to install it because i havent needed to install any packages in a while
there it works now We have logged in as (j!) Jeff the Joker#6735
nice
now im going to completely change the library of my bot @upper bloom to discord.js because Eris just randomly crashes for no reason
There's probably a reason to it.
everysingle time it crashes it says it could not reach eris' library for more than 10 secs (i have reliable and fairly decent internet)
People who understand canvas, how do i rotate the text only without rotating the arc circle? i tried ctx.rotate and it spinned the whole canvas, if anyone could help me out i'd appreciate
@lament spruce
rotate it back to its original position (-20 * Math.PI / 180) after filling the text
@pale vessel That helped, thank you so much!
So I try to get random pictures from nekos.life but they don't wand to load. (discord.js v12)
Any other idea to get the images?
my repl keeps running for some reason
@opaque hawk something keeps pinging it every five minutes
So I try to get random pictures from nekos.life but they don't wand to load. (discord.js v12)
Any other idea to get the images?
@fringe axle show the code
and the output
then only we'll be able to help
async run(message, { min, max }) {
min = Math.ceil(1);
max = Math.floor(300);
const waifuEmbed = new MessageEmbed()
.setColor(`RANDOM`)
.setAuthor(`Waifus!1!1!`, message.author.displayAvatarURL())
.setImage(`https://cdn.nekos.life/waifu/waifu_0${Math.floor(Math.random() * (max - min + 1)) + min}.png`)
.setFooter(`A cute waifu for you ${message.author.tag}!`)
.setTimestamp();
message.channel.send(waifuEmbed)
}
}
wut
`https://cdn.nekos.life/waifu/waifu_0${Math.floor(Math.random() * (max - min + 1)) + min}.png`
But that worked in a other command
@fringe axle bruh
totally ignore me accidentally clicking shift enter
just cuz one part of the API works in a way doesn't necessarily mean the waifu thingy will also have the same method
imma go read the docs and see
That's what you get.
wait no this is NSFW my mommma will kill me
That's what you get.
@fringe axlethat's JSON
not a URL
you have to parse the URL out of it
Yea, but I don't know how to get the URL
one sec
:U
JSON.parse
returnedValue.url
for some reason adding ```const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(./commands/${file});
client.commands.set(command.name, command);
}will sayclient.commands.set(command.name, command);
^
TypeError: Cannot read property 'set' of undefined
at Object.<anonymous> (/app/echo.js:19:18)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:826:10)
at internal/main/run_main_module.js:17:11
/app/echo.js:19
client.commands.set(command.name, command);```
I have a question
ask it
he doesn't even know how to send an HTTP request
@earnest phoenix ;_;
i'm here to help tho
try client.commands[command.name]=command
So why judge instead of helping them learn how to send HTTP requests
I may have just found my first use for a cron job
Hm, I try to find it out but I don't get it
In what page you recommend host my bot?
I want all my rasp pi security cameras to rsync their footage at 1PM to my main rasp pi server
Why my server is locked???
@earnest phoenix contact Xignotic, one of our website moderators
Ok
Someone knows now how I can get random neko image links from it?
ik
for some reason adding
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
}```
will say
```client.commands.set(command.name, command);
^
TypeError: Cannot read property 'set' of undefined
at Object.<anonymous> (/app/echo.js:19:18)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:826:10)
at internal/main/run_main_module.js:17:11
/app/echo.js:19
client.commands.set(command.name, command);```
@gusty folio there are multiple choices for a VPS: SkySilk, GalaxyGate, DigitalOcean, Contabo, etc.
i am typing
@restive notch try client.commands[command.name]=command
ok
client doesn't have a property commands
@gusty folio there are multiple choices for a VPS: SkySilk, GalaxyGate, DigitalOcean, Contabo, etc.
@slender thistle oh thanks.
now its saying client.commands[command.name]=command ^ TypeError: Cannot set property 'ping' of undefined at Object.<anonymous> (/app/echo.js:19:31) at Module._compile (internal/modules/cjs/loader.js:759:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10) at Module.load (internal/modules/cjs/loader.js:628:32) at Function.Module._load (internal/modules/cjs/loader.js:555:12) at Function.Module.runMain (internal/modules/cjs/loader.js:826:10) at internal/main/run_main_module.js:17:11
// I would recommend using the 'phin' package from npm for dealing with HTTP requests
// Install it through `npm install phin` in the CLI
const phin = require("phin"); // This will tell Node you want to 'require' the package
// inside the waifu command thingy
let response = phin({
url: "the url nekos.life told ya for the API", // this will send a GET http request to the nekos.life API
method: "GET", // dunno wut this does
parse: "JSON" // parse the JSON response which nekos.life API sends
});
// response is an object
// you can get the 'url' property from it
response.url; // returns the random waifu image URL
@fringe axle
nope
also this ain't spoonfeeding
this is teaching AF
xD
that's just smth i randomly said please ignore
also why are you adding NSFW commands
client.commands=new Discord.Collection();
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands[command.name]=command;
}```
also why are you adding NSFW commands
@earnest phoenix why not
@fringe axle don't forget to restrict the NSFW commands to only NSFW channels. It's illegal to send NSFW shit in non-NSFW shit places.
d.js collections have keys and not indexes?
oooh

Yea, already did that. xd
nope
@restive notch ok?
gtg do some shit with canvas need help with javascript ping me like hell
@earnest phoenix 
@ivory jolt are you a snipe command or what
@earnest phoenix
@fringe axle not installed
did you install the dependencies of the phin package?
No
bruh
how will it work without the dependencies
everything on npm is a wrapper
bold statement ik
I did npm install phin
Hey guys got a litte question. What do you do with custom prefixes, keep the default bot command and add the custom prefix (listen to two prefixes) or replace the default bot prefix with the custom prefix?

that's JSON