#development
1 messages ยท Page 1091 of 1
how to error?
in hastebin or wutever its called if its too big
hastebin**
ty

[GraphQL] [Rust] I'm looking into using a GraphQL API for a bot I've written in Rust with the graphql_client library. However, it seems I need a schema.graphql file, which would contain the valid GraphQL schema, and I have no idea how to get/generate it based on the API I'd be using (and did not find much help on Google). How would I be able to use it?
Js?
hi
@weak rain issue?
do u know how to set a timer for 1 hour without db?
setTimeout?
^^^^
setTimeout?
@misty sigil that does not work
Wdym
it does if you use it right
What time are you putting in?
try use db
i tried with 20 second and it workes
Did you wait an hour?
wait can i send here the code?
node schedule should also do the trick
yes
Um
code bloc
1 hour is 360000
ty
Head my shake
i made 2 hours
it says 2 hours
ik
node-schedule
But have you waited 2 hours?
USE NODE SCHEDULE
@pure lion no
๐
@opal plank do have to install that?
Lmao
make a new date when command is issued and then add 2h onto it
@pure lion no issue i just want the code
nd test it
Pay me money
no spoonfeeding
And I'll write something for you

Pay me money
@pure lion may be
spoonfeed moment
@weak rain #rules-and-info 7.a
lol
Why
why
You say you aren't a "beggenner" yet you don't use a db
how can i do that with db
You don't
that it creates
why would you need a db for a schedule?
^
every time a new variable
why u dont use db

