#development
1 messages ยท Page 1068 of 1
looks like you tried setting your bot's presence to something other than a string
no, you can .toString() it and it'll be fine
Whatโs the discord rate limit for unverified bots and what happens if hit it
the ratelimits are different for the endpoints. the punishment is a lockout. the lockout is dynamic depending on how much you hit the limit

If I were to create a guildMemberAdd for displaying the channels user count, what variable would I use? cause guild.memberCount doesnt work
You mean the guild's member count?
yes
Also the first parameter for the event is a guild member instance. So you're probably looking for <GuildMember>.guild.memberCount
okay thanks
welp, it's something
@earnest phoenix use an embed
they look kinda nice
my example is a bad example of an embed but Iโm fixing it
how do I make an embed?
In js?
I'm gonna be using discord bot maker from now on so I guess that's a yes
See Discord.RichEmbed()
@jolly quail In v.12 its MessageEmbed()
Ig I'm not using v12 then?
Is anyone here using discord bot designer app
Can't say I know of anyone here using it
does anyone know how to use embed for discord.js ?
yea, what are you trying to make an embed of
ok one sec
im very new to using js
this is my like 4th bot
@earnest phoenix
https://discordjs.guide/popular-topics/embeds.html
yea also that
u have any other questions we can help
ok
I can hab
OK ๐
but can i dm you?
Sure.
Ok
How do I make rich embed links like
https://mee6.cyz
can we use bot.guilds.cache as database?
what library are you talking about?
Does someone know what the following error means and how to solve the issue?
||(node:8604) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
at RequestHandler.execute (node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:8604) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). ||
it means
you probably meant to use a code block (```) not spoilers (||) btw
are you scrolled all the way up?
if you are id balance the padding at the top and bottom of that header
it stays at top
ok then yeah i'd balance the oadding
@restive pebble it has been deleted on discord or in my code ?
discord
the api is responding saying it doesnt have that message
So i can do nothing ?
u cannot
ok, thank you for your help
why does
taggedUser.roles.add('563606400853606410')
work but not
taggedUser.roles.add('Muted')
because there can be multiple roles with the same name
So the library requires a specific ID
wait how to add your own emoji on the embed, like it's permanent?
if you want to go through the roles list yourself and find one with a specific name you can but most libraries require you to refer to resources with IDs
i use d.js
can i gte help with my dek-profile cmd
How may i help you?
well i have a black line around the pfp
i want to get rid
Show me.
i also wannt a circle behind the status
Oof, i cant help you with this, i am sorry.
ok
if(taggedUser === message.members) {
`you can't mute yourself`
}
this isnt working and just doing what's next which is
newEmbed.setTitle(`:bowyesmark: *** ${taggedUser.user} was muted.***`)
.setColor(0x43b581)
taggedUser.roles.add('563606400853606410')
message.channel.send(newEmbed)
}
ah ok
Also use message.reply
Hirio : can we use
bot.guilds.cacheas database?
tictac : what library are you talking about?
@west skiff discord.js library
is there a admin here?
@earnest phoenix is dm advertising
Dw
Dmed the moderator
hot discord you got there
Good morning. I'm new here. Can you help me with some topic? Is there any perfomance difference between a bot written in Python and a bot in Java?
oh..
so should i remove it?
uhm..
no reportp ls
report pls
i didnt know
@mild salmon
Java is a compiled programming language, but rather than compile straight to executable machine code, it compiles to an intermediate binary form called JVM byte code. The byte code is then compiled and/or interpreted to run the program.
Python, on the other side, is interpreted. So, in terms of performance, Java would win
@slender thistle thank you, in theory, if I compile Python using PyFreeze o Pyinstaller, to a .exe, can I get the same perfomance?
Hm, I never worked with either, but if they compile the source code straight to machine code, they should at least be equal in performance
Yes, they can compile the source code in Python straight to machine code. I've used it for some applications.
if i wont use this its says undefine
wait... is that javascript?
yes
๐ฎ wow!
Then, yeah. The difference should be around equal if not greater, but I guess benchmark tests will help you more than my guesses :p
ok
You need to enter a value in the value, Embed field value cannot be empty. @stiff stream
Or add zero width space
C++ or java
I guess this is the best bot client
"\u200b"
like this?
"\u200b"
This adds the Zero Width Space if you don't have any value to send in the embed, Else value = your value.
i need help
yes
ty
i cant load quick.db
@earnest phoenix but now its look like this
i want it to mention the user not the id
what to do?
Can you recomend me some good documetation for Python or JavaScript? I'm senior in JS and semi in Python, but I don't know anything about bots.
Make it message.author.id
me?
Yup
k
Like
<@${message.author.id}>
just `${message.author}`
Can you recomend me some good documetation for Python or JavaScript? I'm senior in JS and semi in Python, but I don't know anything about bots.
@mild salmon
https://discordpy.readthedocs.io/en/latest/
https://discord.js.org/#/docs/main/stable/general/welcome
it's a string
just `${message.author}`
Not working for him
it should
Scroll a bit
weird
@mild salmon
https://discordpy.readthedocs.io/en/latest/
https://discord.js.org/#/docs/main/stable/general/welcome
@earnest phoenix thank you very much
what is error lol
Run these npm shit in yoir Linux console in the exacr same order idk about other Operating systems:
npm i bindings
npm i quick.db
Yeah that's literally fixed my own 100000000 errrorrrs smh
Also why does message.guild.members.cache.random() return a user ID in v12 instead of a username#tag like in v11
can someone gimme guide about limited time input?
Example :
Me : -poll
Bot: Input Poll Title! // 30 Second Limit, Max Input 1
Me : Poll title
Bot: Input List of Poll // 30 Second Limit, Max Input 1
Me : True, False
Bot: Time Limit of Poll // 30 Second Limit, Max Input 1
Me : 30 Second
Bot: Embed (Pool Title, True, False) // Result of Pool with Time Limit
i tried discordjs to use message.channel.awaitmessage() but the limit but it not working
Show the awaitmessages code
{time:1000}
Guys can help me?
I have a bot and im new at coding.
I want to make [prefix]invite command (it sends bot's invite link)
what code do you have
@misty sigil whut?
Im using glitch
need lib 
DiscordJS or eris or whatever
do you have a message listener?
No
do you have any code
Wanna see bot?
send code yes
@earnest phoenix bruh
cant talk about that further tho 
Yeah happened some times
yeyeyeyye I made a js music bot
2|Boat | HTTPError [AbortError]: The user aborted a request.
2|Boat | at RequestHandler.execute (/home/amy/Boat/node_modules/discord.js/src/rest/RequestHandler.js:107:21)
2|Boat | at processTicksAndRejections (internal/process/task_queues.js:97:5) {
2|Boat | code: 500,
2|Boat | method: 'get',
2|Boat | path: '/gateway/bot'
2|Boat | }
can anyone help?
not your fault
For once
5xx errors are not your fault and instead the host's
well not your host, the host of whatever you're trying to connect to
how do you get emojis by id in discord js v12
<guild>.emojis.cache.get("id")
๐ฉ
hey
So?
someone know how do i make that if they react the bot will DM the person that react something?
i would suggest you to use .setDescription()
In this case
someone know how do i make that if they react the bot will DM the person that react something?
@stiff stream listen to an event
K
Thats call
Reactionadd
Thingu
Idk
Listen for that event
Btw the message that will trigger the event need to be cached
@dull badger you can use addField but you need to supply a Title and a Text for the field ("title","Textfield")
is it possible that djslight borks channel permissions
if (!voiceChannel) return message.channel.send('Please join a voice channel before playing a song.');
if(voiceChannel) voiceChannel = await message.guild.channels.fetch(voiceChannel.id)
const permissions = voiceChannel.permissionsFor(message.client.user);
console.log(permissions)```
this is returning ``Permissions { bitfield: 0 }``
you need to cache permissions
or try permissions.has
ohh sorry this was for the member object
but try enabling the caching of permissions it doesnt impact the ram usage this much
So, currently sharding for the first time, should I post to dbl in the index file or the bot file?
but try enabling the caching of permissions it doesnt impact the ram usage this much
@lusty quest how?
This is all I have
enablePermissions: true in your client constructor
are you on V3?
idk then. i guess wait for tim
client({enableChannels:true})
im fetching it
I think that caches all of every channel object
i dont want to cache it
Oh
if you fetch the channel it does the same
let voiceChannel = message.member.voice.channel;
if (!voiceChannel) return message.channel.send('Please join a voice channel before playing a song.');
if(voiceChannel) voiceChannel = await message.guild.channels.fetch(voiceChannel.id)
const permissions = voiceChannel.permissionsFor(message.client.user);
console.log(permissions)```
Output: Permissions { bitfield: 0 }
I am sharding for the first time. Should I post stats to DBL in the index file where I shard or the bot file where the client will be?
yes but you define voiceChannel and search for voiceChannel.id
there fixed
ok this makes more sense
@summer acorn idk my bot is to small for sharding. but i guess the Bot file is fine
I mean, I don't know to be honest.
im so confused ngl
i would just try and see if it will try and send it for every shard or not. if it does put it in the index file
Await the join, not the fetch
let connection = await message.member.voice.channel.join()
You don't need to fetch the perms that way either, just check if it can't join and where
I'm not at my pc rn so I can't get the exact code but add some if statements to check the perms of the bot
const voiceChannel = msg.member.voice.channel;
if (!voiceChannel) return msg.channel.send('I\'m sorry but you need to be in a voice channel to play music!');
const permissions = voiceChannel.permissionsFor(msg.client.user);
``` this works in V12, but havent tested it in d.js-light
then i just check if the permission for connect and speak are there or not
wait nvm its the same code
Bru
i know tim is online on his support server
kk lemme join
im in tim's server
guys how can i make a global function?
uhh
@slender thistle
can someone gimme guide about limited time input?
Example :Me : -poll Bot: Input Poll Title! // 30 Second Limit, Max Input 1 Me : Poll title Bot: Input List of Poll // 30 Second Limit, Max Input 1 Me : True, False Bot: Time Limit of Poll // 30 Second Limit, Max Input 1 Me : 30 Second Bot: Embed (Pool Title, True, False) // Result of Pool with Time Limit
@night bridge me needs help too me wants to figure out how to use awaitmessage
global function @earnest phoenix
export it
export default function(){}
and import it
uhhhhh
how?
Is it possible to use variables inside a regex?
For example
this.match(/.{someNumber}/)```
what does name replace with the name or smth?
Hmm let's see
hmm
and require it
@restive pebble how do i require it?
it a function tho
const function = require('./filename')
function.functionName()
like
const kek = require('../functions.js')
React is used for UI
if (message. content. includes ("kekw") {
message. channel. send (":K"+"E"+"K"+"W:");
}
Doesn't the formatting infuriate you
Do I really have to install VS on my vServer???
yes
That seems unbelievably dumb
nah it's not if u don't know why I have to use windows
some games got some flaky Linux Servers. so this would be one point
:l
I am hosting several Game Servers with a Server Manager I coded in C# with a beautiful GUI ^^
then hf installing the visual studio bloat
Hey, does anyone know how I can get any user that first reacts to a message? discord.js
its simple
const filter = (reaction, user) => {
return [':gift:'].includes(reaction.emoji.name) && user.id != 485178809285476368
}
message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
.then(collected => {
const reaction = collected.first()
console.log(reaction)
if (reaction.emoji.name === ':gift:') {
msg.reply('You got a gift!')
} else {
msg.channel.send('F')
return
}
})``` That's what I got now
"Its simple"
its simple
@earnest phoenix How do I do it?
your code seems broken
@low marsh u dont have windows sdk? read the errpr
try this
.catch(collected => {
message.channel.sendMessage("timout error");
const filter = (reaction, user) => ['๐'].includes(reaction.emoji.name);
embedMessage.react('๐');
embedMessage.awaitReactions(filter, {
max: 1,
time: 60000,
errors: ['time']
}).then(collected => {
const reaction = collected.first();
if (reaction.emoji.name === '๐'){
message.channel.sendMessage("Yay.");
}
});
});
'485178809285476368' => ClientUser {
id: '485178809285476368',
username: 'Eve',
discriminator: '3009',
avatar: 'd3c23eed5c04fa62d17c22265619ef18',
bot: true,
lastMessageID: '734011356126380115',
lastMessage: Message {
channel: [TextChannel],
id: '734011356126380115',
type: 'DEFAULT',
content: '',
author: [Circular],
member: [GuildMember],
pinned: false,
tts: false,
nonce: undefined,
system: false,
embeds: [Array],
attachments: Collection [Map] {},
createdTimestamp: 1595072344572,
editedTimestamp: NaN,
reactions: [Collection [Map]],
mentions: [MessageMentions],
webhookID: null,
hit: null,
_edits: [Array]
},
verified: true,
email: null,
localPresence: { status: 'online', game: [Object], afk: false, since: 0 },
_typing: Map {},
friends: Collection [Map] {},
blocked: Collection [Map] {},
notes: Collection [Map] {},
premium: null,
mfaEnabled: false,
mobile: null,
settings: ClientUserSettings { user: [Circular] },
guildSettings: Collection [Map] {}
},
'339109941023604736' => User {
id: '339109941023604736',
username: 'Toby',
discriminator: '9857',
avatar: null,
bot: false,
lastMessageID: '734011354180223026',
lastMessage: Message {
channel: [TextChannel],
id: '734011354180223026',
type: 'DEFAULT',
content: '-help',
author: [Circular],
member: [GuildMember],
pinned: false,
tts: false,
}
}
}``` So what I got now is the list of reactions from all users. But I wan't to get the ID of the second one. (In this case user Toby, ID 339109941023604736)
reactions.find
@sick cloud how?
can i make something like if the command is !lolthisisatestcommandtoexplaintoyouguys the bot either replies a or b or c but the chance to reply a is 1/2 and b is 499/1000 and c is 1/1000
is there a way to do that?
something like this maybe
var chance = Math.random();
if (chance < 0.5) {
//50 % chance of something
}
else if (chance < 0.7) {
}
else { }
isnt 499/1000 basically the same as 1/2?
Almost yes
Might as well make it 1/2
in any case just do ```js
if(c < 0.001) {}
else if(c < 0.499) {}
else {}
ty!
i could also do like this?
const cf = Math.floor(Math.random() * (1000 + 1));
if cf === 1 {}
if cf > 1 {}
if cf < 1000 {}
I don't really know if it will work
@low marsh if you are still using windows, I suggest you check chocolatey.org it will save you
close the floor
Math.floor(Math.random() * 1001) + 1
const cf=Math.floor(Math.random()*1000);
if(cf===0){c}
else if(cf<500){b}
else{a}
How's this?
okay so it will be
const cf = Math.floor(Math.random() * 1001) + 1
if (cf === 1) {}
else if (cf > 1) {}
else if (cf < 1000) {}
Hmm if ordering would be wrong?
yes, that's good
is the if ordering correct?
alright ty
if it's 1000 it can?

what if i witch it
const cf = Math.floor(Math.random() * 1001) + 1
if (cf === 1) {}
else if (cf < 1000) {}
else if (cf > 1) {}
if(cf===1){}
else if(cf<=500){}
else{}
@jolly quail @hazy sparrow
@hazy sparrow if its less then 1000 it means its greater then 1
Ya again the same problem as before bro
;-;
Third part will be unreachable
ok lemme try
else only works if previous if failed condition... So if u write if(cf<1000) first it'll take most(almost all) of the cases and u won't ever get to the last statement
const cf= Math.floor(Math.random()*1000)+1;
if(cf===1){c}
else if(cf<=500){b}
else{a}
does this work:
bot.on("guildJoin");
1/1000 chance
lmao
It's random xD
i got b 4 times in a row
Not such a big deal
make an array with 100 words and add in the a b and c accordingly to the percentage you want
i hope so
Hi !
the reason i wanted is because i wanted my coinflip command to have a chance to land on side
bruh
its 1/6000 chance for side in real life
Other two should have equal probability
how
Heads and tails should get equal
Obviously
Ur just subtracting a small portion of probability from either heads or tails not both
so heads is 2998/6000 and tails is 2998/6000 and side is 2/6000
thats one way to do it
6000
oh yea
XD
Cuz we require heads or tails
Personally i won't prefer any other option
No matter how low the chance
how about a chance that we will throw it so hig that a plane will hit it
or a bird will catch it
How about a chance that coin is already biased
@low marsh u dont have windows sdk? read the errpr
@restive furnace I installed it now,same error win10 sdk
biased?
bad
Yep
@low marsh if you are still using windows, I suggest you check
chocolatey.orgit will save you
@harsh badge does it fix my issue?
lmao
51% chance of losing
U will always get profit
And the player will think 50% chance of winning
everyone wants profit
theres another way
@low marsh you just need to install build tools
make the chance to lose 100% and just tell "you're just unlucky"
npm install -g windows-build-tools from an admin powershell
true
@low marsh see what Tim wrote, that will fix your issue, that is what chocolatey does for you and other things that you might need, check their website
Ur casino will shut down instead
@jolly quail atleast they will profit a little
Bruh
just build your own casino with trash
oh yea XD
why discord dm everyone
npm install -g windows-build-toolsfrom an admin powershell
@quartz kindle so I can uninstall VS again? :D
why discord dm everyone
@wheat hornet just the developers
ya but it ruined my fucking sleep
why do you check discord when you are sleeping
This is not on the topic of development please move elsewhere.
just ignore and chack later
Ikr
notification
ok zoro
lol
lmao
I want the Connection between the public bot and the bot prime
Public bot and Prime in one project credits,level,profile,...
But the second token is the one that works
The first only works if you put it in the second
help me please
guys could u invite my new bot to ur servers i really want to be verified
am i allowed to send links?
process.memoryUsage().heapused
This is for how much memory is used
thx
process.memoryUsage().heapused
This is for how much memory is used
@robust moth what ??
How does one get all the emoji in a message but as images?
why does this work
if(!message.member.roles.cache.has('562486904935940106')){}
but not this
if(!message.member.roles.cache.has('Muted')){}
in my discord.js it allows me just to type "mute"
bow pro
?
its searching for an id, not name
okay? how do i make it search for a a name
use find
I cba to scroll up but ffs you beat me to it
like
if(!message.member.roles.cache.find('Muted')){}
?
@hazy sparrow u should learn basics once i suggest..
:l
having problems with find and even if-else isn't good
Cool
message.member.roles.find((e) => e.name === 'Muted')
// like this?
pls
can u not
having problems with find and even if-else isn't good
@jolly quail i dont have any problems with else if
idk try it
@robust moth process.memoryUsage().heapTotal / 1024 / 1024
U didn't know the correct usage of if else before xD
if (retar) return console.log('retar')
before
does anybody else using discord.py have an issue with high memory usage? my vps is using like 900mb rn
Illegal return statement
I'm going to ping a mod if you don't stop @unborn haven
Just do it
ok i stop : (
x)
if you need to advertise here, that really says a lot about the quality of your bot lol
your personality, too
haha no its actually ok-ish good
do u realise, everyone with the bot dev role is advertising their bot here 
i just dont know how to make it public
ok
do u realise, they don't post it in chat, and definitely not in the development chat 
Bottom.hh
no butok
hahaha
i might sound stupid but how do i find the bot's website

The what
htps
ye in that web
htps: SLS token
but if i want to upload my bot it asked me for a website url
skip it
can i?
yes
i might sound really stupid this time but whats the bot's prefix?
i know what prefix is in code but
whats bots prefix?




?
the prefix you gave it
alright, i am chaning to discord.js-light, what do i need to know?
My code: https://sourceb.in/71c61e04be
how can i make it like @earnest phoenixs where you do
text stuff | <user> because i want mine to like be easier and not contain the mention in the text only if it is in the text type stuff
You can read the docs for it in the readme @earnest phoenix
HOLY
It reduced my ram usage by 50%
how can i get someones id from when they join my patreon?
@earnest phoenix split message content "|"
I'm using javascript const dispatcher = connection.play(`${streamLink}`) to stream it to the VC. But it does not work on my Server,he connects but there is no sound. Anyone a Idea?
@earnest phoenix split message content "|"
@restive pebble how
My code: https://sourceb.in/71c61e04be
how can i make it like @earnest phoenixs where you do
text stuff | <user>because i want mine to like be easier and not contain the mention in the text only if it is in the text type stuff
@earnest phoenix like typing just their name or nickname?
both
omg
message.guild.members.cache.find(x => x.user.username.toLowerCase() === args.join(' ').toLowerCase()) || message.guild.members.cache.find(x => x.nickname !== null && x.nickname !== undefined && x.nickname.toLowerCase() === args.join(' '))
wait
name
;-;
dude
lol
@low marsh u sure its an playable stream?
@restive pebble yes,it's working on my local pc
just split it and check it
I'm streaming a m3u8 link
just split it and check it
@restive pebble bro how
message.content.split("|")
ok where put
u know what split does?
i dont think m3u8 sources are supported
i hate v12
but it's working on my local pc xD
I enjoy making bots, and up until now I have used discord.js, but with the API update coming Iโm thinking about learning to make bots using the straight api. Is there a good video to help start me out?
ฤฑ hate v12
same
i love you v11
@earnest phoenix i use regex, my own regex 
mp4 to mp3 to opus to mpeg lots of
@earnest phoenix i use regex, my own regex :facepalm:
@earnest phoenix huh
voltrex is typing so wait @earnest phoenix
ok....
<message that has a |> | <user>
This is why
Hmm | bro | <User>``` it will take `bro` instead of the user if use split
Is there a way to know if my bot was disconnected?
an event or something (djs)
voice
there is a shardDisconnect event iirc
voiceStateUpdate
<message that has a |> | <user>
This is whyHmm | bro | <User>``` it will take `bro` instead of the user if use split
@earnest phoenix uhh ok
voiceStateUpdate
what do I look for in voiceStateUpdate
+-- UNMET PEER DEPENDENCY @discordjs/opus@0.3.2
why tf
Can anyone help me please?
<message that has a |> | <user>
This is whyHmm | bro | <User>``` it will take `bro` instead of the user if use split
@earnest phoenix so can you help fix that
@earnest phoenix voiseStateUpdate then check if the old voice channel of the bot is available and the new one is null or undefined
kk
||I'm just starting out with C# and I'm getting an error when debugging:
could not copy: (//filepath) to bin/debug/netcoreapp3.1/test_1.exe. Exceeded retry count. Failed. File is locked by: "Test_1 (14948)
so ye idk what to do||
connection.on("disconnect")
X)))))
e
if the bot is disconnected on song end
it will work
if someone forced disconnected
still works
@earnest phoenix regex only way
Mention:
<args>.join(" ").match(/\w*\s\|\s\<?(@|@!)(\d{17}|\d{18})\>/)
ID:
<args>.join(" ").match(/\w*\s\|\s?(\d{17}|\d{18})/)```
Username:
<args>.join(" ").match(/\w*\s|\s\w*/)```
Here are the regex i made for checking them, but you gotta do the splitting and stuff yourself
i develop pancakes
hi, how to put your own emoji at the embed like it's totally permanent in there?
any idea how to fix this?
UNMET PEER DEPENDENCY @discordjs/opus@0.3.2
That isn't something you need to worry about.
Are you getting an error other than that?
nope
I'm streaming radio channels with a m3u8 link
and it's working on my local windows pc
but when I try it on my windows vserver it does not work
the bot joins,but there is no audio output
Ohh. then maybe you do need that, sorry for my bad assumption. go ahead and run npm i @discordjs/opus
im pretty sure u cant use npm in bash
doesn't work in an ubuntu terminal anyways
I think there is a problem with VS Build Tools on my server
@earnest phoenix installed build tools,installed node-pre-gyp and @cosmic surgejs/opus:
@quartz kindle do u have any idea?
smth is broken here
Tim probably does know but please try not to ping users for support.
I'm unfamiliar with discord.js, Maybe for the time being it would be better to ask in the official discordjs server.
hmm
@low marsh what's your error exactly
wym with host
From what device/service do you run it?
no,because it's working on my local PC and I have this problem since I updated to DiscordJS 12 and discordjs/opus
i get free stuff from my dads pedo van
@earnest phoenix excuse me
to stream the m3u8 I'm doing javascript const dispatcher = connection.play(`${streamLink}`)
@low marsh where did you get your windows server?
I rent this server from hetzner lol
hetzner is a huge hosting company lol
Hetzner Online GmbH is an Internet hosting company and data center operator based in Gunzenhausen, Germany.
It should not be confused with its former South African namesake and partner company xneelo (formerly Hetzner (Pty) Ltd) โ the two are separate companies registered and ...
if u want a free host which is actually good, i recommend using https://beta.libraryofcode.org
but where
return, it stops the code, so place it before it sends the perm thing thing
Hi, I have an array and I want to check if there are for example 2 same elements.
ex:
const array = [1, 1, 2, 3];
// I want to remove 2 elements (1) but first I want to check if there are 2 of 1
ah ok
return, it stops the code, so place it before it sends the perm thing thing
@misty sigil why before?
You could use filter and count how many elements equal X (1), but that's kind of inefficient on large arrays.
return message.channel.send("You do not have permission to mute people.");
so I tried streaming a mp3 link,this does not work either
https://YxriDev.com/test/ will you give opinions on loading speed and ease of use pls?
I want to make it so that when you click on this div it opens and closes, Tim, OfficiallyLost and I already tried to add an event listener by running a QueryAll on the divs with that class but that didn't work does anybody have a different solutiion?
Please @me if you have a solution
@obtuse jolt if you're talking about after you authenticate and get redirected to the index.php part, it's responsive and easy to use.
I assume this is a template though
Would it be better to move where the guilds are listed?
Yeah I have only done authentication so far
Login logout etc
And guild listing which is 50% done
is there any way (in discord.js) to add up more time to the timer in the reaction collector?
to make it wait longer?
yes
Yes hold on
Ok
@obtuse jolt https://oliy.is-just-a.dev/zu5pkq_5089.png it took like ~500ms to load for me
without cache ofc
with cache about 300ms
is there any way (in discord.js) to add up more time to the timer in the reaction collector?
@wintry wing create a reaction collector instance and simply use theresetTimermethod
in a message collector you can add .MessageCollector(stuff, { time: 60000 })
Would that work
In reaction collector?
that's for how long to run the collector for
I think they're asking like how to add more time to it
I'm not using v12 though.
ah in v11 resetTimer isn't available. There are a few ways you could get around it (e.g. just setting the timer to run for a long time, creating a new collector every time you want some more collected, etc.) Though I recommend you upgrade to v12.
im planning on upgrading to v12 due to the whole new discord api thing
You can use intents on v11
I don't think you can
You can but you canโt use the words
You have to use the numbers
And if you edit the v11 code you can change it from discordapp to discord
why though, that sounds like more work than necessary
because people refuse to update to v12
i dont
have it break!
once discord's changes go through and v11 breaks, people will start complaining and demanding a fix
then someone will make a fork and give it to them
free popularity points
lol
free contributions on github as well
mehh just use some api wrapper which doesn't upload breaking changes in every major version, or even minor versions
if you're too lazy to mitigate from v11 to v12
or smth
how to downgrade to discordjs v11?
@earnest phoenix why you wqnt tho
meh
just do the opposite of their guide saying upgrading to v11 to v12
Ah i see
why do you want to downgrade
wtf i accidently download v13
there is no v13?
and i accidentally built a shelf
Where is taggedUser
So not sure the best way to handle this, I want customizable news pages on the app im building, and it uses Vue. I have a socket.io server that supplies the news feed among other things on the site, would serving something like this:
{title: "Test", date: "July 19th, 2020", author: "AJ Nicoloff", microdesc: "Just another test", article: "<p style='font-size: 22px !important;'>Test</p> <p>Here</p>"}
as v-html="news.content"
which is unescaped content, be dangerous?
it's not user supplied content, it's purely my own content that I provide and have to manually update
Log taggedser
Oof
okay
Hmm
bow pro do you have a good understanding of JavaScript
looks like it's inside an object
yes it is
that's not gonna work
okay
Please don't try and make a bot if you don't have a basic understanding of javascript
Hmm
Especially if it's going to be public facing
its not gonna be public
@earnest phoenix https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html
Website with the collection of all the cheat sheets of the project.
im using it to learn JS
@quartz kindle I was just looking at that
What I got from it was as long as it's a trusted source it should be alright
is react good
personally I like Vue more than react
I find react to be overly complicated
not hard, but overly complicated
@serene kelp https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales
this may be what you need, not sure
You should be able to check validity against it
np! mdn is always a good place to look for random bits
is vue better or react
its all up to personal choice
oh
I love vue but hate react
It's actually really easy to get into yeah
If you like the bulma framework and are gonna use Vue, I'd recommend checking out https://buefy.org/
Anyone got any idea why this wont work
It should respond with Automatically translating messages from English to Chinese Traditional for #chtemp.
Try logging data.cmd.to.valid[0] to see what you get
Had it in the wrong place, but still does not work
so change const forNames = data.cmd.for.join to const forNames = data.cmd.for.valid[0]
langExceptions, langTo
You need to access the property of thelangExceptionsobject. LikemyObject.myPropertyormyObject["myProperty"]
sorry, im a tad confused
obj = {
a:10,
b:20
}
console.log(`${obj.a}`) // "10"
console.log(`${obj["a"]}`) // "10"
console.log(`${obj, a}`) // ???
wouldn't that require me to predefine it, so if i defined it as obj.a but user uses b then it would respond with the wrong value
no
ok, deploying now i will test
Can someone help me
I'm not able to make the music code for the bot because I use cell phones
Someone there know explain to me
Okay
how r u trying to get the zh-TW message, @tranquil sable ?
From here, zh-TW is not a support language, so fr would return French, gr would return German, but zh-TW is not is not in the ISO of support languages, so im trying to create an exception, so if someone puts zh-TW it will still give a response and not be blank.
i tried the above and did langExceptions[langTo] but that did not work
is that what you mean @digital ibex
u can use if/else
is it supost to be highestrole or roles.highest in the code
if (message.content.startsWith(`${prefix[0]}kick`)|| message.content.startsWith(`${prefix[1]}kick`)) {
try {
if (message.channel.type == "dm") return;
if (!message.member.hasPermission("KICK_MEMBERS")){
message.channel.send("You need kick permissions to kick people!")
}
if (!message.member.hasPermission("KICK_MEMBERS")) return;
var reason = message.content.split(' ').slice(2).join(' ')
if (!reason) return message.channel.send(`Please provide a kick reason!`)
if (message.member.hasPermission("KICK_MEMBERS")){
var member= message.mentions.members.first();
if (message.member.roles.highest == member.roles.highest) {
message.channel.send(`No kicking people with the same roles as you!`)
}
if (message.member.roles.highest.position < member.roles.highest.position) {
message.channel.send(`No kicking people with higher roles than you!`)
}
if (message.member.roles.highest == member.roles.highest) return;
if (message.member.roles.highest.position < member.roles.highest.position) return;
member.kick(`Kicked for the following reason: ${reason}.`).then((member) => {
message.channel.send(`Kick for the following reason: ${reason}`);
}).catch(() => {
message.channel.send("I can't kick people with an equal or higher role than me!");
});
v12
d.js
@earnest phoenix can you send me the embed code for that? seeing it mihgt help me more, i think it is off center because it is not in the same heading.
sure
return await msg.channel.send({
embed: {
title: " Missing Permissions",
color: 0xFF0000,
description: "You do not have permission to execute this command."
}
});```
hold on
ty
@earnest phoenix is it like that for all embeds
any emoji i put in the title does this
ima see if it does it with my bot @earnest phoenix
ok
it's off center because that's how discord structures it for some reason
if (message.member.roles.highest == member.roles.highest)
errroed out to
TypeError: Cannot read property 'roles' of undefined
at Client.<anonymous> (/home/container/bot/bot.js:345:50)

