#development
1 messages ยท Page 1247 of 1
but you can literally sort it already reversed

how i can make string to object ?
a string is an object
JSON.parse()
ok
oh, a string of json?
https://discordapp.com/channels/264445053596991498/272764566411149314/755877845686812732
other way around is JSON.stringify()
nah not working
it does
I don't get HTTP request shit
I put them straight to my brain knowledge archive which is slower than an HDD
what
yeah

It's a protocol, ie: a standard that is well documented
JOSN.parse works
how i can get the image that acttached
@earnest phoenix thx. i removed the reverse think and changed "a-b" to "b-a" and its worked ๐
i literally gave you the entire fucking code you needed to use
._.
now its sorting it without affecting elements who havnt got changed
Hi
Don't Just Say "Hello" in Chat.
I'm having some really weird issues with my two bots hosted on the same VPS.
Basically, doesn't matter which one I start, any of the two will say:
Error [SHARDING_READY_TIMEOUT]: Shard 0's Client took too long to become ready
And then after a bit they start working but with a ping of like 1 second
Just, why?
your vps is too weak to handle it
It's a google VPS
micro?
I'm using only 50% of ram
specs?
one sec
It's in Italian sorry, top left is CPU, top-right firewall blocks, bottom-left RAM, bottom-right Disk
So no issues there
Could have been an issue with google's internal servers, maybe it was their connection problem
One message removed from a suspended account.
why do you have two pm2 processes named index
@swift umbra they are two different bots
Quanti core e thread ha
un sec
n1-standard-1 (1 vCPU, 3,75 GB di memoria)
I don't know how to see CPU's specs
what no its mine
how to set a number of voice users?
How do I see how many servers my bot is on?
@slow otter what library
discord.js
sharded or no
no
message.channel.send(editTimer).then(msg => {
code
})
``` How do i get a embed sent after that^?
I want to lookout for new embeds in code
or message

what
So I am tryna get new messages in that code section
like using a collector or something
messages sent from user/bot
I'm wondering if it's Discord.MessageEmbed() or Discord.messageEmbed()
first one
Oh ok thanks
const { readdirSync } = require("fs");
const categories = readdirSync('../../../handlers/command') why does this error
no
@slow otter client.guilds.cache.size iirc
ok tnx
i havent booted a bot in a while, can anyone tell me why my bot keeps spamming
wdym?
Fix your code?
says no errors in code but does this
looks like a code issue
mabie im using something outdated
It wouldn't work if so? Didn't Discord disable discordapp.com api
this is what its spamming, and its the only command
bot.on('message' , msg=>{ if (msg.content = "BThelp") msg.channel.send("Hi! I am BotTale, the robot hosting a video game. Updates coming soon!") })
im stupid i realize what ive done

Hi, I'm trying to create some sort of voice channel that will create temporary voice rooms I don't know if you've seen this before. in short I put some info that I could need in a json and from there I don't really know how to do this to say that I don't know how to get if a user joins a voice on which he is blacklisted he is automatically kick
{"users":{"363402633752477696":{"id":"363402633752477696","ChannelID":"755899365662523472","blacklist":["175987611465154560"]}}}```
how is it stored in my variable
hmm now this is an interesting predicament
how do i teach someone new to coding in python how to code exactly without spoonfeeding them
weird question to be asking but they want to get into bot development (which i advised against but not stopping them)
There are tutorials on yt that walk people through it
yes however i chose to tutor someone but really have no idea where to start
its for psuedo "internship" but i am not a good teacher
Try watching how other people teach
ngl good idea
its crazy how the people who make programming tutorials never get stuck on anything
i want that kind of confidence some day
I've watched some get stuck
At least it teaches people that even experts make mistakes
how do you check if a variable is an integer in javascript?
ty
i just used isNan()
works too
ive got a d.py question thats related to cogs and antispam and that stuff
@commands.Cog.listener()
async def on_message(self, message):
if message.author.bot:
return
try:
authors_last_message = self.last_messages[f"{message.author.id}:{message.guild.id}"]
if message.content == authors_last_message and not message.author.permissions_in(message.channel).manage_messages:
try:
await message.delete()
except discord.Forbidden:
pass
except KeyError:
pass
self.last_messages[f"{message.author.id}:{message.guild.id}"] = message.content
i have this event, it works, it deletes messages that a user spams, but it only deletes the same message, so if a user spams the same letter it will delete, but if a user just slams their keyboard and spams that, it wont delete, how can i set it to delete messages rapidly sent by a user?
Feel free to ping me if you know
Hello how do i check if message.content has a discord server invite link?
.test() or better yet, indexOf(url) @sharp thicket
like
look up what those methods are if you dont
sorry i did not see that message ๐
it brings up something about embeds thats not even in docs lol
it didn't bring that up lol
because thatโs javascript
indeed
also includes() is part of array, not string
if(message.content.includes( indexOf(url)))
Ik im stoopid
The ping command Iโm using for Python is increasing
Says 200+ ms when it responds instantly
200ms is still pretty much instant
for a chat app like discord that is
for an online game its an eternity
oh yeah
sure is
I know, but itโs at 30 on restart
im stupid my english retard today
Then jumps about an hour long
how are you measuring it?
thats the websocket ping
should be correct
however websocket ping has no impact on sending
only on receiving
its basically the ping for how long it takes for a message to be sent from discord and received by your bot
So, that is normal?
Idk why itโs like that
websocket ping is measured by comparing the hearbeat latency, which happens only once every 45 seconds
Someone knows a npm library to do this text: "๐ซ๐ธ๐ต๐ญ ๐ฒ๐ผ ๐ซ๐ฎ๐ช๐พ๐ฝ๐ฒ๐ฏ๐พ๐ต"
and it takes 3 of them to get an average
?
thats why if you run the ping command twice in a short time, it will show you exactly the same value
could you not use epoch to measure it?
since heartbeats only come once every 45 seconds
send payload with epoch, expect api to return epoch too
you mean to the gateway?
Yeah, idk how to do that
not for discord specifically
but if i were to get an epi
api*
wouldnt use epoch be a good approach to measure latency?
pc(epoch now) => api(recieved epoch) => parse => api send(epoch 2) => pc(recieve epoch 2 from api and 1)
you have to compare 2 timestamps generated in the same machine
since 2 machines, in this case discord and your bot, can have their clocks not synched
How do I see how many people are seeing my bot?
it is, but relies on your clocks being synched
Oh, now that I have woken up the box from idle, itโs back down to the 30s
@slow otter which language?
@opal plank discord.js
@hasty mulch its normal to oscillate up and down
you want the accurate or the estimate?
and since it only updates every 45 seconds, it will take a while for you to see changes
for estimate you simply loop your guilds.chache and add members
if you want precise, map members in each guild
you want the accurate or the estimate?
@opal plank estimate
that way you remove duplicates
only online users or also offline?
ok tnx
hey i need help
reduce() prob best in this case i assume?
database + memory
i use json files to store peoples info
wdym
idk any database
depends on what you're going to be using in the future
||though postgres stands above all as the superior database||

