#development
1 messages · Page 541 of 1
@quartz kindle are you satisfied with my translation
yes
just do
if urthing isnt a number tho it wont work i.e if its "five"
Thats how its erroring
"If a personn write ?gift @User NOTNUMBER my bot crash"
Get some better error handling then a bot should never crash because of that >_>
also
Yes i know but is it an exemple
So ? How ?
if(isNaN(Number(a))) { return }```

if(isNotNumber(...)) yeetThatArg()
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]](([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])```
what
Too bad Fishy's baguette explaination is 2 messages.
How would I go about making a command to check Discord.js docs?
Can someone point me in the right direction if you know
uh
heck i can't fit the whole code in here
lul
Hm
scrape the docs or find a js parser
how would you ignore something in a for/of loop
ignore something or skip an iteration?
continue
ignore something
for(const thing of things) {
if(shouldIgnore(thing)) {
continue;
}
}
or use filter/forEach
thanks
for(const thing of things) {
if(shouldIgnore(thing)) {
yeetThatShit();
}
}
const thing of thing = lmao
How would I do a case number type thing for a ban, kick, mute, etc commands
by storing the current case number in a guild config
Is there a better way to get the message count in a channel in Discord.NET than just setting the limit to 2,147,483,647 in GetMessagesAsync(); ?
Because that just seems counterproductive to me
@last ferry if you read the docs or tooltips you can only get a max of 100 messages but you can use GetMessage(messageID) to get older messages thats if you want to track messages/update messages
wrong, you can request as many messages you want, the API limit is 100 so Discord.Net splits it into multiple requests, hence why you need to flatten the collection
speaking with increments of 100, the more messages you request the longer it takes for the task to execute
also there is no way of getting all messages in a channel and counting them a reliable way, dont spam the api by downloading god knows how much messages, which having 2 billion messages in cache would probably crash your app
How to mame bot online 24 7 from this web
You don't want too tbh
But if you want to really do t
it*
Look it up I don't bother with gltch
glitch
Just
Replace the files on glitch with your bots files
Its fucking intuitive
If you cant even figure out glitch you shouldnt even bother with 24/7 hosting
dont use a free host, period
Real-time performance monitoring, done right! https://my-netdata.io/ - netdata/netdata
just make glitch ping itself
a dumb question. how can i loop foreach trough that ? https://i.imgur.com/ue49NMi.png
.foreach(fucntion(element) {}) does not work
forEach
@modest shore your already using map
can i get some help?
npm ERR! file /Users/MELOL/Desktop/SDLB/package.json
npm ERR! code EJSONPARSE
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token “ in JSON at position 3 while parsing near '{
npm ERR! JSON.parse
npm ERR! JSON.parse “name”: “shittylistb...'
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/MELOL/.npm/_logs/2018-12-25T16_45_39_174Z-debug.log
newbie
i am
its working now with foreach
don't use discord.io
what should i do then
discord.js if you really wanna use node
or eris
also why are you installing Winston isn't that just an over glorified logger
LOL
that outdated one
no
lmfao
use https://discordjs.guide or something
A guide made by the community of discord.js for its users.
not that, it's outdated, discord.io sucks anyways
and stop with the caps
Why the heck is that article under gaming shouldnt it be coding or development lmao
^
@inner jewel the comments on that article also say the " are wrong to copy

Good article
lu
l
also
how do i make my bot not case sensitive
?
who niccnamed me
what do you mean not case sensitive
like the arguments sent to it?
tfw you expect people to instantly help you but not reply back when they actually help you