i k
but the thing is how can i create each time when the reminder is set
that it creates a variable with the server id and the time
but
is it persistent?
unless its 6h+, then incase the bot goes down i keep the timestamps loaded
does it works for many server?
yes
e
and this is interval?
just set a date from 2h of when someone typed the command
how can i set the date?
create a new Date and then add number of seconds
and where should it be saved
or ms
it dont get saved mate
thats the whole point
unless you are messing with big dates you dont need a database
i do it only for 6h or more reminders
when the bot goes down it loses all those values
but because you only want 2h, its fine
@scenic kelp beat halyx yet?
but because you only want 2h, its fine
@opal plank and it works seperate , when i remind in 20 server , it will not mix the data
Dude
Just say what the damn issue is and stop crying
okay
i was confused
becuase i did not
see the upper message
u have setted the reminder 2 times
But it's not capped at 2
^^
It's probably somewhere around 4 billion
as many as you'd like
i should be coding rn tbh
i still havent added my chat parsers
they removed twitch emotes from discord, right?
no prob
๐
thanks @Dice(disableMentions = true)#2213
do u have the verified dev badge?
not yet
i might just go advertise the fuck out of my bot just to get done with it
Lmao
dont wanna deal with verification down the line
Mood tbh, it's gonna blow up big
shedule means
@tired panther try to read the docs
cocs ๐
hehehe
Yeah we are
someone motivate me for the love of god
im chained to this channel giving support
ty, i needed that
how do i get hour , date .......
Okay looking at the screenshot
Date.now()
a
new Date().getFullYear()
I think
Unless that's the decapricated one
Like, make a channel named announcements?
just use moment
partner
Oh
dev thingi
Devvy thingy-y
Bruj
you get it from dev thing or become partner
Dev thing?
How can I fixed it??
or his host ^
a
The what
How the hecking hecc
bye
Lmao
But how
wdym?
make websocket connection and start sending heartbeats
by coding
djs12: quite new to arguments, how do I replace the commas that separate words
Oh
Use .split?
@robust arrow join with ' '
*has read it like 7000 times*
Aw :c
its too hard to support all endpoints
Oh
and the code isnt very modular :(
a h
and voice
if(command === 'remind'){
var schedule = require('node-schedule');
var date = new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), 10);
var j = schedule.scheduleJob(date, function(){
message.channel.send("test");
});
}
will it remind after ten seonds?
what should be changed?
use a setTimeout
setTimeout(() => {
message.channel.send('its been 10 seconds');
}, 10000);```
setTimeout(func, timeout)
use moment then
if(command === 'remind'){
var schedule = require('node-schedule');
var date = new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), 10);
var j = schedule.scheduleJob(date, function(){
message.channel.send("test");
});
}
@tired panther
node schedule also probaly works tho
ping ๐ฌ
why repost?
that erwin
hmm
can see he helped me
no var
then wht??
How do I make my math/fast command only have 1 running at a time?
USE STROOPLEJS
if you dislike date manipulation, use moment
hi
if(command === 'remind'){
var schedule = require('node-schedule');
const date = new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), 10);
const j = schedule.scheduleJob(date, function(){
message.channel.send("test");
});
}
so?
so what?
moment is quite large though
pls i have to feed kids jeremy
indeed
@misty sigil probably some form of queue
^
yes
jeremy u making a math command?
tf
anyhow, back to chat parsing
jeremy u making a math command?
@digital ibex yea
so what?
@opal plank u said to use const
or let
and it doest not work
no
it should remind after 10 seconds
a math command
@misty sigil use https://npmjs.com/package/strooplejs, very lightweight !
calculator
why you doing all that?
but it does nothing.
just add 10 seconds onto the date
not a calculator
whats a math command then
this whole thing is uneceesary
lol
fast math
yeah no shit
huh
: /
im telling you doing all that other stuff is completely uncessary
that was the place for seconds
so
new Date.now() + secs
fast command?
give me an example
just Date.now()
whoever counts faster wins
you get time
- 10000
like 15 seconds
data manipulation can get messy
Meister what are u trying to make
why
WTF
or how
or how should it be?
im so confused rn
get now() date and then manipulate it
dont make a date with whatever the fuck that was
what are u trying to make @tired panther
it is a reminder
wtf??
const date = new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), 10);
date.now() and then add the desired timer
dont do that
you cant declare a variable using the same variable
what in god's name is that
his code
wtf
thats literally what im seeing
that is so cringe
how are you still alive
begin
@pale vessel idk ask god
ye wtf
@pure lion i shame you for letting them ping me 
lmao
we are using node schedule
and then we want that when u run the command . it will remind u after 10 seconds @placid hazel
@PlotTwitsItsActuallyNotErwin
@pure lion he sent this
that is a test
why not just schedule.scheduleJob(Date.now() + 10000, () => {});
thaths literally what i was saying
Why do you even need to be using that shit
You cant use the same fucking word as a value while valuating it in a constructor WTF
are u stupid
yeah i am
Secksy
or ms
more like secs in millisecs
i see
secs in millisecs?
what
wait oops
js uses milliseconds in everything
Why do you even need to use any packages
bruh, you are one confused mofo
@opal plank exactly
this whole chat you just been confused all over the place
Just set timeout for 10000 ms when the command is run
Ok
there are plenty of ways to accomplish what he wants to do
Listen to the green Bois and officiallylost
but its just filled with stupidity ..
setTimeout function, can do a promise with a timeout too, could use node scheduler, there are plenty of options
you cant define a value when defining the value
i have made an AI chatbot lol
okay
ok
node scheduler in my opinion is the less troublesome one
since you just slap the date and the function
@robust plume my friend made Alexa bot
a = a;
console.log(a) //a
a = b;
console.log(a) //b
cool
how can i get my bot onto the website?
submit an app
new Promise((res) => setTimeout(res => {
//say hi
}, ms));
schedule.scheduleJob(date(), function () {
//say hi
});
setInterval(function () {
//say hi
}, 300000);
those are 3 methods you can use for shecule
there are plenty others you can do aswell
pick whichever you are more comfortable with
indeed
he's struggling in vain tbh, all those are thoroughly explained over in the docs
it does
thats why i said he can do whichever he prefers
if he wants a reminder every 2h, use that
if he wants a reminder in 2h ONLY ONCE, do shceule or timeout
there are other stuff he can do aswell
anyhow, back to chat parsing
if(command === 'remind'){
const schedule = require('node-schedule');
schedule.scheduleJob(Date.now() + 10, () => {
message.channel.send("test");
});
}
``` what have i done here wrong?
vs code
is showing an error
- 10000? its in ms
why the unnecessary module
^^^^^^^^^^^
same
the same error
Not jeremy sorry I'm tired rn
oh, right
noterwin told to use shedule
Stop trolling and use setTimeout
schedule
Don't
but it does not work when i set it for 2 hours ๐ญ
nice status
really ๐
no
:l
Nice omghowunnecessary
hmm, @restive furnace sry for cold ping. quick question tho, is ur library public or r u still doing it?
l.eval client.twitch.emit({gateway: 1, type: config, once:true}).then(client.db.set(config.connected = true))
?
i need to stop alt tabbing
and checking where the heck my chat is -.-
i got canary and ptb open, working on canary with alt, alt tabbed thinking it was canary and just sent command