sqlite is simple to use, and easy to setup, and it makes you learn SQL which is a good skill to have, and you can apply to other databases as well
im a postgres supremacist
can u teach me postgres?
i can aid you,not teach you
json will just rbing you problems
try to write and read the file at the same time and see what happens

json gets easily corrupted
Someone knows a npm library to do this type of text? : "๐ซ๐ธ๐ต๐ญ ๐ฒ๐ผ ๐ซ๐ฎ๐ช๐พ๐ฝ๐ฒ๐ฏ๐พ๐ต"
i'd recommend sticking to something rather than going all over the place tbh
@modest smelt depends on what do you mean by nuke
How can I put the users who are using it in the bot status
thats only online and cached users
@slow otter do you want an estimate or accurate number?
accurate number
then for every guild you have, map the members
let map = new Map()
for(guild of guilds cache){
for(member of guild) {map.set(member.id)}
}
map.size```
will bring the accurate number
tnx
thats cuz it'll override entries that are already there
yeah
the channel itself to not show up on top but bottom
@modest smelt depends on what do you mean by nuke
@fast loom it will basically delete the channel
and then make a new one
since if I remember correctly... Categories were showing on the botton and channels on top
with the same permissions
yeah it should be possible to make it
uh...
and when you type the nuke command
it will check if the channel exists and then delete it, after that re-create it
๐
ok
I'll check my code and give you an example
Can someone help me with db
how to nuke a channel in discord py @opal plank
what
dunno,i work with typescript not py
LOL
Oof

@modest smelt I told ya. overwrite permissions and channel.delete + guild.add.text_channel (overwrites)
nuking mean deleting
how to do that?
look them up in google or wait til tomorrow
so Im doing this
let ID = await db.get(`ID_${message.guild.id}`)
Checking if it is nil if so I have it send a message to add the id in the arg 0
once I did that it didnt work
let ID = await db.get(`ID_${message.guild.id}`)
if(!ID) {
if(!args[0]){
message.channel.send("Need valid ID")
return;
}
db.set(`ID_${message.guild.id}`, args[0])
its so annoying that i had to tone the ratelimit down

its taking 15 minutes longer to cache all channels
erwin could you help me ๐ฅบ
db
which?



hahahahahahahah
haaha
so how many requests can you make to a specific api per day?
or it's different
i make a call to the twitch api every 60 seconds to poll for if a specific streamer goes live so id say not like once every second
P.s. why
@modest smelt
1. That's how you overwrite permissions + Creating the channel
guild = message.guild
overwrites1 = {
guild.default_role: discord.PermissionOverwrite(change_nickname=False,
add_reactions=False, attach_files=False, read_messages=False,
external_emojis=False, manage_messages=False,
read_message_history=False,
send_messages=False, send_tts_messages=False, embed_links=False,
manage_channels=False),
discord.utils.get(guild.roles, name=VIP_ROLE): discord.PermissionOverwrite(
add_reactions=True, attach_files=True, embed_links=True, external_emojis=False),
searcher: discord.PermissionOverwrite(change_nickname=False,
read_messages=True, manage_messages=False,
read_message_history=True,
send_messages=True, send_tts_messages=False,
manage_channels=False)
}
channel1 = await fGuild.create_text_channel("channel-name", overwrites=overwrites1)
##################################################################################
3. That's how to delete a channel/category
await channel.category.delete()
await channel.delete()
now that you have all the example code, go adapt it to w/e you need
and you're good to go
ok
hello can any one help me for my bot pls
I have a problem that I don't know how to sweeten my server
@fluid widget what's the bot problem ?
update your node
^
I did an update but when I run it on node index.js It works and there is no problem
But when i'm on pm2 start index.js I ask for some of the commands to come to me with this problem, and I don't know how to solve it@quartz kindle
when you update node, you need to reinstall pm2
@quartz kindle
you dont need to uninstall it, just install it again
npm install -g pm2
also, check if your node version is really updated
how can I have a number in my string?
node -v
Groups[1]
@quartz kindle
thanks
@quartz kindle look up
@modest smelt
1. That's how you overwrite permissions + Creating the channel guild = message.guild overwrites1 = { guild.default_role: discord.PermissionOverwrite(change_nickname=False, add_reactions=False, attach_files=False, read_messages=False, external_emojis=False, manage_messages=False, read_message_history=False, send_messages=False, send_tts_messages=False, embed_links=False, manage_channels=False), discord.utils.get(guild.roles, name=VIP_ROLE): discord.PermissionOverwrite( add_reactions=True, attach_files=True, embed_links=True, external_emojis=False), searcher: discord.PermissionOverwrite(change_nickname=False, read_messages=True, manage_messages=False, read_message_history=True, send_messages=True, send_tts_messages=False, manage_channels=False) } channel1 = await fGuild.create_text_channel("channel-name", overwrites=overwrites1) ################################################################################## 3. That's how to delete a channel/category await channel.category.delete() await channel.delete()
@fast loom im not sure how to use this
@quartz kindle Im using api and the stuff in it is named 1 - 19
yes
@quartz kindle
bcs
sudo isnt a npm
oml
sudo is
super user do
so
sudo npm
please understand how to use lunix before programmin with it
@solemn leaf i only use windows and i change to lunix
sudo npm install -g pm2
lol
@solemn leaf which data do you want?
I want the data from the number
so ill
prob do something like
string would be 1 - inf until there isnt anymore allies
anyone can help me for this
if that link is response.data then response.data.Groups[0] gives you the entire first group
this is Groups[0]
says it is empty
what is empty?
how can I have it loop for a certain amount of times
12.18.4
did you reinstall pm2?
yes
do pm2 update
did you type pm2 update?
yes
did it show something about reloading?
wait 1m ok
@quartz kindle how can I loop something for a certain amount of times
everyone wants a piece of Tim
the error is in pm2 logs?
then feilds.flat isnt a thing
yes @quartz kindle
@faint prism hi
add console.log(process.version) in your code, then do pm2 restart index2 && pm2 log
for loops
^ this tbh
for(let i = 0; i < N; i++)
or foreach if you're not modifying the collection
or(let i = 0; i < Number?; i++)
yes
Number?; ?
ok
arr = [elem1, elem2, elem3] // length = 3
arr[0] == elem1
arr[1] == elem2
arr[2] == elem3
for (i = 0; i < arr.length; i++)
arr[i]...; // iterate over each item in array
in python, how do i check if a member was mentioned?
this is what i have
async def kudos(context, user: discord.Member):
if user:
do this
else:
``` and it says that User is a required argument that is missing when i want to check if someone was mentioned, and if they are, carry out the `if user` and if not, go down to the `else:`
@ me if you can help ๐
why does this keep logging as undefined
@ionic dawn yes
@mental willow not a py guy mate, can't help you xd
@errant perch whats showing undefined
and what are you trying there?
trying to log the users that react to a embed
thats not the way to go
how do
anyone watch anime or play cod or fortnite
What permissions does my bot need to give roles?
Oh wait
Nvm
I was being an idiot and realized the role I wanted to give was higher than the bot role
xD
const suggestionChannel = client.channels.cache.get('755967690828415057');
suggestionChannel.send(suggestionEmbed);``` why does this happen
is this valid?
if (max === 5 || 10 || 15 || 20)
or do i actually need max === 5 || max === 10 || max === 15 ....
im off punishment
(!args[0] || args[0] != 'membercount' || args[0] != 'allies' || args[0] != 'set')
Im doing this for a if
an*
it sends the message if the command is roblox member count
but if it is roblox h
it doesnt send which is good
@swift umbra just checking the same thing like 4or 5times
i dont want divisible
if i wanted 33 or 5 or 10
anything actually
@swift umbra
is this valid?
@opal plank I donโt think so
frick
can sqlite tables be passed in paramters?
What is wrong with ts const suggestionChannel = client.channels.cache.get('755967690828415057'); suggestionChannel.send(suggestionEmbed);
javascript
@opaque hawk Const cant be changed
so you suggest let
var or let
eww imagine using var in es6
Still get the "Object is possibly undefined" error
nvm
nah
Does anyone know how to cast types? I uhh... excel in typescript but cant even remember how to cast to TextChannel
;-;
can sqlite tables be passed in paramters?
(suggestionChannel as TextChannel).send()
the life of a developer

@opaque hawk i believe you can do message.channel as TextChannel
how do you detect the amount of bot users in a guild? in discord.js
oh shit it was already answered 
<guild>.members.cache.size?
I mean it wonโt show offline users is โlargeโ servers
probably
(suggestionChannel! as TextChannel).send(suggestionEmbed);``` `Cannot read property 'send' of 'undefined'`
why it no worko
probably
In english, why does it not work
yes
if it was returning a channel the error wont pop up
or just the channelID
you can get a channel by its ID
let suggestionChannel = client.channels.cache.get('755967690828415057');```
I did
same error?
no
then?
Whats a "Character Game"
whatever you can do on py/java/etc you can do it on js
there's always a way
t y p e s c r i p t

xD
is there a query that will give me the users currently "live" in the voice channels of my server?
(suggestionChannel).send(suggestionEmbed); 
what tf you have to specify is a text channel
if you have the channlID
dnst make any sense
because apparently "JavaScript doesn't give two hoots what any means and what it can be changed to"
So I have to cast suggestionChannel as TextChannel
Heyy
It uses get
actually i am thinking of find but fetch doesn't work
TS is just an extension to JS in a sense
Can anyone tell me when my bot will be available publicly on discord. Gg
How long ago did you apply?
your bot dsnt need to be verified to can be used publicly
@opaque hawk before 2 days
mine gets verified a few days ago
@ionic dawn Yea but this time it dosnt show on discord. Gg
and I applied 35d ago
what do you mean dnst "show" on discord.gg
I mean... you can just click on discord dev, create, and make a bot in a minute
I mean discord. Gg is a bot list website where i share my bot publicly.
Oo ya sorry top. Gg haha
oh ok
Ysss
So now
hows that channel going yerrain
back to .fetch()...
it does work?
no

That was the first thing I tried and that didnt work

fck
can I see more code? that code is good, there's no sense on that not working
I mean, im using that code for a few things on my bots and it does work
import { Message, MessageEmbed, Client, TextChannel } from "discord.js";
export const name = "suggest";
export function execute(message: Message, args: string[]) {
const client = new Client;
args[0] = args.join(' ');
const suggestionEmbed = new MessageEmbed()
.setColor("#ffff00")
.setTitle(`${message.author.tag} suggests:`)
.setDescription(args[0]);
let channels = TextChannel;
let suggestionChannel = client.channels.cache.get('755967690828415057').send(suggestionEmbed);
// (suggestionChannel!).send(suggestionEmbed);
}```
The whole file
but its inside of a let
Can anyone tell me what's the meaning of your bot currently listed on dbl?
I use const and the same error pops up
I remove that all together and it still doesn't work
So now the line is just ts client.channels.cache.get('755967690828415057').send(suggestionEmbed);
(client.channels.cache.get('ASDFASDF') as TextChannel).send(yourembed)
good idea
guess what
I have no errors
now I leave it up to the compiler to see what it thinks
I hate casting types
Awwwww okay