how do i make my bot not case sensitive
doesn't that mean your bot is already not case sensitive?
thats what they want, not what they have
when you contradict yourself
convert the given command and the expected command to lowercase/uppercase, then compare
lowercase the arguments when you compare them ¯_(ツ)_/¯
if you're using javascript it's just ```JS
"".toLowerCase()
I suggest you learn how to program in JavaScript before diving into bot development
I asked Xignotic to pin some extremely useful books containing information about JavaScript and other stuff
You should read that or at least research online for how to do basic JavaScript functionality
that's non-javascript-languages-ist
huh?
my point being that there are other languages for bot development that a beginner can learn
they're using js
oh they are?
A guide made by the community of discord.js for its users.
then nvm
yes
i am

when its christmas and i still cant get my bot to receive webhooks. sadface.
i have the dbl url set as my_public_ip:port/dblwebhook and am using the dblapi to receive the webhooks, but no luck ;-;
Hello
Could you help
I am writing in discord.js
And I am wondering how I could make it so it forces a user to mention a role and then the bot recognises the content and adds the role through the @
You can’t force people to type stuff
so basically all your commands are initiated through mentioning a role?
“And I am wondering how I could make it so it forces a user to mention a role”
oh i see
Would you like to see a code sample?
i am not 100% sure but just check using message.mentions.first() and if its a role give them the role if the mention does not exist, tell them to mention the role
Hmmm
so look
I tried doing it
but It deosnt work
if (!roleName.content.startsWith("@")) return message.channel.send("Mention the role!")
if(!args[0]) return errors.noRole(message)
const role = message.guild.roles.find(role => role.id === roleName);
if(message.guild.roles.find(role => role.name === "GAWD")) return message.channel.send("You cant join a staff role")
if(!roleName) return errors.cantFindRole(message)
let member = message.member;
let joinembed = new Discord.RichEmbed()
.setAuthor(message.author.tag, message.author.avatarURL)
.setColor("#bc0000")
.setDescription("You have successfully joined " + roleName + ". To leave the role, say ``-leave-role <role name>``");
await(member.addRole(role.id)).catch()
message.channel.send(joinembed);
message.user.send(joinembed);```
I tried to start doing it
.find(role => role.id === roleName)
also
role mentions never start with @
they're always <@&ROLEID>
message.mentions.first() this in incorrect btw
message.guild.roles.find(role => role.name === "GAWD") won't help you either
it'll just lock the command if any role has that name
ik You cant join admin roles
i mean you can just do using message.mentions.roles.first
and then check the role against what's permitted
not valid
How would I throw the error message if its not a mention?
what isnt valid?
you can have a variable = to that value and if the variable is NULL, there was no role mention
message.mentions.roles.first
Are you trying to check for a role mention or a role name or a role I'd?
well obv by first i mean first()
@languid dragon Role mention
Use regex
i'm pretty sure its valid samurai
const foundRoles = message.content.match(/[<@&]+([0-9])+[>]/g);
if (foundRoles && foundRoles[0]) {
const role = message.guild.roles.get(foundRoles[0].replace(/[<@&>]+/g, ''));
}
if (message.mentions.roles) {
if (message.mentions.roles < 0 {
// Stuff //
} else {
//stuff//
}
}```
or like i said they could just the first value using first()
unless you mean they wanna assign multiple roles at once, then sure ig
snowy, are you free to help me for a minute with webhooks, i'm like lost.
No I'm about to sleep, look in #topgg-api for an example I wrote
i tried everything its just im not receiving anything on my public ip, but thats fine, good night ^^
@inner jewel help me big boi
@coral trellis ur missing a closing paren
Yes
@keen drift ?
Which database does the site uses? Just asking
Can anyone tell me how sharding works, like do I need to make another discord bot on the developers pages, I know the code to shard, but is there anything else I need to do
Thanks so mch guys I managed to get it to work
@languid dragon
Sorry for the ping
just wanted to thank
@amber fractal no
Sharding is basically attaching additional data to the identify opcode

How can I get a total count of shards in a command?
https://discord.js.org/#/docs/main/stable/class/Shard doesnt seem to help or Im blind
Read 👏 the 👏 docs 👏
I'm 👏 on 👏 the 👏 docs 👏
@amber fractal shardmanager
Lol thanks
Hello
hola
well definitely not by trying to use bot commands here
ik
needed to show them
cause they wouldn't believe
cause there are a few people that ask for approval even by posting links to their bot pages
"Bot awaiting approval - Please be patient, us humans take time to verify bots!"
@bitter sundial would there be a way to make it more obvious by making ^ that message be more visible on top of the page instead of at the very bottom of long description?
Is the first shard ID 0?
yeah
Alright
so i have this bot that i host from a pc, and i want to receive webhooks, i have tried the pinned example of an express application in #topgg-api and when i enter :
http://my_public_ip:port/webhook/url in the dbl website and try testing, i do not receive the webhook. I'd appreciate any help at this point ._.
you mean by entering the ip and port in the url?
by if you could reach it in your own browser
yeah hmm i can't O-o that's weird

ugh i cant even host it on glitch cuz it doesnt support mysql x.x

glitch
I have a feeling that all free hosts are overrated
wew
As soon as I can afford something real I'll begin using it lol
I definitely don't use heroku
well today I've just got my first patron so I don't worry about financial issues anymore hosting my bot
Them are big bots tho
you don't need to be certified to be big
it is
*mee6
would this be the way to find direct it to the .js file?
require('./global/functions.js')(client, utils, ytdl);
Uhh no
how then
What are you trying to do?
its a function which im trying to make music commands in a command handler
to make the function global
Whats the function name?
require('./global/functions.js').play(client, utils, ytdl)```
what about handleVideo?
are there any good alternitives to toLowerCase
let me show you my function file
or toUpperCase
Same way, just replace the play function with handleVideo and given arguments
@earnest phoenix no but thanks to js you can simplify them
const lower = toLowerCase
`IM A DIRTY HOISTER`.lower() //`im a dirty hoister```
that's just more work
just use .toLowerCase() and .toUpperCase()
@earnest phoenix ah, personally i would seperate the 2 functions into different exports (in the same file of course)
Then just do what i told you to
this doesn't even work https://zero-two.is-a-good-waifu.com/a39653.png
ff
oh
fffff
lol but yeah
require('./global/functions.js').play(client, utils, ytdl, config);
it makes my commands not work
like that right?
String.prototype.lower = String.prototype.toLowerCase this would do what you wanted @mossy vine
Look, im on phone and just writing stuff from memory, i cant check it @inner jewel
@earnest phoenix yup
anyway
its keep saying cant find module ./global/functions.js
if (message.content === '+list shitty orochi'.toLowerCase) { message.channel.send('2. Shitty Orochi'); }
correct?
@mossy vine its keep saying Cant find module ./global/functions.js
@earnest phoenix can you show your dirsctories
@earnest phoenix toLowerCase is a function..
@earnest phoenix how good are you with javascript?
I reccommend you check out w3schools.com it can answer 99% of your questions if you look hard enough
Wrong link
Smfh
smfh tbh
Wrong link x2
UGGH gimme a sec
w3schools.com should be correct
Yup, thats the one
@earnest phoenix can you screenshot your bots directory?
In the global?
yes
I mean, whats in the global folder 
I wanna see what files are in the folder, not the contents of the file
Aha, i think i see the issue
Youre calling it from a file in the commands folder, right?
The functions?
Well, still worth a try
require('../global/functions.js')
but it has this
module.exports = (client, ytdl, config)
which it will need
require('../global/functions.js')(client, ytdl, config)
right?
Correct
ok 1 sec
If it errors, show your main.js file
Show main
I thought it was one dot not two
Two is for going up a directory
i dm it to you
@mossy vine i dmed it to you did you see it?
Try pasting the require in a command
Lmaoo
XD
What did you do?
client.on('message', message => { if (message.content === '+list shitty innards') { message.channel.send('**1. Shitty Innards**'); } can somebody just edit this to toUpperCase? im so fucking confused
i just forgot to transfer the gobal folder
XD
i just dont get it
stfu
Im tryinf to help you
ik
No reason to be toxic
its unclear tho
Learn javascript then, w3schools.com will answer all of your questions
i could take it as
client.on('message', message => { message.content.toLowerCase() if (message.content === '+list shitty innards') { message.channel.send('**1. Shitty Innards**'); }
if thats what you meant then
but im calling it that its not
I mean.. Thaz could work
so does that mean
i would be able to write
+list shitty orochi OR +list Shitty Orochi?
capatlization wouldnt matter? \
No that wont do anything
Correct
cause i would think that toUpperCase would be the only one that worked
your still using message.content...
Do you know how to do that?
...
tbh i know basic javascript
im not a fucking idiot either
making a variable is basic
Did you even look at the site
YES

Please for the love of god, learn javascript. Basic is not enough for a discord bot
It literally tells you what to do there
^
var input = "SomEthIng";
var output = input.toLowerCase();
Expected output: something
if you actually used it
like a console.log
https://developer.mozilla.org/en-US/ also good
Sololearn is decent as well
got it
Wew
not really i just understand theres a fuckload of good websites out there tbh

ok
Then learn javascript and stop bothering us with questions that you can easily google and get answers to in seconds or minutes
@mossy vine hi can you help me learn JavaScript 
@keen drift i can direct you to useful resources
Naw you better personal tutor me
Meh, ur cool so ok

Hey guys its me again
Hi
I am making an add role command
Alright...
discord.js
@mossy vine hi what does this do 
([][[]]+[])[+[]]+(!![]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+!+[]]]+(+![]+[![]]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+(![]+[])[+!+[]]+(+[![]]+[+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])])[+!+[]+[+[]]]
You may be missing a )
Spamm
I am just wondering, How would I make a check that sees if the role is a certain list of role before continuing e.g Colour roles allowed but staff roles not
does !! work as a double negative tho that'd be awesome
Yes it does
Are you hard coding in the roles you want it to be?
fuck it im done for today
thank you guys
@mossy vine https://i.imgur.com/nIPKIBC.png
@amber fractal I have no choice
@earnest phoenix just ifelse?
Thats.. Not an ifelse...
I'd suggest then to make an array of the roles you dont want it to have access to. and see if the role they are attempting to give matches any in the array. if it does then return a message or something
@mossy vine No but I need to list my colours
Wait
Im going to sleep, ask someone else
I think I misunderstood the question
so like if (msg == blacklist) return
You'd have to loop through an array, atleast thats the easiest way I see of doing it if you are hard coding the roles
Also, bots cannot give roles that are above them
If you want to use that as a solution
@amber fractal How would I create a blacklist of all the banned roles?
In an array?
Those are the roles you want it to be able to give, yes?
Yes
I also have a msg variable
ill send it
return this.charAt(0).toUpperCase() + this.slice(1);
}``` -This make the first letter of a certain args capital
msg = args[0].toLowerCase().capitalize()
There
Thats to make it non case-sensitive
What way are you using discerning between the command and the role to give/user to give it to?
Oh wait
So what happens is
You already split it?
?
lol
Hi
Hi
I have a problem
Wait
Lol
My code
Is the msg variable their entire message or just the command
All I want to do is
Lol
for(var i = 0; i < array.length; i++) will loop over it
Hi, i have a problem, my code : https://hastebin.com/ihopevitur.js
My error : Cannot read property 'send' of undefined
Who can help me ? Plz ? 👏
Lol
You can figure out what to do after that?
@keen drift ? 😃
?
Sure
@lofty hamlet yes?
You can help ?
Hi, i have a problem, my code : https://hastebin.com/ihopevitur.js
My error : Cannot read property 'send' of undefined
No you plz
what
Helping another person gimme a sec lol
i did 
uh
?
how to look at this code
yeah except idk what Discord.Channel is
you should add a check for DiscordChannel to see if it's defined
Discord.Channel is exemple : 1262137122189
No : exemple : 6123132832181288
@keen drift
yeah add a check for DiscordChannel to see if it's defined
@amber fractal u available 
DiscordChannel is undefined
No
?
var DiscordChannel = member.guild.channels.get(Discord.Channel);
My error : Cannot read property 'send' of undefined
Look
the only send I see is on DiscordChannel
var DiscordChannel = member.guild.channels.get(Discord.Channel);
Impossible : look : var DiscordChannel = member.guild.channels.get(Discord.Channel);
It's entirely possible
If the data is not available in the collection
It's undefined
.get() only retrieves from cache
If it doesn't exist, well, it doesn't
it returns undefined
In what collection ?
var DiscordChannel = member.guild.channels.get(Discord.Channel);
And discord.channel is for exemple : 1267217821838
???
I don't understand
My other command for test
Is :
var DiscordChannel = message.guild.channels.get(Discord.Channel);
DiscordChannel.send('TEST')
}```
Is fonctionnaly
Returns the element associated with the specified key or undefined if the key can't be found in the Map object.
undefined if the key can't be found in the Map object.
Look my message
My other command for test
Is :
var DiscordChannel = message.guild.channels.get(Discord.Channel);
DiscordChannel.send('TEST')
}```
ok
Is fonctionnaly
i get the feeling they dont know english
lol
I'm french -.-
if baguette doesn't exist in the basket, then you don't get a baguette
lol
But my command test is fonctionnaly
ok
I use google translate
but this is different?
Just look
I'm l00king
wait how do you get fonctionnaly with google translate 
new word
fishy r u intentionally making it impossible to translate smh
i dont think it can translate l00king
well idk what to tell you
So i don't understand
Just look my code ...
.......
Yo
Hi ..
So what is the problem?
He's getting an undefined upon his .send
DiscordChannel.send(attachment);
It's initialized and declared at var DiscordChannel = member.guild.channels.get(Discord.Channel);
.get() returns undefined it's not available in the cache
You're trying to send this to a specific channel then?
then he showed me another command
in which I still have no idea where Discord.Channel even come from
I only can locate the error origin in the hastebin provided
Yes Discord.Channel is a string in json
@amber fractal have fun
It only says member.guild
??????
You want it to be message.member... dont you?
Hum
var DiscordChannel = message.guild.channels.get(Discord.Channel);
DiscordChannel.send('OYEYEEE')
}```
This command is fontional
But in guildmmemberadd is not fonctional
....
Look my code
Unless he sent it wrong
var DiscordChannel = member.guild.channels.get(Discord.Channel);
?
Thats what it says
?
Yeah ?
So ?
Ok so ?
message.guild.channels.get vs member.guild.channels.get
How am I doing?
?
the code you sent is the one that doesnt work right?
Yes because the first message is a command and the second for guildmemberadd
What ?
Yes this code :https://hastebin.com/ihopevitur.js
Is not fonctionnal
The error is send is not defined
var DiscordChannel = message.guild.channels.get(Discord.Channel);
DiscordChannel.send('OYEYEEE')
}```
And this code
Is fonctional
@amber fractal
What is the error did you say?
Cannot read property 'send' of undefined
on line 54?
Can you send a picture of the console?
wait
i test
at Client.bot.on (/home/Akimitsu_Dev/welcome.js:136:24)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
(node:19561) 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(). (rejection id: 1)
(node:19561) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@amber fractal
My code :
if (Discord.Active == false) return
var DiscordChannel = member.guild.channels.get(Discord.Channel);
const applyText = (canvas, text) => {
const ctx = canvas.getContext('2d');
// Declare a base size of the font
let fontSize = 42.5;
do {
// Assign the font to the context and decrement it so it can be measured again
ctx.font = `bold ${fontSize -= 10}px sans-serif`;
// Compare pixel width of the text to the canvas minus the approximate avatar size
} while (ctx.measureText(text).width > canvas.width - 300);
// Return the result to use in the actual canvas
return ctx.font;
};
const canvas = Canvas.createCanvas(700, 250);
const ctx = canvas.getContext('2d');
const background = await Canvas.loadImage('./Welcome.png');
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
// Slightly smaller text placed above the member's display name
ctx.font = 'italic 25px sans-serif';
ctx.fillStyle = '#2A2A30';
ctx.fillText('Bienvenue sur le Serveur', canvas.width / 2.7, canvas.height / 2.1);
// Add an exclamation point here and below
ctx.font = applyText(canvas, `${member.displayName}`);
ctx.fillStyle = '#2A2A30';
ctx.textAlign = 'center'
ctx.fillText(`${member.displayName}`, canvas.width / 1.7, canvas.height / 1.5);
ctx.beginPath();
ctx.arc(125, 125, 100, 0, Math.PI * 2, true);
ctx.closePath();
ctx.clip();
const { body: buffer } = await snekfetch.get(member.user.displayAvatarURL);
const avatar = await Canvas.loadImage(buffer);
ctx.drawImage(avatar, 25, 25, 200, 200);
const attachment = new Discord.Attachment(canvas.toBuffer(), 'Welcome.png');
DiscordChannel.send(attachment);
})```
Thats saying it cant send to something that's undefined not that send is undefined.
So ?
dude fishy already explained it to you
add message function to event?
if its DiscordChannel.send and it has that error then DiscordChannel is undefined
and use message.channel.send?
Yes so ?
That wont work in every server you know that right
Why ?
...
we wont just give you fully made code
No
..?
nebulus, only you know how your code works
we dont
we helped you based on the info you gave us
272764566411149314 is the id to #development in the Discord Bot List channel and only that
I gave all my code
but you coded your bot and only you understand how it works
The ID is unique.
No
where did you define Discord 
It's my bot of developpement osef
His picture had a token in it
...
never leak your token
someone can log in to your bot and do anything
including destroying a server
It's my bot of developpement osef
that doesnt matter...
...
We've been trying
You have all of my code
i asked you where did you define Discord
The channel you're trying to send to is non-existant
^
so that code will only work in the server with that channel
You want more ?
no
No look
i told you the issue
you're probably using the command in a server that doesnt have that channel
Thats a welcome message
Look i try
You seem to be over complicating the task.
We cant just give you code
I give all my code
Read the docs, it gives you the code for a server greeting with explaination in the code
You dont need to have a json file with channel IDs
You are trying to make a welcome message right?
WIth a picture.
Discordjs big gay
?
We cant just edit
Why ?
help vampire
ur a fish
ur a turtle
what do you know about spoons
I eat from one
You are one
🥄
It takes me a while to get to my good so people feed me with a spoon
hecc there are fish vampires too
Nobody want help me ?
Look! Everything is just I do not understand
My command :?welcometest work but why my event addmember is not fonctionnaly is simmilary ! Wtf
😦
guys, I have a question.. I made a tempmute system which uses scheduled thread to unmute people. I wonder if this is a good way to do it or if I could use a more effective method ?
np x)
@frozen tiger Perhaps store data in a database, and do periodic checks on that thread
what language is it?
Java
Oh, Im a newb in java just javascript, sorry
😞
@keen drift I had this idea but I was like hey, if someone wants a very short this is not good but so I need to check very often but if tons of case are very long, it could cause performance issues
Like constantly looping case
Sounds horrible
Yeah, what happens if that thread dies or shut down
Does that temp mute ever get resolved
It should never happen x)
should
tbh when bot starts up, It loops every stored case an re-schedule threads soo I should make check every 30min maybe
and reschedule dead threads
not sure what the cost is of starting a new thread
But it's not that bad to query a database for unMuteTime < currentTimestamp
I would query a redis for that honnestly
let's just call Natan and he'll tell us Fishy
kek

