#development
1 messages · Page 1791 of 1
and this is why it is always a good idea to format your code
client.on("message", async message => {
const args = message.content.slice().trim().split(/ +/g);
const command = args.shift().toLowerCase();
let channel = message.channel
if (command === "%nsfw") {
if (args[0] == 'enable') {
channel.edit({ nsfw: true });
message.channel.send(`Se **activó** el NSFW en el canal -> ${channel.name}`);
//
if (args[0] == 'disable') {
channel.edit({ nsfw: false });
message.channel.send(`Se **desactivó** el NSFW en el canal -> ${channel.name}`);
}
}
}
});
the djs guide covers all the changes
if you look closely, youll see how one if statement is within the other
ooooh
oko k
ty
wdym
that I do not make the codes from 0, I just copy and paste the examples from my other codes, then this error can happen to me with the brackets
well learn to understand the code you are copy and pasting at the very least
and try to figure out issues yourself in future by reading documentation and understanding javascript
yep, it's a good idea, I never read discord's docs, I only learned from tutorials or friends, it's a bot to pass the time, it's not a project to say
otherwise youll forever be reliant on others, which kinda defeats the point of coding your own stuff
that same
its about picking up good habits too and learning from what youre doing, no matter how small it is
Failed
I am using version 12
The robot runs right when it is inside the test channel, but when I move it inside the main server, it turns off and no longer runs.
might be the fetchAllMembers causing issues
How can I fix it?
try setting it to false and see if that changes anything
tho thats not exactly a fix, youll likely need to do some modification if you really needed to fetch all members in the first place
fetchAllMembers related to resource or server settings?
wdym
What?
What is the problem with fetchAllMembers?
it can potentially cause issues in terms of ratelimiting, especially when fetching large numbers of members
and OOM crashes
Because of too many members?
yep
why does your bot need to fetch all members?
I think I should kill 800 people for a robot
This is the source of the robot
why do you need to send all your bot's code
I do not know :/
Is discord still adjusting the mobile client with the new design?
Looking at the channel list today let me think all items have less the height than before
it always is
Naw the font sizes have changed the last days
try to figure it out from what youve been told
ik, they push updates seamlessly
Anything is fucking small, too small
nobody is doing it for you
they are always changing it without notice
Yeah looks like so
these days I noticed the new mention color was applied to mobile aswell
I wonder if the mobile version is just a webview instead of an actual app
I don’t think so
how can they update it without playstore updates?
yep, I mean the app
oh yeah, it could be a remote stylesheet
Anyway I can’t adjust the font size and it got too small to type while driving 
don't type while driving
I don’t see an issue about that
if you werent typing you'd have seen
hi guys how are you
I made the dashboard, that is the dashboard, and when I use it on localhost, there is no problem.
But I'm thinking of adding it to the site and ftp.isim.site vesayre
I made a web page in FileZilla and added it. I made an external dashboard extension but it didn't work
I just made the domain link that way.
Can you help if you have any information?
With an accident!
probably
I stopped understanding at the 5th word
heya guys
any link,video or tutorial, or any suggestion ? i need to make a welcome room, player need to confirm to move for others chats. just this.
I stopped understanding at the 5th word
Phew… thought it’s just me
hello you all ?
Just for accepting rules in that channel?
If so there are already (new) channels with that function not requiring a bot
If he enters your command you just gonna assign a group to him.
What’s the issue?
You gonna check if the message includes your command, if the channel is the right one and then assign a group to the member.
the issue is, i wanna when a new member join server he could only see one channel ( called = welcome room )
after the type anything or my command ( like = !role @nickname Class )
then member would be able to check all chats
No big deal, just listen to the “guildMemberAdd” event, check if the member isn’t a bot, remove all member permissions, assign permissions to the member to see one channel only.
server settings ?
Hee?
where is guildmember add event ?
you said
i asked if whitin server settings painel my discord channel
i am not using any, but i know python
with only discord features i can not separate ?
because carl-bot already gives me the role action
i just need to put in wait room new member
after check or any key pressed ok
then it allowed to see all chats
Are you going to make a bot or just a rules channel?
rules channel
the own member will add a roll if want
but they need to type command permission
Oh nvm then thought you wanna make a bot
just an application
Can’t help you with that unfortunately
I just know it exists
noop
not the same
not even close
bam the more you know
they're very different
quick.db is a convenient package for writing to databases as if they're key-value based
it uses sqlite under the hood to my knowledge
mongodb is a document-based database
it encourages programmers to think in objects rather than in references
and has a json-like approach
but you won't get all the differences and if you should use it out of a few messages
you should do more research online into the differences @earnest phoenix
A lot of developers who want their bot to just work and not worry about how to design and manage their databases will choose quick.db.
Mongo is overrated
I mean, for some stuff it's excellent
But people overuse it for relational data
oh
in all honesty any db will work 99% of the cases
its very rarely where a bot actually requires some very advanced thing that one db has that the other doesnt
overall you fine sticking with whichever you want @earnest phoenix
though i would recommend the right tool for the right job
using postgres if you just want to save a few dozen id's from users is like getting a chainsaw to break a stick
so sqlite or some very lightweigh dbs would be the option
Everything boils down to sqlite in the end
It boils down to ur data
How much of it
What shape u need
Do i need relational dbs?
Its all on u and ur data tbh
SQLite always reigns 👑
g as in goat
more context pls
wht you mean
no, wht you mean
wht kind of probleam happen in ytdl- core no any music bot working
of made by ytdl
what
so something you need to do to get help is 1: say your problem
2: send an error
3: send your broken code so we can see what's wrong
we can't do anything if you say "help with x because y doesn't work"
error: ECONNRESET general speaking it something that lib have to do with the connection reset not handled.
I got slap with it almost everytime even with short song dura
so what I can gather from what we have is that use ytdl-core for JavaScript
and that's it
I don't recommend it untill they solved the ECONNRESET issue
I never had any problems with ytdl-core, I only had problems with discord-ytdl-core
Probably using an outdated version, YouTube changes their codec a lot
yeah, the npm package was VERY outdated
swapped to ytdl-core, and then everything worked fine
lul
How could I make a file that catches every error including database related errors?
Like an event?
Any place that I could start?
so do you know about the Exception exception
this is a thing in most languages
A generic catch
You need some sort of catch-all for errors to collect and write your errors.
However, I'd recommend a logger implementation (e.g. a library)
or like
Which could handle that functionality and extra capabilities for you
Okay, where can I start? Because my bot is restarting 2 - 3 times a day when I only need it to restart 2 times a day.
I switch to youtube-dl-exec since it support other website as well the like soundcloud etc
Is your bot restarting due to an upstream provider? Are you sure you'll be able to catch errors like that?
hey have you heard of google
I hear it's helpful!
I like to ask. I don’t ask questions well.
google understands them 90% of the time
Googles cryptic ass error, somehow a forum has a solution from 10 years ago