if (command == 'vc') {
let newName = args.slice(0).join(' ')
message.member.voice.channel.setName(newName)
}
```no work
hey
But u know when u search my bot name then it dosnt show
who know u login ur bot acc?
kinda like a twitter post I saw
"I HATE PROGRAMMING
I HATE PROGRAMMING
I HATE PROGRAMMING
I HATE PROGRAMMING
I HATE PROGRAMMING
I HATE PROGRAMMING
IT WORKS
I LOVE PROGRAMMING"
When will my bot appear?
if (command == 'vc') {
let newName = args.slice(0).join(' ')
message.member.voice.channel.setName(newName)
}
```no work
who know u login ur bot acc?
@wintry niche wdym
So that anyone can invite my bot
@carmine summit ๐
@opaque hawk u have bot?
yeah
u login ur bot acc
@ionic dawn awwww okay i got it
I need to upload a txt file on link - www.mydomain/verify/bsdfbwefw.txt
like userbot? or how to make your bot login

@wintry niche
@opaque hawk ?
The bot is in the same host?
no
like userbot? or how to make your bot login
@opaque hawk
F
why
if it was is just a simple write
What's the code for
Seeing how many servers the bot is in? Can any one tell
I host on glitch
hmm, you can use ftp protocols probably
my website

but my bot on Galaxy Gate
i dunno, maybe use login('botTokenHere')?

