#development
1 messages · Page 600 of 1
i dont have anything open but vscode
i know its the problem
but i dont have two things open is what im saying
Vscode has a builtin terminal
It could be running your bot
thats what i use most of the time
Check if it is
Well thats the only thing that can cause your problem
That you run node twice
Just regenerate a new token ffs if you dont wanna listen to us
Then the problem is solved
i dont feel like restarting
K sad for you
Ok, you will handle this by yourself since you know better than us, we told you the problem though
You dont feel like restarting
and i never said i know better than you
ok
We gave you a solution. If you aint gonna try it, then dont complain
Because you still saying you have the same problem when you dont wanna try the solutions we provided
Sorry if i were rude @broken elm
Just woke up
Queue [
{ track:
'QAAAbQIACE5GIC0gV0hZAAtORnJlYWxtdXNpYwAAAAAAAu4AAAt6dUpWLURBdl93RQABACtodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PXp1SlYtREF2X3dFAAd5b3V0dWJlAAAAAAAAAAA=',
info: [Object] },
{ track:
'QAAAmAIAMUJpbGxpZSBFaWxpc2ggLSBPY2VhbiBFeWVzIChPZmZpY2lhbCBNdXNpYyBWaWRlbykADUJpbGxpZSBFaWxpc2gAAAAAAAMRKAALdmlpbWZRaV9wVXcAAQAraHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj12aWltZlFpX3BVdwAHeW91dHViZQAAAAAAAAAA',
info: [Object] },
{ track:
'QAAAgAIAGUJpbGxpZSBFaWxpc2ggLSBCZWxseWFjaGUADUJpbGxpZSBFaWxpc2gAAAAAAAM4OAALZ0JSaTZhWkpHajQAAQAraHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1nQlJpNmFaSkdqNAAHeW91dHViZQAAAAAAAAAA',
info: [Object] },
player: Player {
_events: [Object],
_eventsCount: 1,
_maxListeners: undefined,
status: 2,
node: [Node],
guildID: '561588141761495045',
currentSong: [Object] },
onEvent: [Function: bound onEvent] ]
How could I get what is inside info object?
Queue[0].info ?
if i have got a string which is an id of a user, how can i get the name of the user?
im using discord.js 11.4.2
But I am trying to get all the tracks
in the queue
and add up the duration
sorry I just spilled ketchup on my pc, I was wiping it off
lol
then get their username from the user object
I can't remember
I use master
not stable
brb
How could I use reduce
What?
to add up the lengths in every single track
there
legnth is under info
so I will also need to get into the info object to get length
queue.reduce((a, b) => a + b.info.length, 0)
@lusty dew
no
yes
We will determine that rn
let me just read it up in mdn real quick
I can be wrong
you set a to 0 with the default value
my jiggly knowledge forgot that
reduce is the function I dont use often
its sweet as hell when you get the hang of it
its semi-niche but its so clean when theres a good use case
the name doesnt make any sense to me thats why I dont use it often but meh
thats what I was lacking, when I was searching I cant find anything that gives a good info on why its called reduce
glad i could help 
👌
Thanks to the both of you
I got what I needed I think
👀
I think
I honesly don't even know if I got what I needed
I don't thing the length of the songs
update as the song progresses
so it literally says the length it was when it just starts
im not sure what you were doing i was just fixing the reduce lol
I am trying to add all the lengths (duration) of the songs in the queue
then subtract it from the current song
to get the estimated time of when the next song will play
but since lengths don't update as the song progresses the length stays the same as when the song starts
start a timer yourself i guess
sorry i dont know anything about lavalink so i cant really help you :(
but if it doesnt update the time the only option is to set up a timer yourself
it shouldnt be that hard though - esp if you already have a db connected
Why would I want to do it per song skip?
I am trying to get estimated time until the next song starts
when the song starts, start incrementing in your db every second. then tally the queue and subtract the current incremented value. when a song ends or is skipped, remove it from the tally and start again on the new song
for example
let counter = 0
let started = false
function play() {
if (!started) {
started = true
counter = queue.reduce((a, i) => a + i.info.length, 0)
}
lavalink.play()
.once('end', () => {
queue.shift()
counter = queue.reduce((a, i) => a + i.info.length, 0)
play()
})
}
thats just an idea
counter will always be the calculated songs length
Yea
and it will update every song end
Every song end?
yes since if you didnt update that, that will remain static
unless you are doing some interval
How does that help determine an estimate of when the next song will happen while the current song is still playing
oh you want a estimated time before the current song ends?
Yea
I managed to get 448000
after a lot of evaling xd
but that just gives the full time
same lol i have to be up soon and im still dicking around >:(
It i 12:45am I usually pass out by now
gl with the provlem guys im out
Kk cya
let playing = 0
function play() {
if (playing) clearInterval(playing)
playing = 0
const player = lavalink.play()
setInterval(() => playing++, 1000)
setInterval(() => console.log(queue.info.length - (playing * 1000)), 5000)
player.once('end', () => {
queue.shift()
play()
})
}
aye same time 👌 west coast baby
Lel
that will log the time left per 5 seconds
dont forget the () due to Javascript Precestuff whatever spell it iis
but the weeb keyword is there
xD
you instantly know its me
no problems
:3
i can't see my bot in API do I need to wait for the bot to be approved before I can obtain my API key?
Yeah, it has to be approved in order to gain API access
thank you
24 * 60 * 60 * 1000
Yeah
You can just put that in your code
Oh thx
Usually makes it more readable than just a random number
Yes
Hi join
const prole = pguild.roles.find(role => role.id === "534081989758812182");
if(message.member.roles.has(prole)) {
console.log(message.author.id)
}```
What is wrong with this

it doesn't send id
because the if statement is never true
?
i have the role on the server
You should always use get if you have the id no point in finding the id if they're mapped by id
why does it look like this?
isnt it supposed to be html and not just display that as text
why is my bot in the server but the commands dont work here but they do in other servers?
wrong script?
@normal thorn
hello , who have control panel for bots such mee6?
and uhh how do I get it umuted @mossy vine?
writing one is quite diffucult and cant just be copied @earnest phoenix
any source codes on github ? @mossy vine
@earnest phoenix you can try looking, but i doubt you will be able to make much use of it
uh it says
why is that a thing?
Who uploads the bot is the moderator duh
@mossy vine what do I need to do now?
Omg for real only cause there a few commands with prefix??? well danggg
so every command needs to have a prefix?
..... just ..... nothing to say on that ngl
if you want the bot to tell you its prefix you might want it to respond to @yourbot prefix
okay so messages like help without prefix are not allowed... why exactly?
if you run <commonprefix>help (which you shouldnt do unless you want a mute), about 100-400 bots will respond. imagine what would happen if they responded to just help
makes sense Ig is it allowed to add reactions to messages like a think emote on a what/uhh message?
no
unprefixed responses are not allowed here
read the bot rules, they clearly state it
so no messages no reactions no nothing
If you just make it reply to mentions it'll be fine
Anyone with a decently functioning brain will try to mention it
Rather than just typing "help"
ill try (im not that great with coding yet lol)
ik (i will try to make commands able to be turned of by admin role tommorow)
nvm ive done it today, I get it now lol
who have control panel for bots such mee6?
i would tell you to write your own, but since you are just asking for one i assume you dont even have the necessary skills
its not even that hard (yes im a begginer)
ew glitch on mobile
lol like I said a begginer
hErE iS a GrEaT gUiDe -
gamer moment
btw atleast I code and dont use discord bot maker (I normally am on pc but I only have phone atm lol)
make a colors.json
why?
how about
im just doing this for a really short time like you could do everything in a few weeks just no
On pc
I can add a file with those colours
within 1 minute
😱
It would look better if you had them all together
Also why fetch your logs everytime a message comes in 
yeah but could you do that when you were only coding for a week or less?
Maybe
But don't compare yourself to others
I'm guessing you want to get better and better
I'm telling you that you're doing some things
Which you could improve
It's not an attack, it's just advice
Good luck with your bot
dude this is my 4th day
but whatever im going back to scripting/learning
alright all commands have a prefix so... how does my botI get unmuted now?
DM a mod
Who?
@inner jewel hey ive putted a prefix for every command now
proceeds to tag the only moderator who doesnt deal with bots lmao
at least he chose one thats online /shrug
will someone recommend a nice page to endpoints? [JSON]
I mean random anime pictures, for example: https://nekos.life/api/v2/endpoints
that api has a wrapper in just about every language i think
are you writing to me? xD
yes
I do not understand you...
give us a page: P
will someone recommend a nice page to endpoints? [JSON]
I mean random anime pictures, for example: https://nekos.life/api/v2/endpoints
Is it possible to make a gacha Stim with Only "Case/Break" and "Math Random" on Java?
Don’t use nekoslife lol
?
Full of „quentionable content“ if you get what I mean
Talking about the person above you
Ok
Is it possible to make a gacha Stim with Only "Case/Break" and "Math Random" on Java?
Hey everybody
Howdy
dont repost your question if its like a few messages above and i dont know is it just me but that question made no sense @viral surge
What the hell even is a "gatcha stim" @viral surge
const nrole = nguild.roles.find(r => r.id === "534081989758812182")
if(message.member.roles.has(nrole)) {
console.log(message.author.id);
} ```
it doesn't work
idk why
no error
it doesn't say anything in the console
And when i put ! Before the if statement, the bot send my id in the console

i told you because the if statement returns false
you should probably compare ids and not straight entities
just add an else statement to your if
its because the member doesnt hsve the role
are you sure you have the right role?
also, message.member.roles.has(roleid) is enough. you dont need the find and all
don't use glitch
^
@idle basalt oh thx its worked

only @earnest phoenix
Thinking I'm an expert 
@zinc marten Easy
let prefix = "!" || "/" || "?"
ah okay thx


Lmao

so i can touch you in here raid?
@amber fractal regex would be /(!|\/|\?)(\S+)/g if you also want it to get the command
list all servers and ids
in d.py
one moment let me read docs
Async or rewrite?
That should be all you need
you should be able to figure the rest out
i know that to make a link you do Link Name, but how do you make when you hover over it it doesn't say [Link Name]?
I am not sure if that's possible
^But you shouldn't use it for important information as mobile users can't see it
yes
ok
cache
i delete cache
at least... i think that was the issue
i forget what caused joinedAt to show incorrect values
commandscompleted = await bot.pool.fetch("SELECT comcompl FROM cc WHERE userid = $1", member.id)
im trying to make it where when someone completes a command, it puts it in the db, then i retrive it for a command, it is not returning, can someone tell me what i did wrong?
let regex = /^(?:https?://)?(?:[\w]+\.)(?:\.?[\w]{2,})+$/i.test(input)
if(regex){
client.music.players.load(input)
}else {
client.music.players.load(`ytsearch: ${input} `)
}
is there any way
I can do .then(r => {})
just once
instead of for each
client.music.players.load
I don't want to have to duplicate the code
well, yes. but no
@lusty dew just set them both to the same variable and do .then(... on that variable
so like, let l = ... in both of the blocks
and then l.then(...)
:^)
@earnest phoenix what happens if the user has never used your bot before? Your update searches for an id that isn't there, and your select does the same.
Well i do a bot command before, but it always returns as []
ohhhhhhhhh
nevermind
@scarlet bane I just did await client.music.players.load(regex ? input : `ytsearch: ${input}`).then(...)
but now I get a new error
(node:3756) UnhandledPromiseRejectionWarning: TypeError: client.music.players.load is not a function
i have no clue
I'm trying to make it where it checks if a user is in the database and if not it returns, how would i do that?
@earnest phoenix SQL has an "insert or update" instruction, which inserts if there isnt any entry or updates existing entries
https://hastebin.com/unekaxomuw.js
^^full code
(node:3756) UnhandledPromiseRejectionWarning: TypeError: client.music.players.load is not a function
and error again
read the docs
jesus christ this is indented so badly 😩
It is the way it went into the hastebin
It looks fine from vs code
and April what docs?
d.js-lavalink?
lavalink
can you like link me the github repo..
You know d.js-lavalink isn't the only npm package for lavalink right?
If you give me a damn second
He didnt say it was the only one
it's not hard
take your time
I was linking it rn
nobody's being pushy
So, if everytime they run the command, it has ```await bot.pool.execute("INSERT INTO econ VALUES ($1, $2, $3)", 50, ctx.author.id, ctx.guild.id)
@earnest phoenix is ctx.author.id a unique key?
if it's not, it'll do it multiple times
You need some sort of unique key to prevent it from repeating
i have it by guild
So you have something like Unique Key('guildId','userid')?
What
@earnest phoenix
wait
What Lmao
@west raptor u thicc
ok ill try that, thx
@lusty dew i think ur problem is that ur awaiting a promise but also using .then on it
Hm.
idk js async that well but thats the only thing that stands out to me
How am I to get the tracks then?
wait im confusion
Await will return them for you, will it not?
what the fuck
like, rn ur doing await client.music.players.load(regex ? input : \`ytsearch: ${input}\`).then(...)
gdi
you can just
remove the .then
and set like.. var = await
what's client.music.players?
you didnt have the await before
I added it in after
?????
¯_(ツ)_/¯
not if you are using .then(...)
if you use .then you do it during the event loop rather than waiting for it
also what's client.music.players? seems like you would need to do client.music.players.get('guild id').load(...)
this is code from my bot that is already on my vps
monka
and it works perfectly fine with await and then
idk then
That is why it is confusing me 👀
april, if ur going to get overly frustrated and emotional for no reason
while he's talking to someone else
and I literally didn't read it till after
then...
i tried xd
I will try out what you said
seems super odd to me to see await and .then at the same time
Cus usually that's only done when you're modifying the result with a lambda and doing something with it later
alright.. and if that doesn't work can you please answer me?
not when you're doing things in the then and never using the result again
cause it seems like the readme says to like .get the player first then load so idk https://i.imgur.com/fvH4zsu.png
yeah so you need to .get() the player
???
i really dont get why this is being discussed
What does telling him that he didn't do something which he clearly did, as he said his other snippet worked
achieve
at all
and know that they are getting the attention
Here is code from vs code
of me getting the player
:p
jesus christ im trying to help but the latest hastebin link you provided isnt .get-ting the player so i assumed it's not there
April
at this point
even if you're 10000% right
you're approaching this like an impatient child, rather than someone who wants to help
alright then im going to tell them the line if they dont listen to me so be it
it's line 23
you're not get-ting the player
@lusty dew april is saying that line 23 should be player.load rather than client.music.players
you are obviously tired
what
You sure it works like that?
cus the docs also say player.load is the right way to go, not playermanager.load
yall are really going overboard here lol, breathe
the error you gave earlier though.. ```js
(node:3756) UnhandledPromiseRejectionWarning: TypeError: client.music.players.load is not a function
odd
I will test out what Raid said
if it errors I will admit I was wrong
and do it your way
Does that make you happy?
i was already irritated before i came here so i should probably stop and cool down
I just gotta turn on my mongodb server again it goes off randomly 
player.load is not a function
I tried it my way
then your way
Same error
what's player?
i didn't tell you to put player.load but ok
april
at this point
go sleep
const player = client.music.players.get(message.guild.id);
i dont want to sleep i still have more to do
man i really wish hastebin didn't rape your indents
Exactly
oh my god its because you're mixing tabs and spaces 😩
I use tab whenever it in properly indents
Wtf
😩
I never used spaces
xD
What editor do you use
seems like the readme is wrong i dont rlly know
¯_(ツ)_/¯
can you try logging player and see what it gives
inb4 ur player is null
Player {
_events: [Object: null prototype] { event: [Function] },
_eventsCount: 1,
_maxListeners: undefined,
status: 0,
node:
Node {
_events: [Object: null prototype] { playerUpdate: [Function] },
_eventsCount: 1,
_maxListeners: undefined,
players:
PlayerStore [Map] { '561588141761495045' => [Circular], node: [Circular] },
voiceStates:
Map { '561588141761495045' => 'bfdaf01da2c8ad498cfbe4252bc1771a' },
voiceServers: Map { '561588141761495045' => [Object] },
_expectingConnection: Set {},
password: 'mine',
userID: '564115455044878367',
shardCount: undefined,
http:
Http {
node: [Circular],
input: 'http://localhost:2333',
base: undefined },
connection:
Connection {
reconnectTimeout: 100,
_listeners: [Object],
_queue: [],
node: [Circular],
url: 'ws://localhost:2333',
options: {},
_backoff: [Backoff],
_send: [Function: bound _send],
ws: [WebSocket],
resumeKey: '0.vvxuw8llf2h' },
send: [Function: send],
queues: Map {} },
guildID: '561588141761495045' }
Not a function
Yeah i have no clue, never seen anything like this before
huh odd looking at the code in the repo the load function i found was on Node
hmm
events.js:167
throw er; // Unhandled 'error' event
^
Error: connect ECONNREFUSED 127.0.0.1:2333
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1117:14)
Emitted 'error' event at:
at WebSocket.error (C:\Users\Aj\Desktop\Clap Bot\node_modules\lavalink\dist\src\core\Connection.js:37:27)
at WebSocket.emit (events.js:182:13)
at ClientRequest.req.on (C:\Users\Aj\Desktop\Clap Bot\node_modules\ws\lib\websocket.js:568:15)
at ClientRequest.emit (events.js:182:13)
at Socket.socketErrorListener (_http_client.js:392:9)
at Socket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
Like this
but I think it is different when using stable
idk
on stable I had dirs going to lavalink files
Oh wait notices the dir to lavalink

But yea it errors on start up
zero clue
i tried everything i know
idk why its not working
hopefully someone else can help
same
maybe try updating packages/libraries?
cause the code in the repo is saying something entirely different
Wdym updating?
npm i
Worth a shot
then i would try logging player again and see if it's different
No
oof
@scarlet bane I tried that and after i run the command once, it says the user is already in the db
@earnest phoenix so just insert ignore
it'll try to insert but it wont error if it cant
http://www.mysqltutorial.org/mysql-insert-or-update-on-duplicate-key-update/ you should really look at this tho
so, await bot.pool.execute("INSERT INTO econ VALUES ($1, $2, $3 ) ON DUPLICATE KEY INSERT IGNORE", 50, ctx.author.id, ctx.guild.id)
no
sad
insert into econ values blah blah blah on duplicate key (your update statement from above)
im not comfortable giving you the full statement but i've definitely given you enough help for you to figure it out 😗
Yea, and thank you
ofcourse, any time 😃
I figured it out
it should have been
client.music.load
not client.music.players.load
👀
Hello! I'm Rabbitearsblog and I'm having a bit of a problem trying to incorporate bots into my servers. My servers are Animation Bliss and Rabbitearsblog's Patron Community and every time I try to add in a bot, it would say which server I would like to put the bot in. But unfortunately, neither of my servers would show up in the drop down box. How do I add my servers to the Discord server list?
you need to have manage guild perms in the server
if youre the owner, you should have these permissions
Okay. I'll check those out.
I made some changes to my moderation status, but the servers are still not showing up. I'm searching for bots with this website: https://discordbots.org/servers
Which website do I need to go to?
Question
I am trying to do
-ql 1
it is a queue list cmd
and I am paginating it
and I am trying to put 5 songs on each page
and when they do -ql [pagenum]
it will list the songs on that page
My question is
I know I have to use slice (since my queue is an array)
but how would I get it to list 5 songs on each page
what lang
D.js
for (var i = 0; i < Math.round(q.length / 5 - 0.5); i++) {
//add q.slice(0,5) to the page
q.shift();
q.shift();
q.shift();
q.shift();
q.shift();
}```
i think that should work
for 5 thingies

if it shifted once then the same thing would appear on two pages four times
You guys dont need to make it so hard
for (var i = 0; i < Math.round(queue.length / 5 + 0.5); i++) {
//add queue.slice(0,5) to the page
queue.splice(0,5);
}```
Hm probably idk tbh
well
If that is meant for embed and react pagination then no
Really?
As long as you keep track of the page number
i am umb tbh
umb
dumb*
queue.slice(pageNum * pageSize, (pageNum + 1) * pageSize);```
works just fine 
and ye, its zero based
🤔
How would I check if a member has a role? I've done it before but I forget. I also can't find it in the docs (it probably is though). I'm using D.js
Please ping with response
Never mind, found it on Google
@earnest phoenix @earnest phoenix yes I get that,
but my bot was muted for not having a prefix and now it has
uhh so... my bot is muted AGAIN
with no reason at all
]]mutedbot
Your bot was likely muted because it broke one of the "bot rules" listed in #rules-and-info.
To find out why your bot was muted and by who, use the search feature in #mod-logs:
so, got Canvas to work but can't rlly find much info for Canvas Node.js/Discord.js
just ping me, not in a hurry
you can look at the discord.js guide
https://discordjs.guide/popular-topics/canvas.html#basic-image-loading
or look at the canvas examples
https://github.com/Automattic/node-canvas/tree/master/examples
Guys I have a question
Imagine I have 2 information for a same column in mysql (for example 2 data for serverid)
I want to delete the older one which is at bottom (mysql adds new data on top)
How can I do that?
because when i tested it it responded in the nsfw channel with what was after the return
and didnt in a non nsfw channel
idk read the docs I guess
thats the same
!x``` and ```x == false``` are the same thing
fuck me I cant type
No don't add your testing bot to here unless you intent for it to be added to people's servers
no thats not what i meant
i meant when the bots are being tested do they add them here
or in another server
In another testing server
oh ok
ok so you were planning on just enabling the nsfw check for this server
interesting
maybe let the user decide but default it to on
Is there a way to make og values dependent on hashes or query?
does the bot have repeat everyday on fixed time reminder ?
wdym repeat
@neat falcon yo how do you send files in js?
wdym
Wdym
msg.channel.send(howtosendfiles)

You are welcome big smelly
Skullette we better team up and make a retarded bot in js
@trim saddle send has json parameters
call it yardim botum and make it in dbm + host on glitch
js and jsons smh.
- send({file: });
wtf stop fucking ur phone
and it can be an array of files it seems
yes
i wish there was a proper randomizer
oh well.
what if i wanted to upload from a link?
@inner jewel what does that mean? Can I get an article or something maybe?
And I mean like dynamically through purely html I know I can do it with php but I wanna know if it can be done with purely html
Hh ok
php 
coding 
Im not receiving update notifications of games
wdym
anyone here knows how to make a timer? /cooldown but it can only effect one command
what language @velvet cliff
on python its asyncio.sleep(time)
yes
time = the cooldown in seconds
js though
I want to set a cool down on -boxie cause it will give xp soon ik how to do that
but I cant make a working timer...
@unique nimbus
See if that helps I don't use js myself
oh I did python but my friend convinced me to do js
how to make embeds on discord.js?
@velvet cliff you can use setTimeout()
@unique nimbus no I want to set a cooldown for all users but not for all commands
that is for all users
so lets say I did that command
and then someone done it also
we both will have different seperate cooldowns for that command
yes
you can still use setTimeout
yes
oh lol i thought it was nvm thanks
okay my last question for now,
how do you give users items? like
the items -boxie show but then also show the items in your inventory and add the items you earn from -boxie every time
but how do you add items?
isnt there a line of code to do it?
like a line everyone can use?
im just guessing but something like
{addi @user.item :itemid: *5 };
we dont know how you set up your database or what you even use
js
that is very helpful information
just saying js doesnt help at all
for all we know you could be using anything as a database. using a json file, sql, mongodb
do we just guess or what?
but the basiclines are the same for everyone discord.js on glitch
like the bassicline for a message is always message.channel.send
so you can ask me not to copy paste but the basiclines are always the same
so just to make this simpler, how are you storing your users items?
thats exactly what im asking...
how do you do that...
like thats what I want to know all this time
i suggest you use something like mysql
ok thanks ig now ive to figure out what that Is but whatever
I would also suggest using a database like mysql or mongo (if using js)
yes i just said that
I prefer relational databases as oppossed to nosql solutions though
He's on js as far as I am aware, so I wanted to mention mongo as well
you know im just starting so can you explain what mongo is?
Pretty sure mongo isn't just for js
But yes mongo very epic
It's a database @velvet cliff
yeah i was about to say
Google it
oki
Its not, but its part of the classic JS -> mongo pair
that i adamantly despise but accept it is popular.
https://mlab.com could be useful if you're going with mongo
They can host it for you
They have a 500mb free sandbox u can use
wait your data base needs to be hosted?
You can run a mongo instance on whatever you're using to host your bot
But idk how much space you have
And if you want to go through installing and setting up all of it
It's not hard imo but it would probably be faster to just get one hosted for you
As you can then easily connect using what they call a connection string
db.get(`pokemon${message.author.id}${pokemonid}`) // get the whole entry```from here, it depends on how youre storing the information (i would recommend an array of objects) and then you can use normal javascript operations to get it done
if you store as an array of objects, array.map is your best friend
it loops over your array and returns a new array
so if you have an array of objects, you can do something like this: arr.map(e => e.id) and it will return an array of all the ids.
How do I store things in users account like when you do a command you get gold and the gold gets stored in user account?
oh
join combines all the elements of an array with a joiner character that you specify
so to newline everything, you set up the array how you like with map and then call .join('\n')
um.. of what
i gave an example of map above ^^
sure. try it :)
e can be whatever you want -- its a function param
this line will only print the ids but figure out how you want it formatted and set it up however you like inside the map
the first param to the map callback represents each element of the array. which is why this is easiest if you have an array of objects
because the param will be each object and you can do object.prop on all of them
const arr = [{ prop1: 123, prop2: 456 }, { prop1: 789, prop2: 195 }];
arr.map(e => /* e is each individual object per iteration. so on the first run, e is { prop1: 123, prop2: 456 } */ e.prop1);
// => [123, 789]```
mine all
hello, can any help me here with discord py 👀
just ask the question 👀
i like to list all permission of a tagged user. but i doesnt works really 👀
what part are you stuck on?
getting the member?
getting the permissions?
@earnest phoenix
on the output. wait a second i want to send a example ^^
Also, do you want it to be contexutalized? ie, show all perms for that member in a channel? or in that guild, ignoring channel overrides
Role permissions:
[('add_reactions', True), ('administrator', False), ('attach_files', False), ('ban_members', False), ('change_nickname', True), ('connect', True), ('create_instant_invite', True), ('deafen_members', False), ('embed_links', False), ('external_emojis', True), ('kick_members', False), ('manage_channels', False), ('manage_emojis', False), ('manage_messages', True), ('manage_nicknames', False), ('manage_roles', False), ('manage_server', False), ('manage_webhooks', False), ('mention_everyone', False), ('move_members', True), ('mute_members', False), ('read_message_history', True), ('read_messages', True), ('send_messages', True), ('send_tts_messages', False), ('speak', True), ('use_voice_activation', False), ('view_audit_logs', False)]
oh my gob
thats my actuell output. want to make it better in the output. but don´t know how 😮
the code is
perm = list(role.permissions)
can you help me with this please? 😊
@uneven laurel do it together. first map the element to the string you want per line and then join them
ie like
pokemons.map(e => e.level + ' ' + e.iv).join('\n')
yeah
use the techinque i said lol
i dont want to spoonfeed
I have a question that anyone could kindly answer.
Yes
just ask 
that's a weary bread
Okay so basically you know how hytale is going to be like a roleplay sort of thing
we don't know that yet
@earnest phoenix Iterate through the elements inside the list
I have a question, where I can learn good how to develppe and program?
Read #502193464054644737
you have the balls to put "bot coding" in your profile pic, but cant iterate through the elements of the list. respect
- Iterate through the list
- Each element is a tuple, which contains its first element as the name of the permission and the second one as its value
name, perm = list_element- Or
whatever = list_element[your_index]
ohhhh 🤦🏼 why i have check it not earlier. thank very much for the brainwash


that doesnt exist
nvm





with a 🔪