But yeah
Yeah honestly.
I'd throw that question into google
Okay.
Cause 1: we don't know what lang you use and 2: it's a relatively simple fix.

have headpat
c++ template errors
ooga booga
module.exports = {
name: `grab`,
category: `🎶 Music`,
aliases: [`save`, `yoink`],
description: `Saves the current playing song to your Direct Messages`,
usage: `grab`,
parameters: {"type":"music", "activeplayer": true, "previoussong": false},
run: async (client, message, args, cmduser, text, prefix, player) => {
if(!voted) {
return message.channel.send(new MessageEmbed()
.setColor(ee.wrongcolor)
.setDescription(`This is Command is Vote Required Please [vote me](https://top.gg/bot/802812378558889994/vote) First `)
)
} else {
return message.author.send(new MessageEmbed()
.setAuthor(`Saved Song:`, message.author.displayAvatarURL({dynamic: true}))
.setThumbnail(`https://img.youtube.com/vi/${player.queue.current.identifier}/mqdefault.jpg`)
.setURL(player.queue.current.uri)
.setColor(ee.color)
.setFooter(ee.footertext, ee.footericon)
.setTitle(`${player.playing ? `${emoji.msg.resume}` : `${emoji.msg.pause}`} **${player.queue.current.title}**`)
.addField(`${emoji.msg.time} Duration: `, `\`${format(player.queue.current.duration)}\``, true)
.addField(`${emoji.msg.song_by} Song By: `, `\`${player.queue.current.author}\``, true)
.addField(`${emoji.msg.repeat_mode} Queue length: `, `\`${player.queue.length} Songs\``, true)
.addField(`${emoji.msg.playing} Play it:`, `\`${prefix}play ${player.queue.current.uri}\``)
.addField(`${emoji.msg.search} Saved in:`, `<#${message.channel.id}>`)
.setFooter(`Requested by: ${player.queue.current.requester.tag} | in: ${message.guild.name}`, player.queue.current.requester.displayAvatarURL({dynamic: true}))
).catch(e=>{
return message.channel.send("**Your Dm's are disabled**")
})
message.react(emoji.react.SUCCESS).catch(e=>console.log("Could not react"))
}
}}
i cant got error

