#development
1 messages · Page 1192 of 1
how do i push something into a map?
You're running the debugger so now your code will stop at any breakpoints
@carmine summit did you google?
^
Cause I can guarantee its the first thing you will see
yes but i didnt understand

Do you know how maps work?
I am done
(node:10336) UnhandledPromiseRejectionWarning: Error [VOICE_CONNECTION_TIMEOUT]: Connection not established within 15 seconds.
at VoiceConnection.authenticateFailed (c:\Users\Owner\Desktop\discordjs2\node_modules\discord.js\src\client\voice\VoiceConnection.js:296:27)
at c:\Users\Owner\Desktop\discordjs2\node_modules\discord.js\src\client\voice\VoiceConnection.js:324:61
at Timeout.<anonymous> (c:\Users\Owner\Desktop\discordjs2\node_modules\discord.js\src\client\BaseClient.js:83:7)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
<node_internals>/internal/process/warning.js:32
only stuff I got
Yeah cause you stopped your code before the connection so it timed out
oh
It hit a breakpoint during the connection probably
After the connection or where you think/know things aren't working
pls help
UnhandledPromiseRejectionWarning: #<Object>
@carmine summit do you know how maps work
NO
{code: 403, message: 'The request cannot be completed because you …youtube/v3/getting-started#quota">quota</a>.', errors: Array(1)}
Then find out how maps work first before you do anything with them
Were not teachers. Were helpers
^^
i cannot understand google . com
Aki you're making progress so I'm sure you can slowly work things out. I recommend testing the debugger on a simple command so you know how it works. I'm going to have to go in a bit.
If you hover over values
It should display info
Now is when you can also watch that video
This will help too
You need to form a hypothesis
Test that hypothesis
And see if that helps you find your solution
For your problem
ummmm
what does this error mean?
(node:24036) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
happy new hour guys
@wheat mesa don't create a new handler for each command, instead put them all in one listener
Okay
I'm trying to convert window.parent.purchaseItem(type, item, cost);
to window.postMessage
instead of window.parent.* i guess
but apparently i have to also use an event listener?
{
code: 403,
message: 'The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.',
errors: [
{
message: 'The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.',
domain: 'youtube.quota',
reason: 'quotaExceeded'
}
]
}
do I have to make a new api key then?>
Yes or wait for the quota to reset
can anyone send me python bot, docs?
i want to read something
I can't find proper docs
@topaz fjord
did that
now im gettin
{
code: 400,
message: 'API key expired. Please renew the API key.',
errors: [
{
message: 'API key expired. Please renew the API key.',
domain: 'global',
reason: 'badRequest'
}
],
status: 'INVALID_ARGUMENT'
}
Get a new token
I did
and got this again
{
code: 403,
message: 'The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.',
errors: [
{
message: 'The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.',
domain: 'youtube.quota',
reason: 'quotaExceeded'
}
]
}
You're being rate limited
It basically means you made too many calls to the API, and you're being blocked for a certain amount of time
Since it says quota, I'm assuming you can only make a certain amount of calls during a certain period of time
So be careful to space it out I guess, not much you can do
Idk maybe. That'd be something to Google
the (official) youtube api sucks ass
does anyone know how to get an activity on ur bot, mine keeps getting loads of errors.?
recheck your syntax
the error is complaining about a missing parenthesis
you can use google to find out what the respective terms are
const cooldown = new Set();
cooldown.add(message.author.tag);
setTimeout(() => {
cooldown.delete(message.author.tag);
}, 5000);
how can i see how much time is left before leaving the set?
it wont let me send code
hey guys what is the code that like
you can't directly @hazy sparrow
wdymmmmm
@calm junco
a solution at the top of my head is to just grab the current date and store it somewhere alongside the timeout object that's returned from setTimeout(), from there on you can calculate how much time is left; cc: bow pro
@clever vector which lib
can someone tell me how to add watching status
im new to making bots and stuff so i will not understand anything u say
can someone tell me how to add watching status
@calm junco https://discord.js.org/#/docs/main/stable/class/ClientUser?scrollTo=setPresence
"new to bots" is not an excuse for not knowing the language you're working with
there are plethora of resources online
if you don't know a specific term, google it, it's there for a reason
i told you what they are and how to fix them
you can't directly @hazy sparrow
@earnest phoenix then how
if you had listened to me you would've already fixed it
i did
i told you how @hazy sparrow, read a bit down
but idk what u meannn
oki
if you don't know a specific term, google it, it's there for a reason
@earnest phoenix
i cannot explain CS basics to you
teams?
...the ones you don't know
i dont know anh
i told you exactly what to do and why the error is happening
if it's missing, what would be the logical thing to do?
@earnest phoenix but
codecademy
@torn ravine ?
tell me again plss
scroll up
👁️ 👄 👁️
?
if it's missing, what would be the logical thing to do?
Do the thing
every 3 hours it is 10,000
@solemn leaf this is a lavalink error right
if it's missing, what would be the logical thing to do?
@earnest phoenix but what do i put there
and were
the thing that it is missing
you’re going to know how to easily rotate ipv6’s on the fly
AHH THIS SO CONFUSING
lavalink doesn't use the official api, @torn ravine
How does that work?
lavalink uses the private api that's exposed to browsers when you go to youtube.com via massive amounts of reverse engineering and scraping
@calm junco i suggest you take a course on your programming language; you should learn at least the basics before getting into bot development
you can’t really program without prior knowledge
you need to know the basics to "test it"
its bcs Im maxed
i have coded a custom avtivity status before but now it shows 3 errors
and you not knowing how to fix it is a huge red flag that's screaming you should learn the language
it seems like your problem is a syntax error
anyway most courses cost money and my dad isnt gonna pay money for a course :(
means there’s a typo
a lot of courses online are paid, a lot of them are free
maybe if you tell him that you want to learn something useful, He’ll understand
So i been trying to make a botton like the image i am showing butnl idk how i know hownto make a botton but not one like this can you help me
codecademy
style it with css @pulsar forge
How
using the html style tag
codecademy
@torn ravine ?
Im still learning were is that
found some resources
its a website
what are you confused on?
is discord.js javascript orr..
using the html style tag
@earnest phoenix were is that
discord.js is an api wrapper that is written in javascript
or w3schools
@clever vector which lib
@earnest phoenix discord.js
you can get to ClientUser from this prop https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=user
everyone keeps asking that lol
oop
are u using discord.js
Yes
You want more then one status @sand skiff?
wdym
More status. Random
i want a watching status
Wrong @
??
I @ the wrong person.
um
anyone know what this means
State changed from down to starting
2020-08-27T04:28:16.000000+00:00 app[api]: Build succeeded
2020-08-27T04:28:19.055345+00:00 heroku[worker.1]: Starting process with command `node index.js`
2020-08-27T04:28:19.786655+00:00 heroku[worker.1]: State changed from starting to up
2020-08-27T04:28:19.798526+00:00 heroku[worker.1]: Idling
2020-08-27T04:28:19.800454+00:00 heroku[worker.1]: State changed from up to down
2020-08-27T04:28:19.809648+00:00 heroku[worker.1]: Idling because quota is exhausted
2020-08-27T04:28:22.351356+00:00 heroku[worker.1]: Stopping all processes with SIGTERM
2020-08-27T04:28:22.474174+00:00 heroku[worker.1]: Process exited with status 143```
wdymm vale
You want more then one status @sand skiff?
@fringe axle no just one
Okay
State changed from down to starting
2020-08-27T04:28:16.000000+00:00 app[api]: Build succeeded
2020-08-27T04:28:19.055345+00:00 heroku[worker.1]: Starting process with command `node index.js`
2020-08-27T04:28:19.786655+00:00 heroku[worker.1]: State changed from starting to up
2020-08-27T04:28:19.798526+00:00 heroku[worker.1]: Idling
2020-08-27T04:28:19.800454+00:00 heroku[worker.1]: State changed from up to down
2020-08-27T04:28:19.809648+00:00 heroku[worker.1]: Idling because quota is exhausted
2020-08-27T04:28:22.351356+00:00 heroku[worker.1]: Stopping all processes with SIGTERM
2020-08-27T04:28:22.474174+00:00 heroku[worker.1]: Process exited with status 143```
@sharp thicket anyone any help?
now im getting
2020-08-27T04:31:12.307660+00:00 app[worker.1]: Error waiting for network: Resource temporarily unavailable```
Network error
did i break something??
I don‘t use Heroku
i was sleeping so most likely not
So?
its fine if you just remove the playing part
Yea, but if you want that he‘s listening you can change it
client.user.setActivity(`-help`)```
ik
anyone know how to fix this tho
2020-08-27T04:33:26.000000+00:00 app[api]: Build succeeded
2020-08-27T04:33:27.502366+00:00 heroku[worker.1]: Starting process with command `node index.js`
2020-08-27T04:33:28.265496+00:00 heroku[worker.1]: State changed from starting to up
2020-08-27T04:33:28.275726+00:00 heroku[worker.1]: Idling
2020-08-27T04:33:28.277540+00:00 heroku[worker.1]: State changed from up to down
2020-08-27T04:33:28.286585+00:00 heroku[worker.1]: Idling because quota is exhausted
2020-08-27T04:33:34.530371+00:00 app[worker.1]: Error waiting for network: Resource temporarily unavailable```
const Discord = require("discord.js");
module.exports = {
config: {
name: 'spotify',
category: "fun",
noalias: "No Aliases",
description: "shows stats of the person listening",
usage: "[no mention | mention (optional)]",
accessableby: 'everyone'
},
run: async (bot, message, args) => {
let user = message.mentions.users.first() || message.author;
if (user.presence.activities !== null && user.presence.activities.find(a => a.type === "LISTENING") && user.presence.activities.name === 'Spotify' && user.presence.activities.assets !== null) {
let trackIMG = `https://i.scdn.co/image/${user.presence.activities.assets.largeImage.slice(8)}`;
let trackURL = `https://open.spotify.com/track/${user.presence.activities.syncID}`;
let trackName = user.presence.activities.details;
let trackAuthor = user.presence.activities.state;
let trackAlbum = user.presence.activities.assets.largeText;
message.channel.send(embed);
} else {
message.channel.send('**This user isn\'t listening to Spotify!**');
}
}
}
}
module.exports.help = {
name: "spotify"
}
why doesnt this send a msg
const embed = new Discord.MessageEmbed()
.setAuthor('Spotify Track Info', 'https://cdn.discordapp.com/emojis/653135129870336031.png?v=1')
.setColor("GREEN")
.setThumbnail(trackIMG)
.addFields(
{ name: 'Song Name', value: trackName, inline: true },
{ name: 'Album', value: trackAlbum, inline: true },
{ name: 'Author', value: trackAuthor, inline: false },
{ name: 'Listen to Track', value: `${trackURL}`, inline: false }
)
.setFooter(message.member.displayName, message.author.displayAvatarURL())
.setTimestamp()
how to cut out the embed so I could send
What the fuck is this
okay now I got it to kinda work
Hello
how to get bot self join to guild event? (if bot invited to guild - function () )
?
hm
How to make autoleave code
what u mean?
let trackIMG = `https://i.scdn.co/image/${user.user.presence.activities.assets.largeImage.slice(8)}`;
let trackURL = `https://open.spotify.com/track/${user.user.presence.activities.syncID}`;
let trackName = user.user.presence.activities.details;
let trackAuthor = user.user.presence.activities.state;
let trackAlbum = user.user.presence.activities.assets.largeText;
can someone help with spotify command
Cannot read property 'largeImage' of undefined
its array now
just buy a vps
@crystal socket um you know most devs are broke students and the sickness thats going around at this time e.e
presence#activities is an array @solemn leaf
yeah not the ideal time to spend money on a vps 
and you know that most vps cost less than 3$/month?
ik
user.user.presence.activities.assets=undefined @solemn leaf :/
wait
just host on heroku its that easy
what do I fix
so
presence.activities is an array
presence.activities[0]
yes
spot @inner idol
bot commands don't work in here
its self-bot
only in #commands and #265156322012561408
and it dying :(
can you ping it?
can you mention the bot?
song name is detail
yes so can you @mention it?
soo
activities[0].details
its on my token -.-
yeah
song name
ping
but he dont listen this guild, wtf
right
um you know most devs are broke students and the sickness thats going around at this time e.e
@sharp thicket r/technicallythetruththateveryonehates
yes
with like here
mask it
how
that's how you mask links in markdown
ping
and also in embeds
markdown
you can't mask links in normal messages tho
what u mean?
@spare gale that the bot will automatically leave servers with x members (as seted)
```[text]`${trackURL}````
my discord.js status code keeps gettings errors and someone said abbout syntax, so i took a free course and i saw the word in it?
@spare gale that the bot will automatically leave servers with x members (as seted)
@weak rain api abuse
@weak rain api abuse
@earnest phoenix why
@earnest phoenix
for people who have small servers
kk
[text]${trackURL}
will my bot decline if i have this feature
no
Ughh, this guy says u have to put 'node .' to make the bot go online in CMD prompt, and when i do that, it doesnt go online, wtf
that's not how it works
Ye ik @earnest phoenix
did you cd into it @earnest phoenix
[text]
`[hey](${link must be in ()})`
did you cd into it @earnest phoenix
@crystal socket is it supposed to have cd? he never said
link must be in ()
@WetBaxis it supposed to have cd? he never said
@earnest phoenix, 🤦♂️
that's unfair tho
ping
but my bot is added in small servers and its irritating
thats technically unfair too
ping
that not check this guild :(
I mean
oh i thought this man was wanting to leave larger servers
more servers isn't a bad thing
and i can add it in big servers though
that not check this guild :(
@spare gale, which guild then?
i put cd in it like "cd node ."
thunder
ping
oh i thought this man was wanting to leave larger servers
@thick gull Lmao
hm
and i can add it in big servers though
@weak rain we won't help then if you do unfair stuff
look at a better guide
@weak rain we won't help then if you do unfair stuff
@earnest phoenix oh sorry
pretty sure you can't leave a servwr on your own
cause its kinda hard to write-up
in bot form
thats not how it works
Im new to making discord bots, and new to coding all together, so yeah, just tell me how it workds
then i will not do that
of course don't
a majority of traffic to bots isn't from big servers so it'll probably hurt growth
Im new to making discord bots, and new to coding all together, so yeah, just tell me how it workds
@earnest phoenix, well you have to cd into the folder's path which has your code
so you do cd [yourbotspath] node .
https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=leave
@earnest phoenix @weak rain
lmao
if you want to leave
so you do
cd [yourbotspath] node .
@crystal socket so the folder the bot is in
why are people so angry
yeah
ok

why are people so angry
@topaz fjord you're indirectly making him get closer to adding that feature
I'm telling him not to?
the command prompt system said it could not be specified
i'm literally just helping
he said he wanted to leave small servers?
a majority of traffic to bots isn't from big servers so it'll probably hurt growth
@earnest phoenix screenshot
yes leaving small servers will hurt growth
alright let's stop cuz I'm gonna eat brekfust
that's what it meant
man
how to get bot self-join to guild event? (if bot joined to server - function () )
self-join????
self-join????
Bot - Example
Example invited to guild
Event activated
yes
this should have done it https://i.imgur.com/GGKEiGj.png
@earnest phoenix you were just supposed to cd to the folder ans type node . not smth else
you use that event
@earnest phoenix say your bot is here: C:/users/Daniel Sweetin/Desktop/DiscordBot , you would ONLY run node .
hmmm
and last
how to join guild by invite url? (discord.js)
i ran it like: cd main.js (folder) node .
and i've tried just node . as well
i dont think that top one works

and last
how to join guild by invite url? (discord.js)
@spare gale do you mean someone sends the bot like <discord.gg/dbl> and the bot joins?
cd path && node . works tho
or when it joins you get an invite
cd (folder) node .
or
cd path && node .works tho
@restive furnace
huhhh?
xD
bruv, it won't let me put new lines in command prompt, wdym ;-;
just use my method then 🤷
thats basic command line by the way
how can I get the length of the spotify song
you can't do that, someone with manage_server needs to add it with the bot's link
@thick gull
my project have 3 bots, 1 core bot and 2 fun/admin bots
core bot joining guild and inviting last 2
you can't do that
When i put
cd (folder)
(next line)
node .
all it does is give me a long ass paragraph
you need the person who invited it to invite it
bot can?
invite other bot
but bots cant add bots
hmm
@solemn leaf dont tell people to googlethings:)
Thanks!!
your right @thick gull you google them yourself then give them the link
and take all the credit
i got in trouble for sending a lmgtfy/telling people to google it
Ughhh
lmgtfy??
how can I get the length of a spotify song
For all those people who find it more convenient to bother you with their question rather than search it for themselves.
@real nacelle
thats what it is
this isn't #development related anymore though so yeah
lol k
uhhhghhhhh
what's the difference between lmgtfy and google?
.).
-_-'
@earnest phoenix what was that paragraph you were talking about
making a bot isn't easy
and this is the easiest part ...
How do i make bot go online with command prompt?
@thick gull so you sent them this lmao https://lmgtfy.com/?q=python+docs&pp=1
For all those people who find it more convenient to bother you with their question rather than search it for themselves.
How do i make bot go online with command prompt?
@earnest phoenix you said you got a paragraph when you didnode .what did it say??
I did
i didnt send them that
Oh, that long ass paragraph disappeared
its when i did
cd (folder)
(next line)
``node .`
well then your bot should be online
It isnt
as soon as you do node . your bot should be online as long as the cmd remains open
it doesnt work, m8
¯_(ツ)_/¯
can you send a screenshot?
How can i prove that it doesnt work?
bruv.
i dont know what you're seeing
i dont know if you're even on the right location in prompt
I can invite u to my server, and stream me putting the stuff in
But like, i cant send a screenshot of my bot being offline
thats an error with your code
When you spend half your day's internet to download Unity only to realize they removed JavaScript
Well, wtf is it
OHHH, now i know why it doesnt work

you don't even know how to run stuff in node.js and you're trying to make a bot
i deleted the folder in Visual Studio
so you dont have discord.js installed?
its fun to see code say "learn javascript"
I'm a new coder, and new bot developer, u whore, LMAOO, don't be so rude, mate
coding app? pls not on the phone
const discord = require('discord.js')
const client = new discord.Client()
iirc
coding on the phone is quite the sin
Yeah, thats in visual studio folder
@lament meteor ? ? ?
t+ t- t! t. t/ t~
lad hoes are mad
tbf imma steal lad for a prefix
xD, aight
lad pls save me the devils are chasing
bruv
LAD
whats the name of ur bot
its called island lol
i!
t+ t- t! t. t/ t~
literally anything
just please not something common
cool
it's called island?
yes
Yeah
iamstupid
My bot's prefix is gonna be "k!" since its name starts with a k
also @earnest phoenix i suggest learning a bit more basic js then proceeding to bot development... it will help quite a bit in the future
any letter and a ! is common asf
and if ur lazy... learn how to read documentation
i read documentation 
documentation is my bible
is o a good prefix
anything is a good prefix
that is the web javascript docs but it works for both rlly just some stuff arent in node
also @earnest phoenix i suggest learning a bit more basic js then proceeding to bot development... it will help quite a bit in the future
Well, i don't know where to learn that stuff, and besides, i can watch tutorials, and learn how to start it
its what ive been doing with making games on roblox (don't judge its where i started scripting/coding)
i wont judge lmao i started with makin mc command blocks(not rlly the same but its kinda the same concept)
I've done 5 tutorials on scripting for roblox, now i know the basics, and upper
the issue i have with tutorials is they might not be up to date and spoon feeding might be a bit too real
learning to read documentation, tutorials on the basics will be sufficient
Ah, well, making a bot for discord is small as crap when it comes to my goal
bruv.
i wont judge lmao i started with makin mc command blocks(not rlly the same but its kinda the same concept)
@lament meteor haha i started with roblox lua , html , and mc command blocks
probably usin their rich presence?
mc cmd blocks is probs harder than dbots
it is
the limitations are real
html is not a programming language
shut
lua isnt roblox
mc cmd blocks is probs harder than dbots
I'd agree on that, ngl
just roblox uses lua
lua C is roblox
I've started learning Java, Json, Python, Lua, and unity
unity is not a programming language?
@lament meteor so what
unity uses c#
It isn't, not really
unity isnt a lang
idk how does rich presence show up?
so what do I do to get where yeah are
atleast they're making it easier for datapack devs now @lament meteor
@lament meteor
you can now make custom dimensions which is pog
meh datapacks are still kinda shit... u cant customize player data yet
this is what Im doing for other stuff
let trackAlbum = user.user.presence.activities[0].assets.largeText;
yeah
I've started making games on roblox, and started making discord bots, (still doing and is in development) and ive started making maps for minecraft,
i'm also trying to learn every coding lang
JSON.stringify it
how to use Guild.create event
In discord.js how would I take an object from a message? Ex:
!embed {"title":"ha"}
Please mention me in the response if anyone responds thanks
and psuedo code?
bruv.
and -?
then minus the two it returns the ms lenght of the song
this is why the basics are important when u are coding
let t1 = new Date(start).getTimestamp()
let t2 = new Date(end).getTimestamp()
let time = t1 - t2
start is not defined
cough
this?
let t1 = new Date(user.user.presence.activities[0].timestamps.start).getTimestamp()
let t2 = new Date(user.user.presence.activities[0].timestamps.end).getTimestamp()
probs
.getTimestamp
check documentation for the time thingy
its meant to be for gettin the ms time from jan 1991 or smthn
thats in ms 
I just removed .gettimestamp
i mean that works
smh
bippity boppity
@lament meteor I required ms
what now
but it said that gettimestamp isnt a thing
any moderation bot that mute when a certain user with x role is pinged?
const ms = require("ms")
lazy to makeit
@solemn leaf read the docs
¯_(ツ)_/¯
ermmmm how do i make it so my bot is different on each server? cause currently its transfering over variables that should only be accessible by the specific server...
why does your bot have server-specific commands
server specific variables
please elaborate?
so, when it saves variables part of the name it uses for the database incudes the server id, same with loading items from that database
i don't understand
i can't think of a case where it would be practical to have server specific commands
var pingname = message.guild.id + "|" + "pingrole";
thats one of the varaibles that later gets stored in a database. when loading it uses the same name
i can't think of a case where it would be practical to have server specific commands
@sonic lodge server specififc variables, not commands
so each server can have its own specific customizable prefix
make sure that you're grabbing the data of that server and not some other one
i am, as i said, part of the name it uses when storing is the actual server id
so unless 2 servers have the same id idk whats going on
if the data for one server is being used for another then there must be something wrong with the code that queries your database
what does that code look like?
i just realised the problem lol
so the database variables set code variables, but nothing resets those variables, so if one servers database says "blah" and the other server hasnt got a database yet, then it wouldnt work with the current system i have and would just use the preset variables
idk how to explain it, but basically i was being dumb
obviously not because you figured it out yourself
yes, you definately helped
is that sarcasm lmao
no but u actualy did
😎
if i didnt speak here i wouldnt have checked
is there an easy way to just make it so the entire script resets to deafault for every server 🤣
or do i just need server only database variables
for everything
from the way you described your solution it seems like that's already what happens?
yeah, i just wish there was a single command that just do it... eh welcome to discord
ah it works now :D
i think i might rewrite the entire bot soon just to neaten everything up and make it more compact
good luck with that
can someone please explain how module.exports work?
im still using everything in 1 file
i tried module.exports but the tutorial doc didnt explain how to add variables to the module export that exist in a file located before the command file
when you require a js file, the program executes the file, then returns module.exports
example
// ./module.js
module.exports = function() {
return 2;
}
// ./index.js
const m = require('./module.js'); // function
console.log(m()); // 2```
yeah... but lets say i have a variable only located in index, how would i get that variable on module exports?
you can export anything that you've declared in the file
so for example, 4 files:
botname/index.js
botname/variables.json < my set variables
botname/commands/moderation/kick.js
botname/(database file)
how would i get botname/commands/moderation/kick.js to access that database?
Sqlite
i use sequelize for connecting, but sqlite for storing
const sequelize = new Sequelize('database', 'user', 'password', {
host: 'localhost',
dialect: 'sqlite',
logging: false,
storage: 'database.sqlite',
});
const strvarsave = sequelize.define('strvarsave1', {
name: {
type: Sequelize.STRING,
unique: true,
},
description: Sequelize.STRING,
});```
interesting, i have no experience using sqlite
@solemn leaf compute the minutes and seconds yourself
im just curious how i would link it to a database thats in a file before the actual module
how
math
which math
the math that ships with each grade of school
let t1 = new Date(user.user.presence.activities[0].timestamps.start)
let t2 = new Date(user.user.presence.activities[0].timestamps.end)
use the actual time milisecond code and minus it from the millisecond duration of the song
@sonic lodge what math
callTime = (new Date()).getTime();
var timerinterval = setInterval(function(){
if(bumpcooldown===true){
var duration = 7200000-((new Date()).getTime() - callTime );
var milliseconds = parseInt((duration % 1000) / 100),
seconds = Math.floor((duration / 1000) % 60);
minutes = Math.floor((duration / (1000 * 60)) % 60);
hours = Math.floor((duration / (1000 * 60 * 60)) % 24);
hours = (hours < 10) ? "0" + hours : hours;
minutes = (minutes < 10) ? "0" + minutes : minutes;
seconds = (seconds < 10) ? "0" + seconds : seconds;
combined = "**`" + hours + "`** : **`" + minutes + "`** : **`" + seconds + "`**";
Thats what i use for my servers timer
wdym "what math"
(t2 - t1)/60
you start with milliseconds, and you need to get to minutes
7200000 is 2 hrs in millisecond, so just multiply ur time in seconds by 1k, or ur time in minutes by 60k
how do i make good bot
thank you
never passion
I will try that next time
u start with passion but lose it after the 500th error message
I haven't lost passion yet tho
ur lucky
whenever I get an error I come here and people help
thats why I love this server so much
same, but eventualy what u think is an "easy" bot turns out to be extremely hard
so far it can edit message, send embeds, generate random images and send stuff
basic stuff
(index.js code)
const sequelize = new Sequelize('database', 'user', 'password', {
host: 'localhost',
dialect: 'sqlite',
logging: false,
storage: 'database.sqlite',
});
const strvarsave = sequelize.define('strvarsave1', {
name: {
type: Sequelize.STRING,
unique: true,
},
description: Sequelize.STRING,
});
so for example, 4 files:
botname/index.js
botname/variables.json < my set variables
botname/commands/moderation/kick.js
botname/(database file)
how would i get botname/commands/moderation/kick.js to access that database?
so far it can edit message, send embeds, generate random images and send stuff
@mystic pike pls, how do u edit a message multiple times?
multiple .then s
i wanna edit an embed every 7.2 seconds
.then(edit message or something I cant remember what goes here)
.then(again)
Use set interval then
im doing that, but when i tried the .edits it stuffed up everything so decided id rather delete and resend than trouble shoot for a day... but now ive decided to deal with it
@sonic lodge
var minutes = Math.floor(time / 60);
var seconds = time - minutes * 60;
let timefull = `${minutes} Minutes ${seconds} Seconds.`
math?
math
math
.edits?
that correct math>?
time is what unit?
var timerbumpembed = {
color: embedtimercolor,
title: 'Time Till Bump Avaliable',
author: {
name: 'DisboardReminder',
icon_url: boticon,
url: topggsitelink
},
description: combined,
thumbnail: {
url: boticonmix,
},
fields: [
],
footer: {
icon_url: boticon,
text: "Watching for : dbr!help & !d bump"
},
};
client.channels.cache.get(channelping).send({embed: timerbumpembed});
what would i use to edit a message that sends that kind of embed?
Ew ew ew use the functions man its much easier
try it and see
time is probably not seconds, but milliseconds
lmao
If you collect the message
so to convert to seconds I do what
(index.js code)
const sequelize = new Sequelize('database', 'user', 'password', { host: 'localhost', dialect: 'sqlite', logging: false, storage: 'database.sqlite', }); const strvarsave = sequelize.define('strvarsave1', { name: { type: Sequelize.STRING, unique: true, }, description: Sequelize.STRING, });so for example, 4 files:
botname/index.js
botname/variables.json < my set variables
botname/commands/moderation/kick.js
botname/(database file)
how would i get botname/commands/moderation/kick.js to access that database?
how would i get botname/commands/moderation/kick.js to access botname/variables.json
@plush magnet this is the question im stuck on
try it and see
What database are you using?
Sqlite
Fkn hick
hey give me a break, i only started learning databses yesterday
congrats, onto multivariable calculus
Just use couch. Its much more user friendly and it gives and saves JSON. But that's up to you. Is it sqlite3?
Or just send me a link
No. Link for the database you're using
const sequelize = new Sequelize('database', 'user', 'password', {
host: 'localhost',
dialect: 'sqlite',
logging: false,
storage: 'database.sqlite',
});
const strvarsave = sequelize.define('strvarsave1', {
name: {
type: Sequelize.STRING,
unique: true,
},
description: Sequelize.STRING,
});
thats the code for it, creates and runs the database...
i dont have a link
@forest drift dms
hello i want a random number generator from 0 to 10 but so that 0 has an 80% chance of the rest as it comes (Discord Js)
Is sequelize the package name?
Discord js
Is sequelize the package name?
@plush magnet yes? i think
https://discordjs.guide/sequelize/#a-simple-tag-system I converted the tutorial for the tags to store the variables i needed
@plush magnet thanks
@forest drift I need to go now unfortunately but take a look at this database instead. Its much easier but that's up to you
Helo
I want to move the cursor so it's at the top of the box
Not sure how, so help me uwu
can you attach 2 files with the same filename to a single message?
What lib?
Can we make same bot but different VS Code?
Like my friend want to code the same bot with me
not on vps
sup
yes
https://alebot.is-inside.me/qoRcuKTK.png
@pure lion the little line?
Don't want (Bot me ) to get married from ( Discord.gg )
Hi
How are you@grave jay
@grave jay I good😁
😁
Haha
Xd
Yea

Ooo
Xd
Oh 😆
Xd
Maybe ask on stackoverflow or discord.gg/code @grave jay .
heyo
i have a variable
but if it once executed: (console.log or smth)
it like resets himself
and decided to go undefined
how do i fix it?
there's no way it resets itself, you must be setting it to null
no?
show your code
if (command == "timers") {
var sent = true
var first = true
setInterval(async function() {
if (minutes <= 0 || first == true) {
first = false
console.log('searching')
var getMagma = async () => {
var response = await axios.get('https://hypixel-api.inventivetalent.org/api/skyblock/bosstimer/magma/estimatedSpawn');
var magma = response.data;
return magma;
}
var magmaValue = await getMagma()
var estimate = magmaValue.estimate
}
console.log(estimate)
if (sent) {
msg = await message.channel.send(estimate)
sent = false
}
msg.edit(estimate)
}, 1200);
}```
estimate is going undefined
use const for estimate instead of var
Yes
why tho
Idk why people use var
Because var fucks everything up
they was he used var is bad
Most of the times var can be changed to let or const
message.channel.send("F").then(msg => {
msg.react("740064337212997683")
const filter = (reaction, user) => {
return reaction.emoji.name === ":Database:" && user.id === message.author.id;
};
const collector = message.createReactionCollector(filter, { time: 15000 });
collector.on('collect', (reaction, user) => {
message.reply("reacted")
});
})```
is there anyway to use custom emojis in a reaction collector?
i use that and it just reacts collector bot doesnt do anything when they react
and then the same id i used to react?
when i react it doesnt send a message saying reacted
Does anyone here have a picture of an embed that broke on mobile?
import aiohttp
from discord.ext.commands import MissingRequiredArgument, BadArgument, MissingPermissions, BotMissingPermissions
from discord.ext import commands
from discord import Embed, Member
from datetime import date
from googletrans import Translator
import random
import aiohttp
color = 0x75aef5
async def fetch(session, url):
async with session.get(url) as response:
return await response.json()
async def get_random_gif_by_theme(theme: str):
async with aiohttp.ClientSession() as session:
response = await fetch(session, f"https://api.tenor.com/v1/random?q={theme.replace(' ', '+')}&contentfilter=medium")
await session.close()
return response["results"][random.randint(0, len(response["results"]) - 1)]["media"][0]["gif"]["url"]
async def get_answer(question: str):
async with aiohttp.ClientSession() as session:
response = await fetch(session, f"https://8ball.delegator.com/magic/JSON/{question}")
await session.close()
return response["magic"]["answer"]
class Ball(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def ball(self, ctx, *, question: str):
trans = Translator
print(await get_answer(question))
translated_response = trans.translate(await get_answer(question), src='en', dest='es')
print(translated_response)
await ctx.send(f"{ctx.message.author.mention}, ¡{translated_response.text}!")
def setup(bot):
bot.add_cog(Ball(bot))
why it dosent translate?
node-pre-gyp' is not recognized as an internal or external command,
im trying to install canvas (node.js)
and this is the error
did someone know how i can disabled the default login page in java spring securrity they have remove the option to disable it in the application.properties, what i just know is that i have to override the SecurrityConfig but i have know idea what i exactly have to change/override
@delicate shore
@dense zephyr Bonjour!
French in shitpost k thx
hey guys
how do i put a comma between the input of 4 coordinates?
like this: $po distance x1,y1 x2,y2
if you want the true, let's say human member count, in a server, are the only possible ways to toggle fetchAllMembers to true or turning the presences intent on?
ok damn a guy is also making hypixel timers aaaaa
my bot only responds on the command $Po distance x1 y1 x2 y2
@nocturne grove fetch all members
learn python then
do you know what each line of your code does
if yes, you should be able to edit your code to make that possible
@tight plinth yeah so no other option? Or can you fetch members in one guild only? (it's not in the docs)
okay lol
but I think guild.members.fetch() fetches all members in the guild
sorry but you are one of the worst helpers in this whole server.@tight plinth
oh that's a smart one haha. Thanks
@eternal osprey depepnds how you define helpers
can i ask? 
idk if I can't see your code I can't help you
exactly, I am not even allowed to say 'helper'
well you could say that instead of saying that i have to learn python
after asking a question
I mean if you know the language, you could be able to do it yourself
how to setup vote webhook for javascript? 
is there a way to change how time work in javascript or vps? i just moved from a vps in Germany to vps in Israel, and now whenever im running the ping command it shows "Latency: 25199797ms", and whenever im doing "new Discord.MessageEmbed().setTimestamp()" its showing my time+6 hours,and its very weird because it wasnt like that when i had a vps in Germany
Why ping
you said const would fix it but its still broken
@earnest phoenix whqt are you using to get latency
and no you can't change how unix timestamps works
Date.now()-message.createdTimestamp
the date is returning the date its supposed to return + 6 hours
client.ws.ping should work
its the api latency im doing
and also the message embed, and every moderation log there is
but i need more detail 
if (command == "timers") {
var sent = true
var first = true
setInterval(async function() {
if (minutes <= 0 || first == true) {
first = false
console.log('searching')
var getMagma = async () => {
var response = await axios.get('https://hypixel-api.inventivetalent.org/api/skyblock/bosstimer/magma/estimatedSpawn');
var magma = response.data;
return magma;
}
var magmaValue = await getMagma()
var estimate = magmaValue.estimate
}
console.log(estimate)
if (sent) {
msg = await message.channel.send(estimate)
sent = false
}
msg.edit(estimate)
}, 1200);
}```
`estimate` is undefined
theres a lot you can change with that code
if (command == "timers") {
var sent = true
var first = true
setInterval(async function() {
if (minutes <= 0 || first == true) {
first = false
console.log('searching')
var getMagma = async () => {
var response = await axios.get('https://hypixel-api.inventivetalent.org/api/skyblock/bosstimer/magma/estimatedSpawn').catch(err => {
// log/ catch errors. sometimes the response can be bad or not existent
});
return response.data;
}
var magmaValue = await getMagma()
var estimate = magmaValue.estimate
}
console.log(estimate)
if (sent) {
msg = await message.channel.send(estimate)
sent = false
}
msg.edit(estimate)
}, 1200);
}
if you land in the catch then something with axios went wrong
@carmine summit