Then how long does it take for verifiey by top. Gg?
5 weeks
@delicate shore https://github.com/simonh1000/ftp-deploy
What's the code for
Seeing how many servers the bot is in? Can any one tell
@visual robin bruh
probably that helps
i dunno, maybe use
login('botTokenHere')?
zion
@opaque hawk awww really wow thanks for informing me.
if you have access to ftp on your website host you can send files to specific folders
@visual robin spoonfeed

o-o
spoonfeeding is not looked upon with great kindness here

@ionic dawn 
if (command == 'vc') {
let newName = args.slice(0).join(' ')
message.member.voice.channel.setName(newName)
}
```no work
They literally only asked how to do that
he asked for the code
@visual robin what library, library version
(client.channels.cache.get('755967690828415057') as TextChannel)``` why is that undefined
And it's not a big snippet of code they're asking
@carmine summit mayb im wrong but I think its voiceChannel
There's no separate way to say "optional" in TS?
NO
not voice.channel
what does your command do
There's no separate way to say "optional" in TS?
@slender thistle wdym "optional"
rename to
Ehh... kind of like public int? prop and then class.prop can return null in C#
well
add one more = in the if
and the code is actually right, mayb rerun the bot and try in other channel
its better to keep it 2
ill try it with a simple bot in a test server
bcuz if its 3 it may run to some problems
I still dont understonaf
3 is so damn strict
understand
if you use == this bot thinks it is invited to type juggle
And if you use === it isn't
no wait i think i know what my problem is
(client.channels.cache.get('755967690828415057') as TextChannel)```
why is that undefined
RATE LIMITED
.w.

well
yes its rate limited
tried on test server
changed the first 3 times
then stops
next. how can i detect if a user leaves the channel then there is noone left in the channel
aka all left the VC

do what I and most of the people do
google for 1h, and then cry a bit and then ask here
its been working for me
next. how can i detect if a user leaves the channel then there is noone left in the channel
@carmine summit about music command?
no
see among us is a popular game. And I made a command which renames their VC to their code
but havent still made a way that if everyone left the VC its name will reset
ima flex my 8k members server real quick
Gl
make something that check the channel every x amount of time
The official /r/AmongUs discord server gained 1k members in 12 hours
if a time detects 0 users the rename it

make something that check the channel every x amount of time
@ionic dawn NO.
OK.
WHY ARE WE SHOUTING.
IDK.
oh
Bro
bot goes brrrrr
A server with 150,00 members is so active
well... idk if theres an event that triggers when a user joins/leave
The entire discord lag from it
well... idk if theres an event that triggers when a user joins/leave
@ionic dawn SEND
the community moderates itself
read the message tho
idk if
@carmine summit
the community moderates itself
@opaque hawk PERFECTION
I mean, every so often a member posts its room codes outside of #looking-to-play but that isnt hard to fix
I mean yeah an AmongUs Filipino server is going to be big
Among us is based on kill a black guy and then discuss if we should kill or not the other people
yh
but the black guy... oh he always die

no
I dont know it
why are yall talking about among us on #development lol
@forest prairie he making an among us bot
oh my why is among us in here go to off topic
thats why
o
i need a code that detects if everyone left the VC
so code it
lmao
You can just make a leave command so the bot leave
vo1d with Voided

Node or discord js?
I'm just @fast trench's alt lmao
discord js
there is an event that triggers when an user join or leave
@ionic dawn GIVE it To ME NOW
walrus lol

not reading the docs
read the docs is always a great answer

not reading the docs
@carmine summit you'll never learn if so
i alr read the docs

didnt found it
you prob dont
How do I get the channel that I typed in in discord.py
#weneedamoderatortodealwiththiscrap
why do that return undefined/why is it undefined
No spoonfeeding

but I'm not hungry for your code lol I want my own "unique"
(client.channels.cache.get('755967690828415057') as TextChannel)```
Spoonfeeding bad
I ALRADY READ THE DOCS IT AINT THERE
i was jokng
I ALRADY READ THE DOCS IT AINT THERE
@carmine summit yes it is
Why is that undefined
it actually is
IT IS HIDING FROM ME
you just have to know where to look
I literally typed: Event that triggers when user join/leave DJS