if you are that worried about performance on db query, i'd worry about too many threads
this is why I ask here x)
yeah I'd go with the db route, but idk about yours
I'm afraid tons of thread could lead into crashes
Every minute?
@inner jewel what does it cost to start a new thread
let me check how often
thanks

what language?
java threads are 1:1 with OS threads, so it's expensive
use a scheduled executor service

don't use Timer/TimerTask
okay
shhh you

each timer = 1 thread

So I should create an instance of ScheduledExecutorService and schedule unmutes through this?
done
thank you so much
And just another question
Is it clean to make this instance final and static in my main class?
(don't hit me)

you can
but this is horrible
How do you check if a user has a permission ?
Docs
Has anybody got any places where I can learn js, basic all they way to advanced?
w3schools?
youtube
codecademy
pornhub
Hi
I need help with sth.
function play(guild, song) {
const serverQueue = queue.get(guild.id);
if (!song) {
serverQueue.voiceChannel.leave();
queue.delete(guild.id);
return;
};
console.log(serverQueue.songs);
const dispatcher = serverQueue.connection.playStream(ytdl(song.url))
.on('end', reason => {
if (reason === 'Stream is not generating quickly enough.') console.log('Song ended.');
else console.log(reason);
serverQueue.songs.shift();
play(guild, serverQueue.songs[0]);
})
.on('error', error => console.error(error));
dispatcher.setVolumeLogarithmic(serverQueue.volume / 5);
serverQueue.textChannel.send(`🎶 Start playing: **${song.title}**`);
};
Anyone know what's wrong with this? I use .js
- what lib
- whats the error
discord.js
error is when the bot joins, it ieaves while posting (undefined) to the console
and then sends the 'Start Playing' message

so sth is wrong with the part before the serverque.textChannel.send part
@amber fractal Can I see that?
I can't post the code directly. I'm on phone rn
so as soon as it joins the vc it leaves without playing anything right?
yeah
But literally all my bots are open source on github
a common error
ok steven, I'll see thx
@amber fractal welp on your github and yes, it's 99% the same
lmfao
hm, how would i detect upvotes in discord.py
lmao
Who know the pdo connection?
Because i need to write in a database when a user is login to discord in my website
?
?
wdym edit it
nvm








