#development
1 messages · Page 644 of 1
One message removed from a suspended account.
TypeORM is fantastic ✨
please @humble gyro change my name Reey
Lol he's not a mod
Lol I'm not a mod
ohh kirain
And no, pls dont ping the mod role, ping a specific mod
okay
Ping someone who's busy so that u can annoy them
im from indonesia halo
hello
@opaque eagle where you country
I'm from the U.S., New York specifically
Idk depends... the winters are rough
I'd love to someday move to a smaller city tho
Like Philly or Boston
and also wifi here is cheap wkwkwkw for example rich wifi my republic here 100Mbps only $ 15
omg that's a steal
"that's a steal" means that's a good deal
ohhh yes broo
My microsoft account keeps getting login attempts from indonesia for some reason too bad they don't know my pass 
One message removed from a suspended account.
yeet ask2ask
By asking if you can ask a question, you have already asked a question so simply just ask the actual question. State exactly what the problem is so someone can help you as soon as possible.
CJelly, what do you need
Please provide as much information as possible to get the most efficient assistance as soon as possible; state the library, language, the specific part of the code in question, and what you are trying to do and/or what you think may be causing the error.
/memes
Glitch is not recommended
please dont
don't use glitch
don't use glitch unless you want a glitch
@mossy vine its working fine for me
glitch works if your bot is tiny and you don't mind downtimes 
just because its working well for you doesnt mean everyone should use it
don't panic
@spare goblet hmm true
do prepare that your uptime will not be 99.999% (perhaps like 95% if you watch your bot SUPER closely)
if you don't have money for a vps, you can at least run it on a old computer you barely use
yes
the free options are either p impossible to use or has lots of problems due to the free nature of it
@earnest phoenix Discord Presence extension
yeah you can, just use an extension or just use discord's default one
extension one gives you more info in-depth tho
just google it and you'll find it 
no
on vsc extensions lol
just google "vsc extension discord presence"
you can also find it in vsc tho
in extensions tab
What is the thing isWeekend ?
Not sure what youre referring to ^
There are multiple extensions but yeah that should work
@amber widget during weekends, votes count double.
You can use the isWeekend property to know if it's active or not (So you could give additional rewards to those who vote while it's active)
@late hill Many thanks, Weekends is every Saturday and Sunday from a week ? I know what is weekend but just want to know if there is the same for dbl ^^.
Could you please keep the bots previously submitted and add an option to resubmit via the website?
Kinda saves time and headache
Woops
@coarse vapor this channel's for asking questions and chatting about development and not for suggesting or sending files, so 👀
Wrong server xd
Yikes
I thought I was in my bots server, and iOS doesn't allow you to see what channel your sending the file to very easily
Lel
How do embed character limits work with masked links? Would the entire link count or only the length of the displayed text?
the entire thing counts
rip
you are sending the markup/markdown content, discord checks if it fits all limits, and client renders it as link
right
discord API rate limits for messages are 5/5 right?
there's no "set in stone" ratelimit
they're dynamic
if you spam the endpoint too much they will change for you
thanks
(That's what I keep forgetting, ty fam)
hopefully this will be a safer engine, it had no protection before... 
is there a way to disable those lines in vsc insiders
Settings
@ionic compass if that's discord.net, it handles ratelimits for you, you don't have to do much
preemptive ratelimits exist only in the library, it just tells you that you got ratelimited and that it will put your requests on hold
thats true, but there was also a uh... pretty bad exploit in the script engine allowing for infinite looping of two or more commands 
Je t'aime moi aussi ! @ionic compass
Je t'aime moi aussi ! @earnest phoenix
Je t'aime moi aussi ! @earnest phoenix
Je t'aime moi aussi ! @earnest phoenix
Je t'aime moi aussi ! @earnest phoenix
questionmark
Je t'aime moi aussi ! @earnest phoenix
Je t'aime moi aussi ! @ionic compass
selfbot
@earnest phoenix Please don't spam
it's a selfbot
they had no typing indicator when they were sending messages
discord send my message please
hello discord
.
Mhm, I can see it now
thank you
do maps save permanent or temporary data
js by default doesnt write, so its temporary in a way like every other variable is
if you dont need to load it on a bot restart, its good
yeet dotpost
Please do not post random punctuation marks or letters to clear your messages and/or to get attention. This is considered spam as you are not contributing anything to the conversation. Should you need to get the attention of the chat, simply start by saying hello. Should you need to clear your messages, right click on the channel then click "Mark As Read"; this can be done from mobile by holding down on the channel. Further offences will result in the appropriate consequence.
You'll want to use a db if you want persistent data
^
Then you wont have persistent data
heroku
Heroku cant even write json files
iirc you can use mongodb atlas to get around that
they basically host a mongod instance for you
does heroku allow that ?
of course, since you arent editing any files locally, but sending requests to the mongo server
its free until you hit a certain limit afaik
but you could use clever data structures to use it to its fullest
or until you can get a vps
@earnest phoenix https://docs.atlas.mongodb.com/
Doesnt heroku have its own postgre integration?
Afaik its also free until certain limits
this is more of a general programming question, but i basically wanna shuffle the elements of an array. how many swaps should i do for n amount of elements?
lol
@mossy vine get the array and use a random number generator tied to the array?
i know how to shuffle an array, just dont know how many swaps i should do for n amount of elements
n^2 is likely overkill and n*2 is likely not enough
hm
@earnest phoenix which command list?
Oh
ok well time to shamelessly repost my question
this is more of a general programming question, but i basically wanna shuffle the elements of an array. how many swaps should i do for n amount of elements?
for n amount of elements thats a shit idea. what if n is over 100
Google can answer your first question and for the second you could just slice the shuffled array by .slice(0, 100)
im thinking of doing either n*3 or n*4 but idk if that would provide results that are good enough
Off topic content spotted
oh thanks discord
This is #development just in case
#memes-and-media for blogging
hmmm ill try with n*4
how to do a random answer Command?
Hmm true
@stray garnet If you need like random message to a command look here
Import random
msg = ['randommessage1', 'randommessage2']
await ctx.send(randomchoice(msg))
One message removed from a suspended account.
can you cant?
Lol
@trail dagger hmm i Made it Harder
const Discord = require("discord.js")
module.exports.run = async (bot, message, args) => {
let replies = ["sample text 1", "sample text 2", "sample text 3"];
let result = Math.floor((Math.random() * replies.length));
let question = args.slice(1).join(" ");
message.channel.send(replies[result]);
}
module.exports.help = {
name: ""
aliases: []
}
ah shit discord.js
Yes exactly
i just saw "how to do a random answer Command?"
@stray garnet Please use code blocks next time
@split hazel sry
```code block```
I hope there's someone good at JS now, this is not not related, I hope it doesn't matter, I need any help I can get 
url: requestURL,
headers: { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json' },
json: true,
dataType: 'json',
body: { "name": document.getElementById("playlist-name").value, "description": "Recommended tracks based on genre(s): " + genres + ". Playlist generated using Spup."}
};
this results in document not defined error, instead of the thing in the text field every time...
Where are you running this?
document is a browser thing, is only exists in browsers, not in node.js
If you're running it in a browser, make sure you're not running it too early
thanks, I already found out that it only exists in a browser, that was the thing...
It takes a bit to update. Did it not update yet?
Are you applying for your bot to be listed on DBL?
try editing your bot and resubmitting it
@earnest phoenix refresh the page with ctrl + shift + r
Is there also a way to get all users instead of online user count with Discord.js?
This is the counter, but i bet there are here 50000+ users...?
you can use memberCount on a guild object
Tsiica thats fetched members
Hmm ah
yeah use reduce() with mapping member size for each guild
Yeah i use now: client.users.size
that will give you cached users
Aha
Never understood MemberCount 😅
for a better result map the guild members size, and use reduce()
thats the complete amount you would need
Aha, is there a example where i can look? 😃
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce, when you map members size for each guild, it will return in an array, so you can use the reduce here.
Aha!
For further questions if you have, ping me please. Probably wont see if you type :D
Haha yeah it's really busy in here 😛
But don't really understand the memberCount part.
aight so do you know how to use collections?
Sort off 😅, don't work much with that part.
ah, then you should. Heres some tips that I can give, you should map the every guild by client.guilds.map() and turn all guild member size in an array
Ah yeah well i understand that part 😛
The only issue is the memberCount(), there is nothing on Internet about it...
Or i just searching wrong 😅
no need to look web :D every guild has a member amount so you should use size among their members
Ah
seems confusing but it isnt
Yeah XD
I'm sorry 😛
confusing to explain xD
Yeah
Learning MVC is a nice thing 😉
Makes Programming so easier, and so cleaner
see that Tsiica
Alright thanks! 😃
thats how map works generally
Yeah i see, but i don't know how to get the data of the MemberCount or to call it 😛
Never used that function of Discord.js, and there is not really much info about it.
Well look member is belonged with guilds, so you need to map every guild first. Every guild is mapped, and you need to get the member count for all. That might be confusing because explanation is hard
Yeah true. 😛
do you have an eval command?
No 😅 those are really dangerous xD
¯_(ツ)_/¯
Have made one xD
Strictly only on owner ID.
°-°
@fossil oxide can you add a LOOP button ?
wdym loop button
if i want to send a message to a specific channel and it's not found, how can i create a channel with some permissions? I need some advice.
oh, discord.js
do you know how to create a channel?
I am not really proficient in discord.js, but you can use try and catch.
try to send a message
depends on how you find the channel
The docs confuse me so much at times, idk why.
if you are using an async method to find it, then try catch wont work
upon error, make the catch create the channel
i mean, the docs are clear and even provide examples
yeah haha i sometimes don't clearly look at them
<@&304313580025544704> do you know if there will be any loop button on the bot? 😦
why
on Hydra bot
You can check if channel exists with channels.get for example
Ahhh it worked! Thankyou.
@marsh star we arent the support server for hydra bot
Cyber, I forgot to mention the type of channel and some erros ._.
Why people needs to mention 15 mods for that...
]]atmods @marsh star and read the rules
Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.
Here are some examples of emergencies:
- Raids / Multiple members mass spamming.
- Severe disruption of Discord's ToS (NSFW content, etc)
- Anything that requires more than 2 moderators to handle.
Mentioning an entire moderator role without a justifiable reason is a punishable offence.
why are moderators, website administrators, etc even pingable
For the above reason
yeah, with an unjustifiable reason is punishable
When will discord implement role ping permissions...
likely never
Would prob be too much spaghetti to implement
is it against the API to tell your bot to create an invite to a specific server from a list of servers it is in?
If possible, please do not add that feature to your bot without permission from the owners of the servers
Would prob be too much spaghetti to implement```
imo it woudln't, it's just one more bit permission, check for it in the backend, if the person doesn't have perms to mention roles act as if the role is unmentionable
it's just that the devs are more interested in making features that will bring them money
(guess DBL devs and discord devs have something in common 🙃 )
or just allow anyone with admin to tag any role
^ yea
Hello, is anyone willing to help me make a bot?
what library do you want to use?
@earnest phoenix highly doubt. do you know any programming languages?
Visual Basic, some Java, and Python.
pick one and develop it
I have the code, but my friend was bad at teaching how to make that code into a bot...
the documentation is the best resource for learning
He did, then ditched on us so we're trying to scrabble together what he made.
I made the python code for a game, then gave that file to him just to implement into a bot, but he ditched.
do you have the bot token? if not create an application here https://discordapp.com/developers/applications/
Mind if I read some of the guides you have here and get back to you? Need to go for a bit.
And I'm excited to learn this stuff! Just on a bit of an unofficial deadline too XD
Be back soon.
cool! if you need help, feel free to ask questions!
The spaghetti would be with which role has permiasion to mention which role. Or add a "can mention roles" along with the mention everyone
Can anyone help me get this working?
I used to manually post my stats but that seemed to stop working so now I'm trying to use the python api
does it return an error?
if it did not return an error and did not update the server count on dbl, then the script never ran
Yea it doesn't even seem to be printing anything
when i do it on my test bot it fails though
because i'm not using a real token
it fails and sends the failed message
I'll do some more testing
@river dawn you cannot run the script on a test bot
you would receive a 403 forbidden error
I've also been trying on my actual one
and nothing prints
try a token reset?
if it fails to authorize, you would receive a 403 error
if not, all your token and bot are correct
I'll try resetting the token
Yea i'm not even getting an error when I run it on my actual bot
try leaving it running for 3 minutes
Ok
lets see if it is timed out
since some bots refuse to return auth error for 3 min or so
and what file is this running on
What do u mean
is it running on your main file?
No
or a separate file from your bot
A Discord bot written in python using discord.py that lets you create strawpolls and reaction polls - stayingqold/Poll-Bot
It's a cog
try printing stuff until you know what part does not load
Ok
I've got a quick question
"attacks": {
"75028720": {
"timestamp_started": 1561654008,
"timestamp_ended": 1561654019,
"attacker_id": 2329265,
"attacker_name": "The_Enigma",
"attacker_faction": 22295,
"attacker_factionname": "INFINITE DIMENSION",
"defender_id": 1964175,
"defender_name": "fijimarie",
"defender_faction": 0,
"defender_factionname": null,
"result": "Attacked",
"stealthed": 0,
"respect_gain": "2.31",
"chain": 1,
"modifiers": {
"fairFight": 3,
"war": 1,
"retaliation": 1,
"groupAttack": 1,
"overseas": 1,
"chainBonus": 1
}
},
"75028819": {
"timestamp_started": 1561654178,
"timestamp_ended": 1561654187,
"attacker_id": 745480,
"attacker_name": "WombRaider",
"attacker_faction": 22691,
"attacker_factionname": "Misfits Domain",
"defender_id": 2270049,
"defender_name": "CountShankalots",
"defender_faction": 22295,
"defender_factionname": "INFINITE DIMENSION",
"result": "Mugged",
"stealthed": 0,
"respect_gain": "1.18058",
"chain": 1,
"modifiers": {
"fairFight": "1.59",
"war": 1,
"retaliation": 1,
"groupAttack": 1,
"overseas": 1,
"chainBonus": 1
}
},
How do I get the latest number from this list
Specifically 75028720
what do you mean
@untold matrix
you want to get the largest number in a json file?
No to get the latest number
I think I understand Cyber's explaination
Im getting the keys from the objects right now and working on the code
latest = largest in your case, no?
oh I see what you mean
No
Latest
I'm getting unauthorized
Im using axios to get the data from the JSON
so your trying to retrieve data from the latest number?
@river dawn regen token
I regened before I tested this time
you got a 403 error?
in that list, 7502881 should be the latest, not 75028720
401
raise Unauthorized(resp, data) dbl.errors.Unauthorized: Unauthorized (status code: 401)
https://discordbots.org/api/docs#mybots get token here
Yea thats where I got it from
yes the token is somewhat long so just triple click
is it against TOS to use livebot on your own bot?
like,
The token goes off the page so I just highlight the whole thing by doulbe clicking
triple click
Yea its the same
with the token
I just inspected the page
is it allowed?
oh texting through your bot
or against tos?
you are not allowed to sign in to your bot
iirc that is against tos
yes it is against the tos
"BUT BOTS STILL SHOULD BE OKAY"
you cannot sign in to your bot and read messages in channels and text
i dont think discord is cracking down on these, so just use it at your own risk
and self bots are definitely not allowed
not with nitro and that stuff
I got it working now! Thanks guys.
yay!
https://pastebin.com/49biW4bW
Can someone explain why this doesn't work lol. It works without the try catch command tho.
what does the stacktrace say
define "not working"
nothing. it doesn't say anything/
not working as in it doesn't send the embed to the suggestions channel.
Shouldn't you await?
thats probably because of the return statement
I was wondering.. give me a sec
also, if the user doesn't have an avatar, the avatarURL prop will be null/undefined
uh yeah i was gonna change that later, just tryna fix this
ahh it doesn't work even with the await
have you tried to console.log the error itself and not the stack
Hey friends, the svg Widget for the Bot I just created is not showing up.
Does it take time to populate or something like that?
if (message.content.split(" ")[1] !== null && typeof message.content.split(" ")[1] !== "undefined") await client.fetchUser(message.content.split(" ")[1]).then(user => { if
(user.toString() !== null) isUser = true; else isUser = false; }).catch(e => console.log(e));
^^^^^
SyntaxError: await is only valid in async function
``` What do I do about this error?
ping with answer pls
only valid in a async function
so how do i fix it
Put the code in a async function
console.log('Test')
} ```
Or const SimpleLog = async () => { console.log('Test') };
guys i need help about reading the last line of a txt file from node and an if command for it
for example if text file's last line contains hello then...
hey, I am trying to collection all the guilds between all the various shards on my bot. I tried Bot.shard.fetchClientValues('guilds'); but that returns this [{}], any advice on what I should do?
After your need to call the function
@steel drum its returning a collection i think
you won't be able to
since it needs to serialize the data, you'll get errors due to cyclic references
!eval Bot.shard.fetchClientValues('guilds').array(); returns an error saying array isnt a property
so im ggoing to to assume that its just an array
also b c when i tried typeof it returns object object
Why do you want that?
if you try to send client.guilds/client/guilds/a guild/any variation of this, you'll get this reference cycle
Client -> guilds -> Guild -> client
î |
\-----------------------------/
which can't be serialized
what would you suggest doing then ?
You sure you can fetch it with fetchClientValues? You can only fetch like guilds.size or stuff afaik
console.log(s)
});```
I want to send an announcement in every server my bot is in
TOS
Use broadcastEval to eval something with it
you'll get ratelimited to hell doing that
And yeah tos
hmm
how many guilds would I be able to send a message to before getitng rate limited?
Ratelimits are flexible
5min interval for a sharded bot (at least 2500 guilds) means hell of a uptime
There are no real defined, explicit ratelimits
understandably
Why do you want to send an announcement
^
for bot feature updates
guys anyone can help me?
That can usually be done through a support channel
Add a command, and promote the command in the help command @steel drum
@restive light dont ask to ask
not everyone wants to join a support channel
like <prefix>update
use your website for announcements or make people can set a updates channel via command
is the best way imo
you should make server owners consent to it in a way
of course
I need reading a txt file's last line and sending it to a channel in every 1 seconds without repeating the same message , spamming and without sending blank messages
My project: sending a game's logs to a dc channel
you can try asking the server owners to make a channel called {your-bot-name announcements}
Google ?
and have your bot scan all channels and send only in those channels
Using discord as logs is very bad
no my plan is not that
And got roblox webhooks banned for it 
@restive light I think something involving webhooks would be better
getting game's chats in every second
when thats done, ill do sending message to a game from dc
dc to game game to dc
Yes, that's what got roblox banned
Im just saying same implication
well that game is for programmers
people creates their own programs for that game
actually i wanted to creating an IRC bot but reading from txt and sending it is easier way i guess
and i wish discord doesnt have any forbidden something for game chatting IRC#bots
(if created irc is using for hacking, they are right)
const discord = require('discord.js');
const moment = require("moment");
const { version } = require('../../package.json')
const config = require('../config.json');
require("moment-duration-format");
exports.run = async (client, message) => {
const config = require("../../assets/settings.json");
const duration = moment.duration(client.uptime).format(" D [days], H [hrs], m [mins], s [secs]");
message.channel.send(`= GENERAL =
• Kasper :: ${config.version}
• Uptime :: ${duration}
= USERS =
• Users :: ${client.users.size}
• Servers :: ${client.guilds.size}
• Channels :: ${client.channels.size.toLocaleString()});
};
https://i.imgur.com/xtyOOdE.png
What did i do wrong?
When you discover a new error
message.channel.send(`= GENERAL =```
Its not that @smoky mica
He forgot to end it
Yeah event my brain's fuked
Ahhh it's like 3:40 am i can't work on the bot later so im like not going to sleep lmao
Sleep
In like 30 mins i'll lmao
' setInterval(function(){
client.on('message', (receivedMessage) => {
if (receivedMessage.author == client.user) { // Prevent bot from responding to its own messages
return
}
})
const readLastLines = require('read-last-lines');
readLastLines.read('d:\deneme.txt', 1)
.then((lines) => client.users.get("ID").send(lines)); //console.log(lines));
},1000) //logs hi every second '
doesnt works as i want
...
writes last line of txt file to console but doesnt write to dc
type it like this so it's better to read, that looks awful to read
17 pixels in your screenshot
@smoky mica I told that before i remember, my keyboard doesnt has these marks
copy xd
alt+096
oof
lmao
Re-send the code pls
just trying to do send the last line of a txt file to dc
With code block
Bro wait wtf you dont have backticks on your keyboard? Tf you get it from
alt+096 steven
client.on('message', (receivedMessage) => {
if (receivedMessage.author == client.user) { // Prevent bot from responding to its own messages
return
}
})
const readLastLines = require('read-last-lines');
readLastLines.read('d:\deneme.txt', 1)
.then((lines) => client.users.get("ID").send(lines)); //console.log(lines));
},1000) //logs hi every second ```
Why client.on('message?
interval scans and sends a new line to dc
Yes i have backticks on my keyboard but idk how i can put backtick i'm noob lol
^
idk i dont understand much about js
Like insurmountable not good
i just using js for bot and trying to learn js
client.user not defined
can anyone create a sample what i want? and please tell step by step or with // what line does
Spoonfeeding here is illegal
i want to learn while creating my bot too
why its illegal lol
i just want to creating and learning at same tmie
cause spoonfeeding doesnt help learning
time*
Create the sample yourself. Try and make mistakes. Make a lot of them. Then work on fixing them one by one
That's how you learn
@restive light you could go to the server for your bots api wrapper thing (eg discordjs) and ask questions there
they have extra large size spoons
@restive light why do you want that?
I personally learn from trial and error. And a lot of it
@earnest phoenix i can understand easily when someone makes sample and tells me how to do / solve it
for example like maths
i use this way for learning
why do you want to log hi every second
it sounds like a plan to keep the bot online
why not use a vps
i put log hi for testing
oh
How to nuke discord:
Put a event listener in a interval
@restive light testing what?
interval
lol
interval logs hi every second but doesnt sends messages to dc in every second
i'm loosing braincells
my problem is about "console.log('hi')
problem solved
so why this #development channel is opened for?
for saying "Go and learn docs"
?
For helping people with a minimum knowledge
hey kens nickname test bunny
i already wanted a minimum knowledge
let's say i come in here for help for every single piece of code that i never learned
hi
Okay, if you want to say hi every second take that
console.log('hi')
}, 1000)```
wouldn't that be annoying?
i guess you dont understand what i ask meh
i have issue about sending messages to dc every seconds
interval logs hi every second but doesnt sends messages to dc in every second
@restive light you can't send a message every 1 second without a ratelimit
He can if its in console.log
yh
doesnt sends messages to dc in every second?
What is dc?
You can't if it's being ratelimited
Discord channel
you can with 6s second interval
But 1 second is not allowed
Api abuse
i mean yh, you'd get banned for abusing it
actually something like scans txt file in every 1 secs and sends txt's last line when a new one added to it
Its good
🤦 this went from discord channel to txt file
Send the txt file to the channel
Problem solved
another program (written in vb6) saves games logs to txt and dc bot reads and sends it to dc
and same as dc to game too
dc game <> game dc
okay
cuz i didn't understand at all
Use fs @restive light
fs.readFile(poem.txt, 'utf8', function (err,data) {
if (err) {
return console.log(err);
}
console.log(data.last()); });```
I have put last but i think last doesn't exist in djs
a program written in vb6 enters the game and saves logs to a txt file. Discord bot reads text file's last line in every 1 seconds and sends new line to discord
discord bot saves chats from discord to txt and vb6 program reads and sends chats to game
idk if you understand
Dude
Use fs
fs.readFile(poem.txt, 'utf8', function (err,data) {
if (err) {
return console.log(err);
}
setInterval(function() {
bot.channels.get('id').send(data.last());
}, 1500);
});
yh imma leave it to ken, my brain's fried from lua stuff
i thought creating an irc between dc and game with winsocks is the hardest way
looks likes js is the hardest and annoying way
js is very easy 
// ready event
module.exports = async client => {
client.user.setActivity(`BRUHHH TRAIN`, {type: "WATCHING"});
};```
how about no
Nothing better than realizing you need to set up sharding after your bot is submitted
Can someone help me find the guide for making a bot with python? Looking but hard to find it
Ty!!!
Anybody know why the font isn't being used on the text?
It's still using the default sans serif
here is my code:
Canvas.registerFont('Rockout.otf', { family: 'Rockout'})
const canvas = Canvas.createCanvas(700, 250);
const ctx = canvas.getContext('2d');
const background = await Canvas.loadImage('./background.jpg');
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
ctx.strokeStyle = '#000000';
ctx.strokeRect(0, 0, canvas.width, canvas.height)
ctx.font = '28px "Rockout"';
ctx.fillStyle - '#000000';
ctx.fillText('Welcome to the server,', canvas.width / 2.5, canvas.height / 3.5)
No error in console as well
You need to register the font
Oh already do
You need to link the folder, where is the font
In the same folder as the index.js file
Uh idk if canvas can register otf font
What
Np 
Does anyone know if the way that permissions work in DJS changed? I'm trying to implement a check for if the user has a certain permission, however, it's not working. ```js
if (!message.author.hasPermission('MANAGE_CHANNELS')) {
return message.channel.sendEmbed(PermsEmbed).then(m => m.delete(5000));
}
One min, getting the error message.
Lol
Hello
Hey, @earnest phoenix, how can we help
Hello! How do you reset a debian vps?
Check your hosters control panel
I do not have access, it is a friend on vacation who has the access @cursive dagger
Then you got to wait
omg
That's why yoi get your own vps
You*
So much easier than using another person's vps
Make crash the vps
@white brook
You want the id of a channel?
Or make the bot join a channel with a id?
Yeah
What yeah?
make the bot join a channel with a id
I. Need the code
@earnest phoenix let me google that for you woulda been cooler
Snipe no one will give you the code here
Where
Nobody should give you code here. As I said, it’s against the rules.
^
Please stop asking for code.
Its a basic js code
Learning is good
Learning is great.
?
@earnest phoenix deleting it for a reason
Don’t worry, trying to promote learning.
Hey guys, I know ya'll wanna be helpful but this channel is flooding quickly. So keep it constructive and helpful.
@white brook try googling, there are a ton of examples. If you’re struggling with one specific error or part of the code, then we can help.
@white brook start by reading the discord.js docs then search what you want on Google it's out there somewhere
at least keep your pings to minimum 
pong
Thank you @earnest phoenix
Np
it's saying .forEach is not defined IDK why
const { Client, Collection } = require("discord.js");
const { token } = require("./bot-config.json");
const bot = new Client()
["commands", "aliases"].forEach(x => bot[x] = new Collection());
["message", "command", "event"].forEach(x => require(`./handlers/${x}`)(bot));
bot.login(token);
Any other details like ERROR Code,?
Also, I wouldn't advise following many Github repositories.
I did this from a tutorial
lemme get the full error
/home/pi/BasicallyBS/body.js:5
["commands", "aliases"].forEach(x => bot[x] = new Collection());
^
TypeError: Cannot read property 'forEach' of undefined
at Object.<anonymous> (/home/pi/BasicallyBS/body.js:5:25)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
at internal/main/run_main_module.js:21:11
copied the file format and the writing to a T so idk why it's poping up
Here's the tutorial in question:
https://www.youtube.com/watch?v=VJxS4YSgG9o&list=PLWnw41ah3I4ZfNLV3by7nB6JO2WcCc3Wj&index=20
Yeah... I wouldn't exactly advise following these tutorials as I have seen him explicitly abuse the API without knowledge of it.
so I should just stick to my command handler?
Null out the aliases line and see if the one below works.
I think its just whatever is being passed within the parameters.
same error
something about forEach
You're trying to forEach an array
yes...
For what?
That's not the problem lemaaa.
So I can use the event handeler done in menudocs... although i don't fully know his file setup
Look here scripted
Its a basic command handler taken from docs
All it does calls a async loop for event and command files.
ok.... i'll try it
What could be the reason for a Discord bot automatically regenerating its token?
Surely an email would be sent and the owner of the bot would be banned as well.
What
If the bot gets banned, surely they will send an email and ban the bot owner as well.
Not for a application ban
Ok, i got mine fixed
Just contact discord at support@discordapp.com if you need help about that
You're not the first with this issue
Thanks
hey folks, what's a good language for discord code blocks to get nice text highlighting
basically looking to exploit this for showing information
[+] info 1
[+] info 2
...
figured you guy would know
i want to make a comand that responds affer a few seconds is there a way to do that im useing c#
thanks
thanks
@earnest phoenix Thx but i already got it :)
@stray garnet array text file random?
Nope
What @stray garnet
How do I know the number of users on all servers where the bot is located?(nodejs)
hmm Just get a Serverlist Command that is only for you
sum all of your guild's memberCount property
so once I have the nodejs stuff at the top with client key and such,
Is this all I need to get the server count and member count to show up correctly on the Discord Bots website?
client.on('ready', () => {
setInterval(() => {
dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
}, 1800000);
});
bascially, yeah
mk, thanks!
but keep in mind how setInterval works
yea, so it'll take time for the first post
yeah thats what i was about to say
I guess I could run it once now, to set it, then put it back in the interval
or you could post it in the ready event, and then the setInterval
ahh true true
dbl.webhook is undefined for me it says
rather it cannot read the property of on, of undefined, which is dbl.webhook
what does that even mean
Translation? Maybe
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
which is this
the cannot read property on error, for line 150 in my code
Although I guess I don't really need that, as it looks like server count is coming through now
PYTHON, DISCORD.PY V1.2.2
I have a question, how to check if a bot, for example my bot, has the permissions for sending (embed_links)
I searched, but .has_permissions won't work
How did you use has_permissions?
Are you using commands extension?
rip
#On a message (command)
@gopbot.event
async def on_message(message):
print(message.channel.has_permissions(create_instant_invite))
I have no idea how to use the command extention, and I want some stuff to be unprefixed too.
Can u help me?
I would like to delete a channel that I search by name, but delete the channel by its id. I tested this,
let channel = message.guild.channels.find(c => c.name == args[1] && c.type == "voice");
let channelid = channel.id;
message.channel.send(":white_check_mark: Le channel ``" + args[1] + "`` a bien été créée !" + channel).then(msg => {msg.delete(8000).then(c => {channelid.delete()})});
but the console says to me:
(node:5296) UnhandledPromiseRejectionWarning: TypeError: channel.id.delete is not a function
idk d.js but there should be some kind of client.delete_channel() function, go look it up

