#development
1 messages · Page 1024 of 1
Ok so after it gets declined will it again take 2w?
Cuz I'm sure they decline most of them....
Ik ik
Obviously one can't keep track of all the requirements so like most of the bots won't meet them
reposting cuz 2h+
say i have this object
let foo = {name: 'test', location:'somewhere'}```
Now i have a postgres jsonb table
its contains an array of objects inside like foo above.
To query filter it i can do ``filter->>'name'`` to find the proper row that its contained, however:
```js
//in the table
[{name:'bob', location:'bar'}, {a:1, b:2}, {n:1, m:4}]```
lets say i want to replace ``{a:1, b:2}`` obj in that table with the ``foo`` mentioned above(order doesnt matter)
the only non destructive way i see to get that would be using operator ``#-`` with the index of that object.
however im not seeing a way in SQL to get index of that object to define it to be deleted without destroying the array and checking individually
or returning the obj to js and then resending it after its been parsed on the code(instead of using SQL query)
any tips?
module.exports = {
name: 'mute',
description: "this is a mute command!",
execute (bot, message, args){}```
I know this is a basic question but
how do I execute async here?
async execute
lmao
:3
I like your pfp
thanks
let muterole = guild.roles.cache.find(role => role.name === 'muted');```
TypeError: Cannot read property 'roles' of undefined
uhh
hi
const Discord = require("discord.js");
const ms = require("ms");
module.exports = {
name: 'mute',
description: "this is a mute command!",
async execute (bot, message, args, guild){
//!tempmute @user 1s/m/h/d
let tomute = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if(!tomute) return message.reply("Couldn't find user.");
if(tomute.hasPermission("MANAGE_MESSAGES")) return message.reply("Can't mute them!");
let muterole = guild.roles.cache.find(role => role.name === 'muted');```
message.guild
so how do i get it to add the permission when it creates the role
await guild.create_role(name="Mod", colour=discord.Colour(0x2ffde), permissions=KICK_MEMBERS)
muterole = await message.guild.createRole({
name: "muted",
color: "#000000",
permissions:[]
@median star
yes?
you can do permissions like this
this is discord py what im doing
oof
@spare mirage they're using python with discord.py as their library
it's not the same
I k
just wait
there are more than 2 people on this server afaik
someone that's willing to help will help you
or you could just read the docs
which is way easier
zsnails the wise man
;-;
we have a pythoner here
what
bruh
Have you tried searching the API reference for create_role
@pale vessel I was literally gonna say that
I still did tho
I kinda find it funny
can someone help me with a voicekick cmd?
?
https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.create_role see how the permissions kwarg is supposed to be a Permissions object
AKA "just ask your question"
let muterole = message.guild.roles.cache.find(role => role.name === 'muted');
//start of create role
if(!muterole){
try{
muterole = await guild.roles.create({
name: "muted",
color: "#000000",
permissions:[]
})
message.guild.channels.forEach(async (channel, id) => {
await channel.overwritePermissions(muterole, {
SEND_MESSAGES: false,
ADD_REACTIONS: false
});
});
}catch(e){
console.log(e.stack);
}
}
//end of create role
let mutetime = args[1];
if(!mutetime) return message.reply("You didn't specify a time!");
await(tomute.addRole(muterole.id));
message.reply(`<@${tomute.id}> has been muted for ${ms(ms(mutetime))}`);
setTimeout(function(){
tomute.removeRole(muterole.id);
message.channel.send(`<@${tomute.id}> has been unmuted!`);
}, ms(mutetime));
}}``` cannot read property of id `muterole.id`
it doesn't matter
that's not how it works but ok
naming has nothing to do as long as you don't try to have 2 vars with the exact name in the same scope
.roles.create takes an object, but there's a data key for setting the role's stuff: https://discord.js.org/#/docs/main/stable/class/RoleManager?scrollTo=create
no time to wait, the future is now
ok?
message.guild
yes fixed it
another problem
xD
imma fix this myself
message.guild.channels(async (channel, id) => {
await channel.overwritePermissions(muterole, {
SEND_MESSAGES: false,
ADD_REACTIONS: false
});
});``` why is message.guild.channels not a function?
why would it?
because it isn't, a function
.cache.forEach
Sa
Ok
@brisk anvil #memes-and-media
-notr @spare mirage
zSnails got yourself a little clone
@golden condor tamam ab
@sudden geyser lol
you DONT want a forEach
ofc they don't want that
never use forEach
tho I cba to explain how a for loop works
It's the easiest option in this case so shutup
forEach is just another way of doing it. It's fine.
tho I cba to explain how a for loop works
use for()
forEach is just another way of doing it. It's fine.
@sudden geyser exactly, it's the same as a for loop but just presented differently
There are a few differences, but in the end they act similarly (and vary on performannce).
Dude
making points 101
In this case
there isnt a reason to use forEach
It really doesn't matter
there isn't a reason not to use forEach
Just stop getting heated over something that doesn't matter at all.
please stop
im not, you are the one defending something that shouldnt be taught
use for() or while()
Any discord.js developer wanna make a bot with me?
i gave you reasons not to use forEach()
Dude, we are just explaining one way of doing it.
there's a big gap between what someone says, and what someone will do
though neither told them to use either of those 2
Qaazy sadly I'll pass
if you just explain, use a loop as example
There is nothing wrong with .forEach except minor performance issues
They were trying to use a forEach
though neither told them to use either of those 2
@opal plank we didn't explain because the person was trying to use a forEach loop
you can get that from the code they were trying to run
then just calmly explain to them that forEach is a bad loop function, and they should for for(var in cache) =>
instead
v a r
dont use vars either
I agree with that
You are complaining at us for using forEach while using var, thats ironic
var in this context just mean (seomthing)
umm, Is there something wrong with permissions
for in isn't much better as it can have issues with prototyping. ¯_(ツ)_/¯
oh wait
Justii the role permissions? Did you pass { data: { ... } }?
that's not api abuse
while (true) { function(); }
if(!muterole){
try{
muterole = await message.guild.roles.create({
name: "muted",
color: "#000000",
permissions:[]
})
message.guild.channels.cache.forEach(async (channel, id) => {
await channel.overwritePermissions(muterole, {
SEND_MESSAGES: false,
ADD_REACTIONS: false
});
});
}catch(e){
console.log(e.stack);
}
}```
someone knows how can i add background color to a div class?
I added it to the CSS file but nothing :(
@ember lodge you can do it in the div like style="some CSS here"
I mean, i want to add background color to a part of my website
@ember lodge .class {/rules here/} that should work lol
body {
background-color: hex code
}
Added it to what element
did you include the stylesheet
i am doing it on <style> tags inside html file
can someone help me
.class {
rule: rule example;
}```
did you save?
i n d e n t t h a t p l e a s e
yes?
it haves autosave
Does the element have that class?
haves
Try put color: black
no?
yep i think
Check
nothing
color is for text, they want the background to change
This is what i have:
<style>
.spec1 {
display: block;
background-color: black;
padding: 16px;
color: black;
</style>
<div class="spec1">
a
a
a
a
a
</div>
You have a syntax error in there
close the rule
you're missing a closing bracket }
do you want something like a wave on the bottom?
or literally just a black rectangle
Wave would be good
maybe this? https://getwaves.io/
muterole = await memssage.guild.roles.create({ data: { name: 'muted', permissions: ['SEND_MESSAGES', 'ADD_REACTIONS'] } }); how do I make these permissions false
Thanks 
by default, anything not in the array will not be enabled
you mean disabled?
yes
you could try it and see if it does
deny is for permissionoverwrites
@pale vessel So i added them but now it haves that white line
reduce the margin
how? 
is the site live?
yep
send url
muterole = await message.guild.roles.create({ data: { name: 'muted', permissions: ['SEND_MESSAGES', false] } });```
How can I make 'SEND_MESSAGES' false
I fixed it lmfao
amazing
Don't include it
fix your avatar class
p e r h a p s
@spare mirage the permissions you don't include wont be enabled lol
so if you only have read messages they can't send messages
bruh
@pale vessel what i have to do 
learn css mate
^
lol, i am new on this tho, thanks 
you most likely didn't close your avatar class
lol
take a look again
It's closed

Just. don't. include. it.
done
you're right that did nothing
What is this and why is flazepe a weeb
flazepe is a weeb because he knows whats good
always has been
Hey, do someone know why can arraybuffers and external memory get so high after running the bot for 1 day?
Is that BetterDiscord? 
:o
Wait discord has that?
on phone
Yes 
click dark theme several times iirc
hurts my eyes
So do you know?
How many servers is your bot in?
^
Let me show you
Just evaluate .guilds.cache.size
That's A LOT for 258 servers
^
Stronge
muterole = await message.guild.roles.create({ data: { name: 'muted', permissions: ['SEND_MESSAGES', 'ADD_REACTIONS'] } });
const permissions = new Permissions([
'SEND_MESSAGES',
'ADD_REACTIONS'
]);
permissions.remove('SEND_MESSAGES', 'ADD_REACTIONS'); ```
why is this still not working
You are not removing perms from role.
you already overwrote them in forEach
I deleted that part
you don't even need to provide permissions for roles.create
you'll be overwriting them
uh
oko
message.guild.channels.forEach(async (channel, id) => {
await channel.overwritePermissions(muterole, {
SEND_MESSAGES: false,
ADD_REACTIONS: false
});
});``` like this
yes! works thanks
I need some assistance. No matter what I do, I can't seem to get my bot to delete messages sent from a specified channel
I've tried many variations and such (I also double checked the bot perms and it seems to be good)
How to make
The bot delete message
Itself
Of his
Like he sent I deleted 29 messgaes from this channel
Then it delets this^
msg.delete
The send method returns a promise containing the message object. Resolve it then call .delete() on it
No, msg.channel.send("Fetching details...") will return a promise
resolve that promise and then call .delete() on the returned value
What
If you want to add a timeout, put the code inside a setTimeout (https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout)
Ok
learn the basics of promises, and async code
.then(msg => {
msg.delete({10000})
yeah, but I cba to explain async/await 
what's your native lang?
hindi
@cursive laurel Should msg be message? lol
cba??
@delicate shore can't be assed
no
ok
@cursive laurel Should msg be
message? lol
@tulip oak not always
i have set it to msg
in starting
so
[foxxo]
Oh
@cursive laurel I'd reccomend learning about arrows, but for now let's just say that the word before the arrow is a placeholder, it can be whatever you want but it will always be linked to that specific listener
it's a function
just some syntactic sugar
message => {} is the same as function(message) {}
@pure lion I'm still learning the ropes of more complex coding. I only know the basic stuff of making bots
Ok
I'm in your shoes rn
if you don't know how functions work then that's the first thing you'll need to learn
Majority of what I did is basically looking through stuff online
brvh
and using that as a template to base it off of and work with my own edits
@cursive laurel how many servers is your bot in
My basic bot is in about 220 servers. This 1 im currently coding is private
wot
Ssssh
People love randomized video responses :P
I have that too >:c
ssssh
im just to lazy to submit lol
my parents won't let me
Well I wouldn't consider myself a "true" 1 until I actually know more complex coding than the tip of the iceberg basics
...
Why would you want that
shuffle command
well
s!play gets a popular song
kekw
is there any way that if someone do s!rickroll it stars playing rick roll in the VC the person is
like
@pure lion
Wait
ok
A bot just dmed me
s!ping
sad!
s!help
i got 10 dms
yes
s!help
s!help
wtf
Oh no
r!h
Ok
So
Staff
if we run cmds here
like if i say msg.content blaah blah blah and if it includes s!help
the bot dms
me
like if i say msg.content blaah blah blah and if it includes s!help
@delicate shore
s!help
then RIP
lol
ok
10 pings
ys
s!help
bruh
ok
What is the result you want? @delicate shore
@earnest phoenix I am complaining
Blacklist this channel then.
@earnest phoenix if you do s!help or d!help your DMS get filled so why can bots see this msg ?
then stop complaining
why
you do s!help
why are bots allowed to see this channel
Ok
because korea
why are bots allowed to see this channel
@delicate shore
let image = "https://media1.tenor.com/images/d8a030a99a3475c938607856c0ac7968/tenor.gif?itemid=16262406"
Canvas.loadImage(image)
``` what is wrong here?
you tell me
await canvas
or it will throw error
command runs ahead instead of waiting for loading image @earnest phoenix
await loadImage
ok
I'm having trouble in a next command
I'm using python
I want to stop the bot from executing next command once it's executed
Can I dm u the code?
Just keep it here
sorry
idk python
That's js
no?
Switch case is js?
py doesn't have switch
{ name: 'Servers:', value: 'client.guilds.cache.size', inline: true },
{ name: 'Users:', value: 'client.user.cache.size', inline: true },
)
```
It is not giving me desired output
well you're passing it as a string
wut version is that
what you probably meant to do was use the getters on the variables
but you encapsulated it in a string
How do you get a command to be dm only
like for guild only its @commands.guild_only()
how do u do dms
if(!message.channel.dm)return
wait lol
yeah its ok
502 Bad Gateway whats causing this?
503 means server not responding
on ubuntu
how do i make so a command can only be used in a certain channel .
compare the channel id
^
const { MessageEmbed } = require("discord.js");
const pdb = require("../../db");
let prefix = pdb.get(`Prefix_${message.guild.id}`) ? pdb.get(`Prefix_${message.guild.id}`) : "lt!"
const e = new MessageEmbed()
.setColor("#ff9900")
.setThumbnail(bot.user.displayAvatarURL({ dynamic: true }))
.setDescription(":warning: **The default prefix for** **__Legendary Bot__** **is lt!**\n**If you want a more detailed description about a command you can use lt!help [commandName]\n\nAnd if you want to change the prefix use lt!cc prefix [prefix]** \n\n\n:tools: `-` **Moderation Commands**\n\n`addrole` | `ban` | `clear` | `kick` | `mute` | `removerole` | `unban` | `unmute` | `warn` | `warns`\n\n\n:battery: `-` **Fun Commands**\n\n`8ball` | `animememe` | `birb` | `cat` | `catfact` | `coinflip` | `dance` | `dog` | `dogfact` | `fight` | `fox` | `foxfact` | `howgay` | `howlong` | `howsexy` | `hownoob` | `koala` | `meme` | `panda` | `pika` | `roll` | `rpanda`\n\n\n:money_with_wings: `-` **Economy commands**\n\n`beg` | `buy` | `buylist` | `credits` | `daily` | `deposit` | `pay` | `profile` | `roulette` | `sell` | `slots` | `weekly` | `work`\n\n\n:heart: `-` **Love Commands**\n`angry` | `cry` | `hf` | `hug` | `kiss` | `slap` | `wink` | `pat`\n\n\n:compass: `-` **Info Commands**\n\n`settings` | `avatar` | `userinfo` | `botinfo` | `serverinfo` | `avatar` | `covid` | `ping` | `support` | `invite` | `stats`\n\n\n:miscwe: `-` **Misc Commands**\n\n`poll` | `report` | `votekick`\n\n\n:gear: `-` **Config Commands**\n`settings` | `cc`\n\n\n:musical_note: `-` **Music Commands**\n\n`play` | `skip` | `skipto` | `playlist` | `queue` | `volume` | `loop` | `pause` | `resume` | `nowplaying` | `search` | `shuffle` | `stop` | `remove`\n\n\n:peach: `-` **NSFW Commands**\n\n**For NSFW Commands please write lt!nsfw in a NSFW channel!**")
.setFooter("Help command | Made by Sabin");
message.channel.send(e);
error:
fields.flat is not a function
help ?
upgrade node
d!help
@spare mirage 👏🏻 you crash my bot :c
https://discordapp.com/channels/264445053596991498/272764566411149314/729244885965864990
fields.flat is not a function
@earnest phoenix are you sure this is the good file ?
the function doesn't exist in the node version they're using
flat is introduced in node v12
@earnest phoenix how?
@earnest phoenix yes, i m sure
@earnest phoenix how?
@spare mirage because bots can't send message here
that wont break it?
discordjs*
hmmm
patience is key
its not exactly 2-3 weeks it can take a little bit longer. If you are Denied Luca (bot from here) will send you a DM and you get a Notification here on the server
lul
why is typescript doing that help how do i make typescript stop doing that
I can't see how it can be undefined as it checks if there's at least 1 module in the array right before that
use optional chaining
variable.whatever() turns into variable?.whatever()
yea i already did it thanks
it's fine dw
moden es features are great though
how do I access this https://lumap.is-inside.me/W1751LFx.png with css? (top.gg bot page)
class starts with ., IDs being # and tags with no prefix
i fucking forgot how css works
you can also right click it and copy the selector
hm, im having a small issue, im passing an object through the backend to frontened, and when i try to use the object in the frontend, it says its not defined. any ideas?
my backend code: js res.render('chat', { user: user.findOne({ id: req.params.user }) }); my frontend code: js socket.on('message', (message) => { createMessage(`${user}: ${message}`); });
and what are you rendering?
wdym?
the render function is usually used to render/build ejs files
Hey yesterday I was told that to make the buttons transparent (on site) I would have to deal with opacity. However I have no idea what div class the buttons on site belongs to.
In that case what should I do
how can i make my discord bot dm a specific user in glitch.
where i would type (prefix)dm @user (contents of DM)
@vernal vapor right click on these buttons, and inspect
how can i make my discord bot dm a specific user in glitch.
where i would type (prefix)dm @user (contents of DM)
@noble dagger check for mentions
yeah, it everything works, like the code in the chat.ejs file, but for some reason, it says user is not defined.
so you are rendering the chat.ejs file?
ok, tnx @golden condor
show that file
Ahh true thanks :) didn't think about that
yeah tim, and 1 sec
J'aurais besoin d'un code nodejs quand qu'elle qu'un rejoin le serveur !
Me PM
dont you have to use ejs's <% %> tags
you can use the script tag too
no i mean
you're doing render(file,{data})
to use that data in the rendered file, you need to use <% data %>
because basically
lik<%= user %>
ejs is a template builder/generator
it's html without that
so the render function reads your ejs files, and replaces all ejs tags with the data you provide
then sends to the browser
this is in the script tag?
the <% tags are like placeholders for the render function
for example
if your file is <html> <% bla %> that means you have an html file, and you want to replace the bla placeholder with some data that you will give
and this data is given through the render function: .render(file,{bla})
the render does find and replace on the file
before sending to the browser
so i can't use that data in the script tag? im confused
you have some user data
and you're sending it to the file through the render function
but in the ejs file, you need to define where you want to put this data
you can put it anywhere, but since its json data, it will only work inside script tags of course
in the script tag, i put it there and I get a syntax error
something like that
probably better to not duplicate it
var user = <%- user %>
because the ejs user is a variable that contains everything you passed in the .render() function
and this data needs to be placed in the html file, as text
so basically, the <% user will be replaced by full json data
and the fully rendered file will look like this
var user = {
bla: 10,
bla2: 20,
etc: 50
}
you might need to stringify it, idk if ejs stringifies objects into json by default
it doesn't.
what error is it? server side or browser side?
you can always check page source to see exactly what the fully rendered html looks like
btw doesnt user.findOne() need to be awaited?
OH
when working with rendering and templating engines, always check both sources, the server side source, and the browser side source, so you can see exactly whats going on
for example, compare your chat.ejs file to the source code in the browser (right click, view page source)
and you will see what ejs is actually doing to the file, and you can find any problems or mistakes
it works btw
but I get a syntax error idk how to fix. when I do the const user = <%- user %>
it turns it into an object
and then the object id isn't a string or anything:
thats in the sources thing
this is the page source after rendering?
yeah
kk
ah ha, thanks tim :D
ok uh, js socket.on('sendMessage', (message) => { socket.emit('message', message); }); it doesn't send the message? any ideas why
im pretty sure it was working fine before.
@quartz kindle thank you for d.js-light. i use it now in 3 Bots and got my largest one down to 86MB ram (from 160MB)
inferior Dev noises<
ok uhmmmmmmmmmm
i fixed that, but now I create an account and it just loads, I found out where its coming from and its here: js const nu = await user.create({ id: Date.now().toString(), username, password: argon2.hash(password) }); does anyone know why this is happening?
how to use hyperlink in field discord.js v12
@lusty quest awesome lmao
hyperlinks have nothing to do with the library, or even the language. its markdown
[title](url)?
https://greg.schueler.us/doc/markdown.text#:~:text=(See bottom for more info about Markdown itself.)&text=To use text for the,up when you hover").&text=You%20can%20also%20put%20the,like%20%5Bthis%5D%5B2%5D this might help
is rainboe bot name allowed
https://discord.com/developers/docs/topics/rate-limits
i dont think so
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
shit not this link w8
@hazy girder your css can't be too flashy either btw
rainbow text is generally kinda flashy, though if it only changes colour very slowly then you should be good
• Use CSS/JS or anything to hide DBL placed ads/banners
Ping if you wanna join the esolang gang
is that an ad
rip
No
what does this esolang gang do?
It's not an ad because you're not buying anything and nobody will get anything good out of it
what does this esolang gang do?
Make joke coding languages
Neither do i :D
if i did wouldve joined
Dude
You could literally tell me to add something and ill add it
It could be anything
meh idk lol
im here cos i need help with my bot lol
:D
Epic
Now I just gotta find a workspace for that
Let's ask tim
@quartz kindle what workspace can I use to make an esolang?
i swear
You swear
you can use anything
a programming language is essentially a program that converts text into code
so you can technically code a programming language in any pogramming language
What would I name the file, how would I make the syntax interpret it and have the cool drop-downs?
wdym cool drop-downs, like inside a code editor?
Yeah
you'd need to make a script/plugin/extension for said code editor to support it
how do i make the bot know whoever sent a message?
message.user?
Well
if your target program is a binary executable, like an .exe or something, you'd need to translate your code into machine code, take a look at what other compilers do
If you want a guild member object you do message.member
if your target program is a binary executable, like an .exe or something, you'd need to translate your code into machine code, take a look at what other compilers do
Say I wanted it to be like js and python had a threesome with the letter h
how can we hide this
now i made it if someone says "ayay" excluding ME the bot will say "ok"
Break monitor
fun
@hazy girder .shapes-background iirc
:o
js and py are interpreted languages, so you'd need to write a program that interprets them
Yeah that's what I'm getting at
@slender thistle i had to put shapes-1 too since the background-image came from that
How to write interpreter in hode hs
hode hs
Yes
Introduction to the compiling/interpreting process by making a simple calculator application in JavaScript
Ok what if I wanted to make a lang from scratch
something like C?
everything is built on top of something else
back then there were tapes with holes in them to represent zeros and ones
then someone made up a language to represent binary operations more easily
for example assembly
then someone made up a language to represent functions and operations more easily, for example C
so everything is built on top of something else
it all depends what is your target
if you want to write a language for computer controllers and hardware operations, you'd probably need a very low level language, like assembly
if you want to write a scripting language for node.js, you can write it in js
aaaaaaa okay
languages are built in a similar way to frameworks
they take low level code and represent it in an easier way to work with
wait bruh
imagine reacting to own msg
and trolling it
discord.User
P.S. this is #development
the v8 engine (javascript interpreter) that powers google chrome and node.js is written in C++
Hey so I'm making a discord bot using java and I got stuck on the help command. I have a main driver file and then a folder with a bunch of commands that all have an object that contains information like the description, usage, etc. How can I access these objects without having some sort of list in the driver that I have to manually update? I just want to be able to get the information for each command so it can be displayed in the help command.
@quartz kindle time to learn 🌊 ➕ ➕
@earnest phoenix Do U mean a help command that automatically updates?
yeah basically
hmm
java should have some way of reading a directory and listing its files, and then importing those files to obtain its objects
bruh what
Yeah I was thinking of doing that, but i'm not sure how to create objects based on a string name of the class
I meant to what Tim was saying
its all good
even using your way (which could work) I would still have the same problem, the only difference is that I would be writing to a file when I can just get the list of files in the directory seperately
Tru
V12? @cobalt spruce
im not a java dev, so i cant help, but look into importing and exporting objects between files
users.fetch
I might have found something, thanks for the help @quartz kindle
am using my old bot script and do some fixies
good luck, you'll need it
how do good leveling systems work?
Tankya
writing a bot in C is beyond hell
@spare mirage add xp on every message, set the amount of xp per level and boom
C++ yet?
lol yeah turns out that thing I found is just a different format of the same problem, Ill keep looking
this is a new error to me
Seems easy @pure lion
Did you read it? @cobalt spruce
lol
yea
Tell me what it says
fetching unban as a user yet?
That has less pixels than I have braincells
all images in the world have less pixels that the dumbest person on earth's brain cells lmao
Snowflakes are IDs
Looks like your putting unban where an ID should be
*
ogged in as Ahx#4022!
(node:10888) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
user_id: Value "unban" is not snowflake.
at RequestHandler.execute (C:\Users\Abdo_Mido\Desktop\islam2\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:10888) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:10888) [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.
````
here is the erro
that try catch doesnt work if you dont await it
Thats not a v12 issue I dont think
@quartz kindle uhhh
also, reason should not be inside an object
Args[0] is generally the command uWu
also, what is your node.js version?
v12.18.2
several people are typing
ShitDev is most likely right, hes getting that unban is not a snowflake, which likely means args[0] contains unban due to being the unban command
@solemn latch why slice 1 when you can do it later
It's not a v12 issue; it's an issue with how you're parsing your user arguments.
r?unban @Lite bad -> unban @Lite bad (.substring) -> ["unban", "@Lite", "bad"] (.split)
Because do it globally and then you don't have to duplicate code
M e h
You know the command name from that point anyway
But switch case do be useful tho
nice
We will teach you
@cobalt spruce args[0] -> args[1]
guild.members.unban
hmmm
Perfectly legal 😄 👍
is there a way a bot can check every message if theres a specific word in it?
i was thinking of a way to ban everyone from a guild using a command without for loop
Pray tell?
lol
my bot doesnt have a prefix
ok
slice command then
ok
@elfin flower what language?
discord py
English
Windows
guys what's rong with my create channel script when i try to ban or mute it send this
is there a way a bot can check every message if theres a specific word in it?
on_message:
if "some text" in message.content
if 'whatever' in message.content:
np
@cobalt spruce channel.name?
why is my bot spamming
lmao
send ur code
LOL I WONDER
return if message author is bot lol
i didnt tell it to spam
Is your bot checking for a word, that your bot then says
dude, theres no need to be rude if he's asking a question
🤔
I didnt put a while True: why is it doing this
It's checking every message right? So it's gonna do something on every message if you don't limit it
send ur code, blout
Including its own messages
if (!message.content.startsWith('balls')) { return } else { cool shit }
if "hello, bot" in message.content:
if message.author.id != 612900626799788042:
await message.channel.send("hi")
Um
id in quotes
We need moar
hmmm
id in quotes didnt work
yes lol
^^
wait
in python? no
i fixed it
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
I was gonna say but I'm reartar
EYYYY
im big brain now
Break it again so you can learn how you fixed it, that's what I do all the time
👍
how do you not see the colons tbh
wait
a
tested it and it still spams
Oh no
and there is a while True: in the code above it
Why loop tho
eh the code isnt important
why the while True: though
The code is everything
What name do you mean
Its how you tell a bot to do stuff
so it checks everytime
The name of?
the guild
the server
if it gets changed then it prints
i deleted the code
maybe that can help
sounds like on_guild_update
Also not sure of py but do emitters and listeners work in a relatively similar way to js?
Shit happens, it triggers more shit?
@pure lion
Yes?
Essentially, that's how event emitters work