me when using void pointers and converting it on the fly
help me
I don't use JavaScript.
also please for the love of god use semicolons 
It makes it so much easier to read
and enabling syntax highlighting
indent properly
Why's next/router giving this error?
https://i.callumdev.xyz/xfzjx.png
hm I wonder what the red text says
ohhhh... Something's undefined
Auth isn't defined, or whatever that variable resolves to is undefined.
addFields is a thing btw
please check #topgg-api
i explains actual error
does the & variable work in js like it does in c++
ie implements all variables in lambda function
& is used for bitwise in js
ah
module.exports = {
name: `grab`,
category: `🎶 Music`,
aliases: [`save`, `yoink`],
description: `Saves the current playing song to your Direct Messages`,
usage: `grab`,
parameters: {"type":"music", "activeplayer": true, "previoussong": false},
run: async (client, message, args, cmduser, text, prefix, player) => {
let voted = await topgg.hasVoted(message.author.id);
if(!voted) {
return message.channel.send(new MessageEmbed()
.setColor(ee.wrongcolor)
.setDescription(`This is Command is Vote Required Please [vote me](https://top.gg/bot/802812378558889994/vote) First `)
)
} else {
return message.author.send(new MessageEmbed()
.setAuthor(`Saved Song:`, message.author.displayAvatarURL({dynamic: true}))
.setThumbnail(`https://img.youtube.com/vi/${player.queue.current.identifier}/mqdefault.jpg`)
.setURL(player.queue.current.uri)
.setColor(ee.color)
.setFooter(ee.footertext, ee.footericon)
.setTitle(`${player.playing ? `${emoji.msg.resume}` : `${emoji.msg.pause}`} **${player.queue.current.title}**`)
.addField(`${emoji.msg.time} Duration: `, `\`${format(player.queue.current.duration)}\``, true)
.addField(`${emoji.msg.song_by} Song By: `, `\`${player.queue.current.author}\``, true)
.addField(`${emoji.msg.repeat_mode} Queue length: `, `\`${player.queue.length} Songs\``, true)
.addField(`${emoji.msg.playing} Play it:`, `\`${prefix}play ${player.queue.current.uri}\``)
.addField(`${emoji.msg.search} Saved in:`, `<#${message.channel.id}>`)
.setFooter(`Requested by: ${player.queue.current.requester.tag} | in: ${message.guild.name}`, player.queue.current.requester.displayAvatarURL({dynamic: true}))
).catch(e=>{
return message.channel.send("**Your Dm's are disabled**")
})
message.react(emoji.react.SUCCESS).catch(e=>console.log("Could not react"))
}
}
see i defined
but i cant got respond
Hi
have you run it
Do you play pokemon go
yeah
its a syntax error but where i cant got
What
} else {
return message.author.send(new MessageEmbed()
What do you play
Is it in the else or the return
i guess else
I'm on mobile currently, but from what I can tell there isn't a syntax error.
Are you sure it's that line?
i got it
but am solving
ok
I shall now leave development chat before my last two awake brain cells fall asleep
bot edit page, webhooks, token
what you need actual
?
@bright thorn ask in #general-int on your language or use google translate
not knowing how to code AND not knowing english makes it really hard to help
👀
whats issue
am telling my
issue in English
at ClientRequest.<anonymous> (/home/container/node_modules/miniget/dist/index.js:210:27)
at Object.onceWrapper (events.js:483:26)
at ClientRequest.emit (events.js:376:20)
at HTTPParser.parserOnIncomingClient (_http_client.js:647:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
at TLSSocket.socketOnData (_http_client.js:515:22)
at TLSSocket.emit (events.js:376:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at TLSSocket.Readable.push (internal/streams/readable.js:223:10) {
statusCode: 404
}
wht is this error
cn any one tell
404 means whatever you're accessing doesn't exist
would probably be better to ask in the ytdl support server
iy on ytdl core
cn you pls give me link of server
YTDL support server: https://discord.gg/V3vSCs7
what u guys use to get ur bot 24/7 online
very helpful thx
np\
https://github.com/fent/node-ytdl-core/commit/d1f535712410eebd79a7468abd07d94f8c4ebe5a If you know how to
I tried this too
ware the error
Just glad to see that you're interested.
I hope other friends know everything too.
what's your problem my friend?
I can help if you want.
node .
what is this?
where package.json
hmm start localhost port and
index.html
all you do is run the folder.
It's like selecting a folder and pressing enter. This is wrong
they're trying to run the file with windows script host, not node, thatxm's why it doesn't work
you need an interpreter to run JavaScript code
package.json
localhost:3000 or
developer.
Of course you need to install the module.
using the windows script host won't work
what are you even saying
can use node to run.
or yarn
package.json
it needs to create extension, then crafting program with knot or thread.
you don't use a package manager to run node code
you know you don't actually need to initialize the project right
it's not a requirement to run a file with node
Just wondering if anyone knows how to reverse proxy nginx.
what's your question
hey i am trying to run my discord bot, but it returns me this error input stream: Status code: 404
just when trying to run my !Play command
what did you use for streaming the audio?
A lot of ppl are having issues with ytdl since last few days
?
so the issue doesn't lay at my end?
will it fix itself
or will it always remain broken
Sup all.
switch(args[1]) {
case 'enable':
case 'enabled':
case 'true':
case 'on':
case 'sure':
case 'yes':
meow();
break;
.. any faster way to do this?
define faster ?
#1: With less code
#2: Compiles faster
#3: Operates faster
I know if statement does it faster.. but with less code, yes.
does everything the same?
switch statements are faster than if statements
As long as I know
switch case has O(1) complexity so it's the fastest
I think if statement are faster.
long if..else if...else are compiled as switch case anyway
just a extra step
Yes.
looks like it
switch (arr.toString()) {
case arr.toString():
console.log('ok');
}``` this could work
if you wanna do a 1 liner then u can do something like this
I'm assuming you're using js
[*words*].includes(args[1]) ? meow() : *do something else, or do nothing*
so i will have to wait till ytdl core gets fixed right
use something else ytdl is crap
Hm..
yeah i kinda like it tho
yea but is also extremely limiting, most large bots dont use it for good reason
For sure.. alright!
mhmm
Using array.includes guarantees O(n)
how long will it take till it gets fixed
can take a day can take months
worst case though
it isn't a big deal in this case
yea it's just 6 items so shouldn't hurt
Also you should initialize the array outside of any functions to avoid extra allocations
look into lavalink
I'm just checking out all the ways.
if ur worrying about speed, you shouldn't be using JS anyway
any one need help for music bot 404 error dm me
Re-post it
@pale vessel wdym
i removed the code long back
cause if i use the code my bot crashes randomly
idk why
What library are you using for your Discord bot?
Ahh..
Make sure you arent having two bots run the same code to the same web hook.
.. I experience that. 😂
I'd like to ask.. I create a scrimba application and I can write console.log(1 + 1) and logs it.
Why cant I do the same in Visual Studio Code?
HELP
your sister is going to be mad
ur five minutes too late
Ouch
I tried to use fdisk to resize my ubuntu partition
my two braincells told me to create a new partition instead of resize the old one
none of the fixes on stackoverflow worked
Stackoverflow 
Yep
Rip
no luck with the stackoverflow answers
Why do I get this error when running the robot?
press enter
wtf
it happen because windows 10 have crash error
no jokes bro, my pc has 300GB of very very important stuff
it fix in windows 11
bro
im using linux
What are the requirements for a server to be a real server in Discord?
all the tutorials on stackoverflow tell me to use a cd/usb but i dont have one and how the absolute fuck do i boot into that when grub rescue wont let me do anything
buy a usb or a cd then
hang on i might have a 2 gig usb somewhere
but how do i install ubuntu to it from a phone
@earnest phoenix vc aja ak min
no
tu bhie whi ha
if (["enable", "enabled", "true", "on", "sure", "yes"].includes(args[1])) meow(); maybe? sorry for late reply tho
there was a bootable lightweight thing to reinstall grub
flash it from another pc
who's pc?
i dont have another
and i dont think the guy at the computer store will let me do shit
👍 😀
i still cant figure out how to fix it
people say i have to change the prefix and root variables to the correct grub path but what use is that if grub cant figure out the file system on anything?
Well you'll have to use a different pc lol, maybe go to like a library or something
so i may have found a fix:
goto my friend's house (who has a monstrous computer),
install ubuntu on a spare usb using his computer,
come back home,
smh get my computer to boot from the usb
or to a friend which has a PC
@cinder patio Well how do i get my pc to boot from theusb instead after i got it?
I dunno I've never installed an OS myself
probably using discord on a fridge
Just change the bios to boot from any external device
most pcs have a key to boot into device selection mode
its usually F2, F10 F11 or F12
i remember spamming the arrow keys when turning on the computer once (dont ask why, i was 8) and smh got into boot menu
what a nice day to forget your computer model so you can't google the boot key
@quartz kindle @boreal iron
your usb should show up there
It needs to be a bootable device of course
if(option === "on"){
const attachment = message.attachment.first()
console.log(attachment)
}```
Error : cannot read property type 'first'

Isn't the property called "attachments"?
Idk
message.attachments.first() - You're missing an s
I know its a rather dumb question, but how do I put all my require() into one file, and call that file?
I cant seem to find it anywhere
This is in Node.JS btw
If you need your included files everywhere in your process, include them in your index/main file
Wouldn't you require that file too?
Thats what I do, but then my index.js file is long as anything lmao
exports.A = require("...");
exports.B = require("...");
exports.C = require("...");
const {A, B, C} = require("...");
Hmm, thank you!
That makes life easier lmao
Is discord.js latest version supports inline reply
@restive sleet
use the bash tag / json / ini
"NEED THE QUOTES - bash"
"NEED THE QUOTES - json"
[some blue text using ini]
.some_blue_text-using-css
theres many ways to do it, just check the resource, google is also your best friend
;O thankss!!
ofc ;3
master version of discord.js has support for that
v12 does not
You want to try it out you can do npm i discord.js@dev
const setting = args.slice(0).join(" ")
const mode = args.slice(1).join(" ")```
I want `setting` to get the first argument only. But it gets the entire command I say. For example: `g!config publicprofile true`. I print `setting` and get `publicprofile true`. i want it to only be `publicprofile`. How can I fix this?
anyone knows about this error
**Hi guys i made economy commands but if i type the command there is no reaction from the bot
**
import discord
import requests
import json
import random
import os
import random
import pickle
client = Bot(command_prefix="F-") #Make sure to put ur prefix here
data_filename = "data.pickle"
class Data:
def __init__(self, wallet, bank):
self.wallet = wallet
self.bank = bank
@client.event
async def on_ready():
print('Logged in as {}'.format(client.user.name))
client.loop.create_task(status_task())
async def status_task():
while True:
await client.change_presence(activity=discord.Game(
'Type F-Vote to vote for special commands and to support the developper.'))
await asyncio.sleep(30)
await client.change_presence(activity=discord.Game('Join the support server for Support [https://discord.gg/tfFMrtqVhN]'))
await asyncio.sleep(30)
#commands
@client.command()
async def work(message):
member_data = load_member_data(message.author.id)
member_data.wallet += 1
await message.channel.send("You earned 1 coin!")
save_member_data(message.author.id, member_data)
@client.command()
async def bal(message):
member_data = load_member_data(message.author.id)
embed = discord.Embed(title=f"{message.author.display_name}'s Balance")
embed.add_field(name="Wallet", value=str(member_data.wallet))
embed.add_field(name="bank", value=str(member_data.bank))
await message.channel.send(embed=embed)
#Functions
def load_data():
if os.path.isfile(data_filename):
with open(data_filename, "rb") as file:
return pickle.load(file)
else:
return dict()
def load_member_data(member_ID):
data = load_data()
if member_ID not in data:
return Data(0, 0)
return data[member_ID]
def save_member_data(member_ID, member_data):
data = load_data()
data[member_ID] = member_data
with open(data_filename, "wb") as file:
pickle.dump(data, file)
client.run```
**Any Help?**
npm ERR! code 128
npm ERR! command failed
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/discordjs/discord.js.git
npm ERR! Warning: Permanently added the RSA host key for IP address 'x.x.x.x' to the list of known hosts.
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
``` anyone knows about this error
"git@github.com: Permission denied (publickey)."
you dont have permission to access whatever you are doing with github
well it's discord.js master branch
that's the only package I'm trying to install from github
BTW, has anyone here made a git push and git pull command in discord.py?
Doesn't work
guys do you have any idee how is posible to have a bot status for website
Bruh
I guess
Oh okay, os.chdir and os.system
Don't know how well it will work with async, but
someone have a bot to have website status like this ?
Have you tried searching for such bot?
yeah but nothing found on github and other
this just a bot ping ip and say on embed
@quartz kindle
This is fun
Lock the expansion to the y-axis only
I resized it to that so that's fun
Either run it in an executor or use https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.create_subprocess_shell
I have seen that
Lemme show u what I followed
https://github.com/Voxel-Fox-Ltd/VoxelBotUtils/blob/master/voxelbotutils/cogs/owner_only.py#L536
This didn't work
A Discord.py addon library to speed up and streamline Discord bot development. - Voxel-Fox-Ltd/VoxelBotUtils
Why don't you just call communicate?
What I'd do, basically. As you probably can tell already, the former is stdout and the latter is stderr
Huh?
Wym?
Oh
Wait then
The repo is private, so how can I tell it the git creds?
It's a VPS
It's run as if you run it in a terminal. As long as you can access it in the terminal, it'd work, I guess.
NP
Ayo I let him out it’s fine
How can you keep Dashboard and Bot in track?
websockets
I do not have the guildmember Intent is it possible to keep Permissions in track?
permissions are role-related
without guildmember you'll just not be able to tracks per-user permissions without constantly fetching
so there isnt a possibility to make a safe dashboard?
Umm
just fetch guilds
from /guilds endpoint
it'll also give permission integers
well, the less intents you use the less real-time options you have
how to remove this, and also it is showing wrong. I removed the code from the bot but it wont go i use djs
once posted I don't think you can remove
you could try posting 0 or a negative value maybe
how can i?
the same way you did that before
#topgg-api pins use the sdk
i removed it months back, so idk the code
You were using dblapi.js?
If you were, that's deprecated which probably explains the errors.
i was using some top.gg package
idk now
that was months back
Use this @lethal trout https://npmjs.com/package/topgg-autoposter
#discord #discord.js #realcoder
Hey am official member of realbot
Source Code - https://github.com/RealPukhraj/Stats-Count-For-topgg
Github - https://github.com/RealPukhraj
If you need any help join
Discord Server - https://discord.gg/k9zFcucTKp
Thank You
Regarding Real e-Sports
Always We are waiting for your joining.
Social Links :
✔ We...
this right?
can u see the vid once?
pls
Learn to code and read the docs
why resort to videos smh
Copying and pasting a youtube solution will only make it harder on yourself. You'll never learn.
It's really not that hard and you can ask for help in #topgg-api
i dont have much time to even watch lol ill make it later ig
our species is devolving
That video is so low effort
egirls as some may say
it's evolving, just backwards
5 fucking minutes of low effort non-explained piece together-smashing
I just noticed someone also posted that video in #topgg-api 🤦♂️
It's literally the guy who created that video
@modern sable can the guy be warned since it's highkey looking like ads
Me: "ask for help in #topgg-api"
Also me: looks in #topgg-api and sees the same video
really? 
Dude
He posted it multiple times
atm i am busy, other times i am free
looks legit
😂
how tf can you have more subscribers than views?
lol
BRUH
Lmao
Lmao I wouldn't copy that video
This is Sending all data of your bot to top.gg web - RealPukhraj/Stats-Count-For-topgg
Literally
It's the fucking autoposter example combined with express for replit
😭
How can I edit a channel perm, without resetting the perm?
I am currently using this:
channel.edit({permissionOverwrites: [
{ id: guildid, deny: ['SEND_MESSAGES']}
] })
Now I want to set SendMessage back to null
@scenic kelp
lol, the channel died
someone needs to teach some logic to these discord.js kids
do you mean for@Meister#9667
^
lol even ocr would work

Teach them Clojure
When they come back they'll know all the ways of JS
lmao
Ah yes
Does anyone know a way to check if a category exists by ID?
Im so confused on how to do it. Discord.JS does not seem to have a way to do it.
You can grab by the guilds channels.
const categorychannel = (message.)guild.cache.channels.get('ID');
if (categorychannel.type === 'category') {
// code
}```
ohhhh
Wait so grabbing the channels also gets the categories?
They all count as channels to discord and by discord.js
i like the new one, its cleaner
Yeah
from discord.ext import commands
i will never understand python, its just too different from other languages, im always impressed by people who know it
Meh honestly it is easy to learn
no semi-colons gets me
I am so used to adding it to the end of a line because of java.
how can i get sudo perms in aws
sudo su
cannot read property 'channels' of undefined
RIP
I believe in your ability to figure that one out.
console.log() is now my friend
Idk what your code looks like. I only assumed you were getting the info off of a message object.
There error seems to be in your play.js command file on line 15 not index.js
Figured it out)
` const Discord = require("discord.js");
const randomstring = require("randomstring");
let dayjs = require('dayjs');
const ticket = require("./ticket");
module.exports = {
name: 'ticketconfig',
description: "Csets the ticket category",
execute(client, message, args, Discord, db) {
console.log(args[0])
let channelID = args[0];
let categorychannel = message.guild.cache.channels.get(channelID);
if (message.member.hasPermission('ADMINISTRATOR')) {
if (!categorychannel.type === 'category') return message.channel.send("That is not a category!\n Please right click on the category you want and click 'copy ID' and use that as your arguement!");
if (args[0].length = 0) return message.channel.send("No arguements specified!")
let ticketchannel;
db.collection('guilds').doc(message.guild.id).update({
'ticketParent': channelID
})
}
}
}
`
When trying to check the channel ID's i keep getting an error "TypeError: Cannot read property 'channels' of undefined"
Double check your message variable is actually a message
It is, when I get the variable and console.log it it logs the message exactly as it should
So that is correct
Yes it is in a server, i have a check for that. So idk, is it an API refrence error?
You need to add .catch to whatever method its telling you to
ok
I'm blind.
It's message.guild.channels.cache
https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=channels
Thank you, apparently we both are blind
rip I got another error
`let channelID = args[0];
let categorychannel = message.guild.channels.cache.get(channelID);
if (message.member.hasPermission('ADMINISTRATOR')) {
if (!categorychannel.type === 'category') return message.channel.send("That is not a category!\n Please right click on the category you want and click 'copy ID' and use that as your arguement!");
if (args[0].length = 0) return message.channel.send("No arguements specified!")
if (args[0].isNaN) return message.channel.send("That is not a number!")`
TypeError: Cannot read property 'type' of undefined
I keep trying stuff and its not working XD
im not good at API refrences
Log chanelID and check it's actually the channel id
Basic data that categorychannel returns: CategoryChannel { type: 'category', deleted: false, id: '854592046098415617', name: 'Ticket Support', rawPosition: 3, parentID: null, permissionOverwrites: Collection(1) [Map] {
So when I try to pull "type" from that list it does not work as it comes up undefined
wait
I should proabably put the isNaN checks and all that BEFORE it checks the channe,
im a dummy
I checked MANY times if the setDescription was without anything written, but even so this error continues to appear:
someone help me?
show code
@summer torrent Not a development question, but your name rings a bell. Are you in TMP at all?
oh yeah, i forgot, thanks lol
I'll see here
what is TMP 
nope
@clever agate so your embed still isn't working?
yep
Rip
I got sad
Same error?
is in a stable version
yep
Right let me take a look here
-needdev
@earnest phoenix
You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.
@clever agate comment out the embed stuff and do console log, to see if res.text actually puts out something
I'm on phone atm so do apologise for late replies
yea
Ah thats good
no problem
@earnest phoenix
no
no.
ignored lul
N.O

also imagine making free bots
ples give me code ples 🙏
imagine making bots
NMWeeb03
are you raccoon
const [a, b, c, d, e] = [1, 2, 3, 4, 5];```
here
free code
thanks
please stop asking. last warning
thank you sir 
being muted

Here's your free bottum
Bottum();
lies
no one is going to make bot for free, Deebs
let bottum = Bottum();
if(bottum.isCompressed) bottum.uncompress()```
@earnest phoenix i fixed ur bad code
-m 743173712232185908
Wtf
🤐 Muted Deebs#0440 (@fluid fossil)
ma! get the camera
are you winning son?
const bottum = new Detritus.Bottum({
compress: true
});
if (bottum.hasCompression())
bottum.uncompress()
.catch(hateDetritus);
Here I fixed your bad code
his is detritus tho
Stink

🗜️
Your embed doesn't have anything in it, so its telling you to at least provide a description
and catch your promises
are defined
but still it doesn't work
That doesn't mean anything, show the actual code at least?
var AND then
You're not resolving your promises, leading up to the continuation of the executing process without waiting for them to be resolved
And yea, usage of the var variable declaration keyword is discouraged
I changed after the print
And did you mind this? @clever agate
vars are hoisters
var hoisted makes bugs
var is hoisted on top of the global scope just like a normal function
I will leave this system aside
The variable declaration isn't really the cause of your error here, the only you gotta do is to use async-await, that's all

you love var, don't you?
i love slapping people who ping me for no reason too

@opal plank
slap me daddy
One message removed from a suspended account.
One message removed from a suspended account.
Whenever I add new stuff to a data model like ```const mongoose = require("mongoose");
const dataSchema = mongoose.Schema({
guildId: String,
conmin: Number,
conmax: Number,
wcooldown: Number,
rcooldown: Number,
welcome: String,
leave: String,
autoroles: Array
})
module.exports = mongoose.model("SBCONFIG", dataSchema), and add like something: String```, How can I make it automatically add the new item<s> to already existing data of the model?
How would you have your bot leave a server using eval (discord.js)
you have to run a migration, schema changes are not retroactive they don't affect existing documents
Code?
let embed1 = new MessageEmbed()
.setColor(ee.color)
.setImage("https://media.discordapp.net/attachments/846572935669874748/855316214481551360/ezgif-7-2e1193fe8d8a.gif?width=606&height=192")
channel3.send(new MessageEmbed().setColor(ee.color).setDescription("Setting Up..")).then(msg => {
//react with embed 1
msg.edit(embed1)
})```
see this
Doss the event that triggers all of this have async?
yes
Make channel13 into a variable/const/let with an await before channel13.
ok thnq
Wait. What message do you want exactly to be editted?
yeah
now you understand
i have const channel13
I gotta go edit dinner now. ;-;
👀
If it is the channel13 message that you want to be edited, then change msg into the channel13 variable name.
trying
So.
i got it solved
let embed1 = new MessageEmbed()
.setColor(ee.color)
.setImage("https://media.discordapp.net/attachments/846572935669874748/855316214481551360/ezgif-7-2e1193fe8d8a.gif?width=606&height=192")
channel3.send(new MessageEmbed().setColor(ee.color).setDescription("Setting Up..")).then(msg => {
//react with embed 1
msg.edit({embed: embed1})
})```
hey i got same error in function
see this
embeds not editing
😩
Wdym?
You need to write code to alter every document and make your change.
Retroactive = taking effect from a date in the past; it won't update your past documents for you.
Hence, you need to do it yourself.
can you join vc
and this, boys and girls, is why we use ES6's named exports
or just module.exports = { getMember, shuffle, ... swap_pages2 }
Can someone abuse buttons?
Should I add ratelimit to buttons on my side?
i get errors when they are dispatched too fast, seems like the client doesnt limit it
which is kinda of a bummer
so yeah, you should limit it
can i ask a dumb question
sure
https://scs.twilightgamez.net/QdmTq.png so I have this api I'm working with that goes like this
getPlayer -> username -> stuff | I'm going through "Bosses" and a few options have strings like in this ss. How would I for example let thing = "abyssal sire"
Tried just doing [0] for the first option but I suppose that's incorrect
let thing = bosses['Abyssal Sire']```
In discord.py,
I made this so if a msg contains a mention, send that mentioned user the msg.
@client.event
async def on_message(message):
if message.user == client.user:
return
if message.guild.id == 799980929056768000:
msg = message.content
if message.mentions:
for member in message.mentions:
await member.send(msg)
else:
return
``` and getting this error
```py
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Users\ASUS\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "e:\! Bot Floder\Aimi\Z Test.py", line 14, in on_message
if message.guild.id == 799980929056768000:
AttributeError: 'NoneType' object has no attribute 'id'
so should i do
if discord.Guild:
if message.guild.id == 799980929056768000:
msg = message.content
if message.mentions:
for member in message.mentions:
await member.send(msg)
else:
return
if message.guild
This been bugging me quite awhile. What is the difference between module.exports and exports?
in all honesty, not much
basically ES6 syntax allows you to do some extra fancy shit like named exports
aliases and a whole bunch of things
this will probably explain better than i do
how to get server link by server id ?
You cant
hii i want the image that my pokemon sends in width=500&height=301 but it sends on width=375&height=375 how can i make it to 500 widtg and 301 height
even i mentioned this on my code
.setAuthor("A Wild Pokémon has appeared")
.setDescription(Guess the pokémon and type ${guild.prefix}catch to catch it!)
.attachFiles([{ name: "new.png", attachment: canvas.toBuffer() }])
.setImage("attachment://"+ "new.png?width=500&height=301")
.setColor(color)
// When the webhook receives a vote
dbl.webhook.on('vote', async vote => {
// This will log the whole vote object to the console
console.log(vote)
// Get the Discord ID of the user who voted
const userID = vote.user;
const votedfor = `<@${vote.bot}>` || `oh 2.0`;
const type = `bot` || `servers` ;
const id = vote.bot || vote.guild ;
const embed = new Discord.MessageEmbed()
.setColor('#FFE082')
.setTitle('New UpVote')
.setDescription( `<@${userID}> Just Voted For ${votedfor}`)
.addField(`Website`, `[Top.gg](https://top.gg/${type}/${id}/vote)`)
// If the channel to send messages in exists, we send a message in it with the ID of the user who votes
if(channelForWebhooks) await channelForWebhooks.send(embed);
})
i cant figure out
how when its a bot it changes type to bot and when its aserver id it puts servers in type
proof and done
i haven't read the voting documentation yet for dbl
{
bot: '810614472607137803',
user: '411704274599542794',
type: 'test',
query: [Object: null prototype] { test: 'data', notRandomNumber: '8' },
isWeekend: false
}
{
guild: '820823816854306838',
user: '411704274599542794',
type: 'test',
query: [Object: null prototype] { test: 'data', notRandomNumber: '8' }
}
so i'm gonna go off of what i think
thats jsut replys
its topgg
it just says dbl
what is type for, u arent even checking, also channelForWebhooks is undefined
also catch your promises
anyway, good luck yeb
o
let channelForWebhooks;
// Get the top.gg API token from the config file
const { topgg } = require('./config.json');
// Make sure to install this with 'npm install dblapi.js`
const DBL = require('dblapi.js');
// The webhookPort can be whatever you want but make sure you open that port in the firewall settings (for linux for example you can use `sudo ufw allow 8000`)
// The webhookAuth is set by you, make sure you keep it secure and don\'t leak it
const dbl = new DBL(topgg, { webhookPort: 8000, webhookAuth: 'penis' });
// When the webhook is ready log it to the console, this will log `Webhook up and running at http://0.0.0.0:8000/dblwebhook`
dbl.webhook.on('ready', hook => {
console.log(`Webhook up and running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
// This will just log errors if there are any
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
// When the webhook receives a vote
dbl.webhook.on('vote', async vote => {
// This will log the whole vote object to the console
console.log(vote)
// Get the Discord ID of the user who voted
const userID = vote.user;
const votedfor = `<@${vote.bot}>` || `oh 2.0`;
const type = `bot` || `servers` ;
const id = vote.bot || vote.guild ;
const embed = new Discord.MessageEmbed()
.setColor('#FFE082')
.setTitle('New UpVote')
.setDescription( `<@${userID}> Just Voted For ${votedfor}`)
.addField(`Website`, `[Top.gg](https://top.gg/${type}/${id}/vote)`)
// If the channel to send messages in exists, we send a message in it with the ID of the user who votes
if(channelForWebhooks) await channelForWebhooks.send(embed);
})
// END OF IMPORTANT PART
// When the bot is ready...
client.once('ready', async ()=> {
console.log('Webhook Bot Tester launched!');
// Get the Discord Channel were we will send the message whenever a user votes for the bot
// Replace channelID with a valid Discord Channel ID were your bot can send messages too
channelForWebhooks = await client.channels.resolve('816905273322766369');
});
there
i can't read this code, lmao
lol
so many comments
sorry im bad
u making shit global? really?
?
Quick guide on how to set up webhooks for your bot on top.gg - Giuliopime/top.gg-webhook-tutorial
lul
@opaque seal yo wtf
ggez git clone
well i took waht i needed
put that shit inside the event scope with a getter from the cache
is it possible to check if its server or bot
to replace for type
because the way topgg links are
Wut
listener.on('vote', async (vote) => {
let channel = <client>.channels.cache.get('id');
let _type = vote.guild ? `server` : `bot`;
//rest of ur shit
})```
good luck
client.once('ready', async ()=> {
console.log('Webhook Bot Tester launched!');
// Get the Discord Channel were we will send the message whenever a user votes for the bot
// Replace channelID with a valid Discord Channel ID were your bot can send messages too
channelForWebhooks = await client.channels.resolve('816905273322766369');
});``` this is retarded
i haven't used that in quite a bit
anwyay, gotta get back to coding
lol
than kyou
I meaaaaan, the code is 10 months old
so can't blame me for that
but
then take it off if you arent going to maintain it
that means you're a bad dev
or archive it
for not updating your repo regularly
i can blame anyone for shit code

fix it
dude I didn't even remember of that shit
there was like over 30 videos/forms that sent me to @opaque seal thing
yea
When i add my bot to a server it does not get a role in its name anymore like before. Why is this happening?
cause my code so good
lol
my spaghetti code unbeatable
wanna see cancer.js?
lmao
no thx
you sure
yep
it's really easy
cool math
Better now @opal plank?
Quick guide on how to set up webhooks for your bot on top.gg - Giuliopime/top.gg-webhook-tutorial
oof
It's easy af
Who said it's not?
How will I know ?
Why did you need to say that then lol
Hello, is there anyone here for hire and is good at programming in TypeScript? My bot developer suddenly fell off the face of the earth and now I'm just left with not even full developed bot. I do have the source code and I'm willing to pay. I just don't trust people on Fiverr so what not a better place where all bot developers come and advertise their bots!
We can end it there ig, just wasn't trying to ve rude at all
yo
Does it need to be typescript?
Well no, it can be fully be re-written if that will be easier. But even though the bot is still being hosted and don't know how even though he hasn't been on for 2 months is there a way to unhost it or host it ourselves?
Just changing the bot token yes
Okay, are you for hire atm or have other projects currently your working on?
Commissioning in this server isn't exactly wanted I don't think 
Ah I see okay I apologize I tried reading everything on the rules but If I missed something I apologize ahead of time.
You're good, I don't think there's a specific rule but sales of development services aren't encouraged in here, probably just to ensure no one has any problems as there are a lot of things that can go wrong
guys i havent tested the buttons on discord (so am i weird or dum)
slap em' with -needdev
Tell clearly ur developer friend died?
U can hire me
I am anice bot develiper
My bot has a lot of cmds
Well last the thing I heard from my dev friend was that his girl broke up with him and he already had a major drinking problem and that was that disappeared
Lots of commands =/= good developer
in all honesty, a bot developer website filled with less than average devs is prob the WORST place to find a ts dev btw
But I have good commands
me feud and a dozen others are the only ones that uses typescript btw
I am a js dev
I am a dev
there are very few of us Typescript devs here
and this is likely a bad idea, you'll likely be hiring devs with less than 4 months of experience in js
average at best
Yeah my buddy told me not a lot of people use TS
Ts is undeniably necessary if you writing big codebases
which is why theres so few people here that use it
most bots are too simple
so ts doesnt provide much help that it would otherwise
Makes sense yeah the bot I wanted is a bit unique maybe that's why he was using TS
mind giving a quick thing of whats it about?
Uh yeah one sec I'll DM you one sec
luca down?
No
or trial?