howwouldibeabletopicktheamountofshardsiwant
hmm, @restive furnace sry for cold ping. quick question tho, is ur library public or r u still doing it?
@digital ibex private, and im very slowly doing it.
ook
gaus
Well "yes", but actually no.
so i have a website with port 3000
how do i make it so i can connect without the port at the end of the URL
make it 80 or 443 (SSL)
@misty sigil get the router to forward port 80 to port 3000 in your system
^^^^^^^^^^^
@pure lion
u also got role
flaz's solution seems simpler
that is true
but if you have it on port 80 then that means you have to have it as root
and that isnt really very secure
but that may or may not matter
im not accepting user input of any kind
i didnt think i was until i couldnt log into my raspberry pi XD
you got the order reverse
Whodafukpingedme
@pure lion 
:<
ptb?
A what
PTB
Enlighten me then go back to the twitch bot stuff
discord instance
Oh
stabe/canary/ptb
O h h h h
bruh its been 2h and i havent done anything
just created a couple tables on PG and added some relations
thats it
both of which takes 5 minutes to do
Discord mobile
google play store i assume
Not da Google play release
doesnt DDevs have their own thing too?
Oh I'm there
DDevs is just shortened
same for when i say Dapi
rather than Unofficial Discord Api
I swear there was a channel somewhere with APKs
i kow
i was looking for that
there were updates somewhere
though i cant recall where
So annoying
dont they have a beta branch on google play?
so im doing a music play command with shoukaku, and here is how it works: js normal code checking args trying to find a track if there is a server queue { add track to server queue return; } else { create server queue }I just dont know where i should put the code to start a track and handle loop/errors
any suggestion?
prevent what?
basic js
ok i got it
Why my bot is not here? It was accepted
do u mean this
var obj = JSON.parse('{ "name":"John", "age":30, "city":"New York"}');
Why my bot is not here? It was accepted
@worn zephyr whats it's id?
713411071997640745
I'm trying to make a new command handler, and I need it to be able to look through subfolders, so commands/subfolder/subfolderfiles/subfolder2/subfolderfiles type of deal, and I am unsure how to do this. If anyone can help that would be much appreciated.
Using discord.js v 12.2.0
anyone know how i can fix this error? js error: 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode ?
im using deno with javascript
no idea how i can disable strict mode
code?
export interface test { name: String }
Is there an existing bot that can echo user posts from one server to another? (Networking essentially. We had bots that could do this on IRC.)
What is the best location for a Discord bot VPS for europe users ?
Iirc discord only has one text server
If your doing text only with your bot, closest to that server is best
okay, i fxed it...
and now im getting this error.. error: Uncaught SyntaxError: The requested module '../structures/client.js' does not provide an export named 'Client'
and i hvae given it Client
export default Client;
Client is a class btw
@earnest phoenix It would be anywhere in europe, but I recommend IcedHostLLC for hosting, they use Discord Bot containers and have great locations and a great team to help. A lot cheaper than a VPS too if you ask me.
๐ค
Isn't the discord text servers in the US?
That means the bot sends the text data to the US then back to Europe
They have servers racked up in the EU for their containers.
Discord does?
Ah I was close
So they have more than one.
Okay.
Or well, their text servers are based in one location
IcedHost does make it easy though, since it sends it back and forth easily between locations.
I thought it was new York, which is why my bots are hosted in New york
Generally more expensive tho
I have a container for 5 bucks a month since upgrading it.
Any ideas?
Using default is about 2 bucks a month, with 5gb storage and 200mb of ram.
With 3 bucks you can use 1gb of ram
^
But any ideas?
Again its a container not a VPS.
Whatโs the diff
You could fit 4 of those containers in that vps
When running npm rebuild
screenshots are native to windows btw
wdym
Mom get the camera
ig
I'm on discord
either snipping tools(which is built in windows) or download sharex
Iโm running Mac so Iโll just cmd shift 4
also works
How can i install quick.db to windows?
npm i nameofpackage
What do they mean exactly with How often do you refresh YouTube API Data?
oh that was for me
npm i nameofpackage
@empty owl are you serious? I really know this already.
anyone here know about express-subdomain
seems simple enough
the subdomain just redirects to the main page
are you using one router?
yea
the main page, and the subdomain i think need to be on their own routers
so i create a seperate router
yeah, i think thats what this section is
https://www.npmjs.com/package/express-subdomain#divide-and-conquer
the thing is
earlier it says you use app.listen for main
and router.listen for subdomains
as shown here https://jeremy-clarkson.is-inside.me/KjLTO3JR.png
express boilerplate code just means normal express
but it says code examples below go here
I need help with my command handler, I wanna remake it so I can use files that are in subfolders, so in the commands folder I have more folders for commands with a specific purpose, and I need help doing this if someone doesn't mind helping out.
thus making app.get the main domain
i mean i guess you can do it that way
the using two separate routers makes more sense to me
wonderfull xd
lmao
nice cropping
My god yes the api docs are broken, layout wise
????.?.
It loads, but the layout is broken
its fine