@plucky sun message.guild.channels.get(channelid).delete()
or you can call delete() on the already fetched instance
saving memory with cry™
message.channel.send("✅ Le channel ``" + args[1] + "`` a bien été créée !" + channel).then(msg => {msg.delete(8000)} ```
You can do that @plucky sun
idk if .delete() work on a .find()
i dont think bc its returning a collection so you need to map it
ok i try
it returns a channel thonk
If it doesn't work replace .delete() by .map(e => e.delete());
A collection of channel
channels is a collection of channels, find returns a channel instance, as per docs Searches for a single item where its specified property's value is identical to the given value 🤔
yes but its not returning only one channel
use get_channel(id)
its js not py dank uwu
Lemaaa, im almost certain it does return only one channel; Searches for a single item ...
try using getChannelByID
^
ah yeah i'm dumb
reading from the code above, they don't have access to the id
which is why they're using find in the first place
@plucky sun replace find by filter
doesn't work i search another solutions ty
https://luca.is-inside.me/MGFVxaNG.png what's the best way to make a link menu like this responsive?
not making a menu like that?
true
How to make trivia answer bot plZ tell me
with magic
google is your best friend for that question
Learn discordjs
@spare goblet I don't know plZ tell me
@finite crow if you do'nt know how to make a bot, please check the following link
thanks 
pick a library
wtf is wrong with this embed
Nothing
Ok??
Show more code
what does the error say...?
Like mentionedUser
If its "username" its not defined
this works fine
Its working now?
what is the error
what
you forgot a (
Ah yup
you have .addField`...
in discordjs, how can I make the image to the corner like this:
https://gyazo.com/a6e24380d346a30ac0d8a314e5153308
<embed>.setThumbnail(url or attachment)
.setthumbnail
ah I was using setimage
It probably puts the image on the bottom
Set image is for display a big image at the bottom
how do you do that in py tho
embed.set_thumbnail(url={the url})
ok thanks
Anyone got a good tutorial for setting up mongodb?
@ember atlas I can help with mongodb
Did you create a database already on their site?
Alguien me podria ayudar, necesito poner mi bot aqui pero no he podido y se los agreadeceria un monton
Somebody could help me, I need to put my bot here but I have not been able to and it would be a lot
Keep in mind, you have to know what code you need help with
@robust acorn If this is what I did, then yes. https://i.imgur.com/ddrA24D.png
so you already established connections?
check the collections tab and check if you already have an existing database
@robust acorn It looks like I do.
also what library are you using?
djs
does someone else know your log in info or your database url?
When you establish a connection in your code, did you put /your-database-name after the url?
havent done that yet
thats what i am here for
i also dont have a database and need to make one
Im guessing DJS?
you said you had sample databases
try to make a database within the collection
there should only be one url to connect to an account
which gains access to do stuff with api
Whats the collection name?
afaik, you don't actually need to do that after mongoDB is setup
once you open a collection, it should have the name in the format of database-name.collection-name
Just set it up like it said in the NPM page with /desired-database-name after your host ip