and the first google thing shows how to do it
just search voice in the docs and it's right there...I have it pulled up right now actually
your brain is damaged or you are not looking hard enough


Im lazy too but im working hard to be a bot dev
are too lazy not is to lazy lol
Im working on a bot and is terrible
bruh keep in mind this is #development
so i use discord.js and am sharding how do i set a auto rotating status to work on it without it breaking?
yes
@fast trench hey
const newUserChannel = newMember.voice.channelID
const oldUserChannel = oldMember.voice.channelID
const textChannel = message.guild.channels.cache.get('712677731023716452')
if(newUserChannel === '712677767333937284') {
textChannel.send(`${newMember.user.username} (${newMember.id}) has joined the channel`)
} else if (oldUserChannel === '712677767333937284' && newUserChannel !== '712677767333937284') {
textChannel.send(`${newMember.user.username} (${newMember.id}) has left the channel`)
}
})```
(client.channels.cache.get('755967690828415057') as TextChannel)``` why is this undefined
.w.
becaue the channel isn't existing
it does tho
idk why it says it doesn't
also why tf do you define it that way
stackoverflow wheeze
apparently typescript way
rip...well imma go get some chips and go to bed lmao

lmao cya
is anyone able to answer my question ? https://discordapp.com/channels/264445053596991498/272764566411149314/756013276130967602
No
never lagged mine
How do you get the name of a channel in discord.py? Like the one I type in.
on_message or commands extension?
how do you make a message collector/awaitmessages in discord.js? i tried following https://discordjs.guide/popular-topics/collectors.html#await-messages but i dont understand it and it doesnt work
Idk
Me?
@silver lintel whTs your current code
@slender thistle
const filter = m => m.content.includes('discord');
const collector = message.channel.createMessageCollector(filter, { time: 15000 });
collector.on('collect', m => {
console.log(`Collected ${m.content}`);
});
collector.on('end', collected => {
console.log(`Collected ${collected.size} items`);
});
``` just copied from discord guide
12
Ok
Yes, Bleepo
Ok
Did you look at the docs? @silver lintel
uh no, lemme just check
i want the bot to send a message like:
bot: what channel would you like it in?
user: #idk
@commands.has_role('Owner')
async def close(ctx):
channel = ctx.channel.id
await channel.edit(name=new_name)
await channel.set_permissions(send_messages=True, read_messages=True, add_reactions=True, embed_links=True, attach_files=True, read_message_history=True, external_emojis=True)```
What is new_name defined as?
Define channel as just ctx.channel
Check the official djs guide @silver lintel
// Await !vote messages
const filter = m => m.content.startsWith('!vote');
// Errors: ['time'] treats ending because of the time limit as an error
channel.awaitMessages(filter, { max: 4, time: 60000, errors: ['time'] })
.then(collected => console.log(collected.size))
.catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));
``` thats official one
ill try
thanks
:)
const filter = m => m.content.startsWith('!vote');
how do i make it only so a user can do it and a channel?
m.user === m.author.id m.channel.id === (โidโ)
anyone know how to get my bots name to change? i changed it in the bot portal but it wonโt change when it joins servers
Did you change the name under "Bot" or "Application"
client.user.setUsername('Name');
You need to change the name under "Bot"
thats spoon-feed and not allowed i think
Its not allowed?
what language though?
English
what language do you know?
BRUH
im talking about coding languages
like js python c# c++ lua
json
css
htpm
Python