I can click on the links just fine, they work. But yeah, the design/layout ๐
Disabling adblock and uBlockOrigin does not help
How can I make my bot background green , I mean when someone join my bot page on top.gg the background to be green
css
background: green
yeah, that sets the body background to green
Didnt worked @solemn latch
-api
alr
@solemn latch Can u suggest some good and cheap VPS which give remote access
Digital Ocean
i use galaxygate, i like it
Galaxy Gate
DO is a good option too
ok
bit more well known, but costs a bit more
ok
no
Oxide hosting is my VPS
digital ocean can give you a vps with preinstalled node.js idk if galaxy does it too
Are they Linux or windows
Linux
windows vps's cost more
ok
let me know if u go for oxide @delicate shore cuz then i can give u the server link
but not more than 10$/month
galaxygate offers windows if you buy the 4GB plan
DO 1CPU /1GB Ram 5$/Month
I want to do like this
let me know if u go for oxide @delicate shore cuz then i can give u the server link
@misty sigil i will not see this month as glitch already made auto payment for second month so
https://oxide.host/virtual-servers-windows oxide do windows vps
next month
but i recommend their linux vps
because its cheaper
and they will support you a lot in using it
Windows VPS are usually 50-80% more expensive
(this is actually from experience btw)
alr
ok
i will keep in mind
ABCDEFGJIJKLMNOP
I am doing so i can just type this in search bar
and get name of all the vps when i want
theres a pin with some suggestions aswell
as many as you want usually
ooo
^
glitch is dumb overpriced
they need to pay somehow the free stuff
thanks for advice
everyone
i might go for DO
not sure tho
and what do u think minimum req should be for my bot?
ram?
ye
1GB is fine
ok
if your moving from glitch, youll have more resources
for a small bot
and processor
even with the smallest plan
for a small bot
@earnest phoenix how you define it
even with the smallest plan
@solemn latch alr but it will take take some time
Dank memer also uses DO
what is do
the 5$ plan from DO will get you pretty far if you optimize the bot for low ram usage
cool
the 5$ plan from DO will get you pretty far if you optimize the bot for low ram usage
@lusty quest i don't thnk that low ram is suitable for me as my bot usally crashes because i get less ram in glitch
you get 1GB
u said low
if you optimize the bot for low Ram usage you can probably get 1k - 1500 guilds with the DO 5$ plan
you get 2gb of ram
for less than do
on oxide
atleast i think ยฃ3.59 is less than $5
4,63$ ~ 3,59ยฃ
for me its cheaper to go for the $ pricing bcs 1โฌ ~ 1,05$ or something like this. used to be 1,10$ per 1โฌ
ohh lol 1โฌ is now 1,18$
having some trouble with embeds, not really good at them, (node:15664) UnhandledPromiseRejectionWarning: ReferenceError: MessageEmbed is not defined
I know something is wrong here, but not really sure what exactly, just need some help on whats the wrong thing and I'll try to fix it, (give me a sec, getting screenshot
Discord.MessageEmbed
Though I recommend using an object imo
{embed:{...}}
the message embed class is cursed
lol
if you dont want to require all of discord, you can also just require MessageEmbed
const { MessageEmbed } = require('discord.js')
discord.js V11 or V12?
uh, i forgot, how do I check?
package.json
you can see it in your package.json
v12
then it should be Valid
probably something i did, im checking it over
so like, if im trying to dm somebody an embed using a cmd, how would i send it?
i tried this:
message.mention.send(pEmbed);
I don't really understand embeds
yeah
message.mentions.users.first().send()
but make sure that you should take some stuff into account
like if you relay messages add the message author to it
ok
Brju
org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
DiscordBotListAPI api = new DiscordBotListAPI.Builder()
.token("token")
.botId("493066387183632387")
.build();```
you seem to be using a lib, which means the python code will look entirely different, and will need to rewrite it entirely
what do you not know how to do in python thats happening here?
youll likly want to look over the libs code, and then replicate it in python.
https://github.com/samcday/node-stream-buffer/tree/master/lib
or look for a python lib that does the same(if one exists already)
hi
anyone know im getting this error: error: Uncaught SyntaxError: The requested module '../structures/client.js' does not provide an export named 'Client' ?
the code is just:
class Client extends EventEmitter {
}
export default Client;
using deno btw
???
yes?
...
what source code?
ok
lemme get it
class Client extends EventEmitter {
}
export default Client;```
there
im confused
yes
event emitter?
thats what it is
import EventEmitter from 'https://deno.land/std@0.51.0/node/events.ts';
TypeScript?
Oh got it
deno uses ES6 module, and the way you require somehting in node is the NPM package name, the way you "require" something with deno, is through https://deno.land
unorganically grown application, what does it mean ?
@opal plank ....
.
.
.
.
.
.
.
A while.
@pure lion pong
@opal plank pond
Guys... Is there a list or an array of JavaScript code that i can use for my JavaScript quiz command anywhere? I wrote 30 JavaScript code question but i need a lot more
There's probably some kahoot stuff somewhere
what exactly are you trying to do?
just map those values and call them as needed
or build object with all of them
{
question:awnser,
question1:awnser1,
...
}
Maybe
There's
A
Use the w3schools website
There's probably some way you can scrape the quiz questions
@opal plank trying to create an object containing a question property which is the code for questioning and a answer property for the answer
I've done 30 objects in an array but i need a lot more tho
@opal plank come to testing-1
I mean that's not the issue, but i need a lot more code questions
you want more questions or how to execute code?
More questions
aaah, i see
a
then yeah, use w3schools or mozilla
What can i get from them tho
scroll thru their snippets, change the names of the variables and ask them the output
just scroll thru the left tab
choose a different topic
Hmm that would be good, i was gonna do that but i was asking if there was any ready array of questions
Anywhere
What does it mean when a role is hoisted?
im not aware of any unfortunately
maybe you can get codeacademy or something
those types of website do usually have quite a few tests
Well anyway imma have a look, thanks
*cries in bad at coding*
cries in havent done anything today
since when does tooltips show for channels?
@opal plank bruh always
i should prob not say that
*cries in hasn't done anything except hang out with my gf all day and not be productive at all*
oh hell yeah https://cdn.yxridev.com/u/yPMV6DAi.png
inb4 random crash
hopefully not
i need help with html who can help me if any1 know tag me pls

