Heyo! Anyone know of a member divider bot? Or a bot that can divide up server members so I can mass assign roles n such?
like if my server has 8 members, and I want groups of four, I want the bot to randomly divide members into those groups. whether it be id's or just autoassigning the roles
Kinda a niche request, but help is GREATLY appreciated.
@obsidian burrow Doesn't sound too difficult to implement
#development
1 messages · Page 1201 of 1
anyone have experience with Kurasuta
Kurasuta is a custom sharding package
anyways everytime i try to run it it says cluster failed
Cluster 0 failed to start
Hello,
Id like to cycle my discord.py bot status but it doesnt work, nothing happens. Here is my code :
import discord
import asyncio
from discord.ext import commands
from itertools import cycle
client = commands.Bot(command_prefix=";")
token = "xxx"
status_cycling = ["1", "2", "3"]
async def change_status():
await client.wait_until_ready()
cycling = cycle(status_cycling)
while not client.is_closed:
current_status = next(cycling)
await client.change_presence(activity=discord.Game(name=current_status))
await asyncio.sleep(5)
@client.event
async def on_ready():
await client.change_presence(status=discord.Status.idle,
activity=discord.Game("Test message"))
print(f"{client.user.name} ({client.user.id}) ready")
client.loop.create_task(change_status())
client.run(token)
When I remove the change_status function the on_ready event works and my bots status is set to "Playing Test message", but when theres the change_status function it doesnt displays anything.
Thank in advance for your help
Get all users in a guild.
for each user, randomly pick one that is unassigned
assign them a roll
loop until all users iterated through
@teal goblet Use setInterval instead of sleeping
https://www.w3schools.com/js/js_timing.asp
Im on python
kek
nothing
Which language you on ?
Yh
name="Test message"
No its ok
kwarg for discord.Game
Might help you out @teal goblet
?
Genuinely bad idea to use time.sleep or anything threading with d.py
The way they did the loop is fine
There were a few examples I think.
Mhm
can you spawn a child thread that handles updating the status? Then if it blocks it wouldn't matter
Nah actually I dont think the problem comes from the sleep function (from the asyncio module) cause Im using asyncio.sleep() for another command and its working
aiohttp gang but I don't think many people here are familiar with multi-threading
coroutines or not
@teal goblet any errors you get when remove change_status?
When I put the lines related to the change_presence function into commentaries the bot works fine, and the status from on_ready is displayed
And actually when the change_presence function is in the program it looks like it doesnt do anything cause my bot still has the "Playing Test message" status
anyone have experience with Kurasuta
Kurasuta is a custom sharding package
anyways everytime i try to run it it says cluster failed
current code
Okkkk I fixed it actually I just forgot some brackets after that :
while not client.is_closed: while not client.is_closed():
Thanks for your time guys though 👍
so im getting ignored
so im getting ignored
@glossy elk sounds like a niche library. Maybe nobody knows
TypeError: Cannot read property 'binaryToID' of undefined
binaryToID is from discord.js right
How do I add a bot to a server I’m working on?
How do I add a bot to a server I’m working on?
@GinStar go to discord calculator, type id, set permissions and invite via link
Hi,anyone know any good roblox api modules?
[macOS] I'm currently running Big Sur on a separate volume from my main volume. I'm having issues installing Dart with Homebrew because it complains that my command line tool (CLT) is outdated (Xcode 11 < Xcode 12 (Beta)) even though I have Xcode 12 (beta 4) and have it set as the CLT to use.
I still have Xcode 11 installed, so I'm wondering if anyone can back up my hypothesis that uninstalling it will help resolve my issue.
doesn't roblox have an api..?
@thick gull
does this look like a roblox development page?
[macOS] I'm currently running Big Sur on a separate volume from my main volume. I'm having issues installing Dart with Homebrew because it complains that my command line tool (CLT) is outdated (Xcode 11 < Xcode 12 (Beta)) even though I have Xcode 12 (beta 4) and have it set as the CLT to use.
I still have Xcode 11 installed, so I'm wondering if anyone can back up my hypothesis that uninstalling it will help resolve my issue.
@sudden geyser, it really should help
but
try updating mac dev tools cli
that might be using old xcloud
so updating it might fix $path volumes
does this look like a roblox development page?
@urban olive did you not see someone literally asked for it above him
but i do think uninstalling xcode 11 might fix it
Require stack:
- C:\Users\acer\Desktop\bot\node_modules\canvas\lib\bindings.js
- C:\Users\acer\Desktop\bot\node_modules\canvas\lib\canvas.js
- C:\Users\acer\Desktop\bot\node_modules\canvas\index.js
- C:\Users\acer\Desktop\bot\server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\acer\Desktop\bot\node_modules\canvas\lib\bindings.js:3:18)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\acer\\Desktop\\bot\\node_modules\\canvas\\lib\\bindings.js',
'C:\\Users\\acer\\Desktop\\bot\\node_modules\\canvas\\lib\\canvas.js',
'C:\\Users\\acer\\Desktop\\bot\\node_modules\\canvas\\index.js',
'C:\\Users\\acer\\Desktop\\bot\\server.js'
]
}```
help pls
I have Xcode 11 installed from the App Store (obviously) so I'm also worried if uninstalling it here (aka moving it to Trash then erasing it) may effect my other volume, or anything that depends on v11. In the past I did install the CLT from the developer download page when I didn't have Xcode installed (because I didn't want to hold on to that 9 GB download vs. like 300/400 mb)
Also I'm a bit confused on this line as installing the beta should come with it
"try updating mac dev tools cli"
@thick gull
does this look like a roblox development page?
@urban olive this is for general development
and the message above mine
Hi,anyone know any good roblox api modules?
Also I'm a bit confused on this line as installing the beta should come with it
@sudden geyser, do you have public or dev beta
public beta doesn't come with dev tools
that might be the problem
here wait
I have the one from https://developer.apple.com/download/, which I assume would be public betaa.
no i mean the OSX version
wait run this in terminal, xcode-select --install
i have a thing that sends a message when a role is updated
when a role is moved
all the roles get "updated"
how can i stop it from spamming it
and just sending the one that was updated
Does that command install the CLT?
also, how can i display member count in bot activity?
like total users
got it
thanks
tho how do i mulitply a variable?
like for example i have like a volume thing
how can i send the message but 100x
- 100? not sure how py works
@faint prism i got it
but it was muliply var by 100
cuz it send it as like 0.01
intead of 10
so now its 10.0
which works fine
Confused, but glad it's working
const guildID = Number(giveaway.guildID)
const shardID = (guildID >> 22) % Sharder.shardCount
console.log(shardID)``` How comes shardID is `-4`?
thanks lol

unfamiliar with the >> symbol, and you're getting the remainder of the division with Sharder.shardCount
I'm trying to work on a Music Bot (or add a music FEATURE), however, my bot doesn't seem to sense whether I'm in a voice channel or not. I've tried without checking and WITH checking if the user is in a voice channel. Both times, it says it isn't in a channel and then I get an error.
Code:
if (message.content.startsWith(`${prefix}play`)) {
const args = message.content.slice(prefix.length).split(' ');
const command = args.shift().toLowerCase();
if (!args[0]) {
message.channel.send("You need to provide a link!");
return;
}
const channel = message.member.voiceChannel;
channel.join().then(connection => console.log('Connected!')).catch(console.error);
/*
if (!message.member.voiceChannel) {
message.channel.send("You must be in a voice channel!");
return;
} else {
const channel = message.member.voiceChannel;
channel.join().then(connection => console.log('Connected!')).catch(console.error);
}
*/
}
@faint prism that's 5
@simple stump are you using gateway intents?
hi lol odd question ow can i ban someone with an eval command?
@modest crane wdym?
however the lib says you can
how*
@modest crane wdym?
seems that you're not using it hmm
check if the bot can see the voice channel you're joining
alright
Hii
Anybody can help me ??
if (msg.content === 'rpg miniboss') {
msg.channel.send('⚔️ @Arena-Miniboss |Say JOIN ⚔️')
Why it didn't ping ??
@simple stump
Can you help me ??
@simple stump
Can you help me ??????
:'((((
@woeful pike
don't ping people for help
^^
And instead of @zinc pawnena-Miniboss you have to put <@role_id>
Can u help me about that ?
I can't see the id
of Arena-Miniboss
Hmm
np
Also @modest crane sorry for the ping. I just tried that with a NEW bot with Admin perms on my test server. No luck.
strange
I added the if statements back and got this error:
C:\Users\Ian Lew\OneDrive\Programs\DiscordBot\Test Bot\index.js:773
channel.join().then(connection => console.log('Connected!')).catch(console.error);
^
TypeError: Cannot read property 'join' of undefined
If statements:
if (!message.member.voiceChannel) {
message.channel.send("You must be in a voice channel!");
return;
} else {
const channel = message.member.voiceChannel;
channel.join().then(connection => console.log('Connected!')).catch(console.error);
}
Oops error irrelevant
Just meant
That it still says, "You msut be in a voice channel"
@simple stump try using message.member.voice.channel instead of message.member.voiceChannel
@ivory wasp remove Arena-Miniboss_
^^
Alright thx d4n will try
also, if you want to mention a role replace @ with &
^
oops
Tysm d4n. However now it says it can't read property of 'join' xD At least it doesn't say, "You aren't in a voice channel." lol
Error: https://hatebin.com/yykfmfnoyj
Code:
if (message.content.startsWith(`${prefix}play`)) {
const args = message.content.slice(prefix.length).split(' ');
const command = args.shift().toLowerCase();
if (!args[0]) {
message.channel.send("You need to provide a link!");
return;
}
if (!message.member.voice.channel) {
message.channel.send("You must be in a voice channel!");
return;
} else {
const channel = message.member.voiceChannel;
channel.join().then(connection => console.log('Connected!')).catch(console.error);
}
}
Role : &
Channel : #
Mention (Nickname) : !@
Mention (Username) : @
const channel = message.member.voiceChannel;
change that line
lol im stupid tysm d4n fixed!
np
<&roleid>
Oh ok
I don't know why, but my bot isn't joining my voice channel and not playing anything. I'm using OpussScript and FFMPEG, however nothing seems to be working.
Code: https://hatebin.com/vbpqlutnnh
Errors: https://hatebin.com/thvqbcuisr
yur i love good ci https://ur-dad.is-inside.me/A5Ofq8hy.png
@ivory wasp Give a complete and useful explanation
Hmm,
I need a remind code
Because when i hunt
The command will be cooldowns
And i want it to remind me
@earnest phoenix
Can you help me about that ?? @earnest phoenix
I will send you a examples in your direct . @ivory wasp
Ok brooo
Is client.fetchApplication() a thing in discordjs?
View the docs (https://discord.js.org/#/docs/main/stable/general/welcome)
Wrong link
yeah i forgot about the docs... sorry
No problem! (Link is correct now)
thanks
Whats FFmpeg/avconv
When i do:
C:\Users\Myname\desktop\DinoBot\npm
It doesnt work, its just some weird command shiz
(command prompt btw)
What are you trying?
I'm making a discord bot
What are you trying?
wdym
With npm
What about it
Lol
;-;
What are you trying with NPM?
Error: Cannot find module 'E:\Thunder\node_modules\lzma-native\binding-v3.0.8-node-v72-win32-x64\lzma_native.node'
Require stack:
- E:\Thunder\node_modules\lzma-native\index.js
- E:\Thunder\node_modules\decompress-tarxz\index.js
- E:\Thunder\node_modules\ffmpeg-binaries\install.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at E:\Thunder\node_modules\lzma-native\index.js:13:14
at Object.<anonymous> (E:\Thunder\node_modules\lzma-native\index.js:597:3)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'E:\\Thunder\\node_modules\\lzma-native\\index.js',
'E:\\Thunder\\node_modules\\decompress-tarxz\\index.js',
'E:\\Thunder\\node_modules\\ffmpeg-binaries\\install.js'
]
}
npm WARN fetch-blob@2.1.1 requires a peer of domexception@^2.0.1 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ffmpeg-binaries@4.0.0 install: `node install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ffmpeg-binaries@4.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Pujya Kumar\AppData\Roaming\npm-cache\_logs\2020-08-30T05_27_34_322Z-debug.log
E:\Thunder>```
wtf should i do
this fucking sucks
IDFK, ARENT u JUST SUPPOSED TO PUT NPM, AND THEN IT GIVES QUESTIONS?
Are you by chance doing require('E') ?
i think he is doing
IDFK, ARENT u JUST SUPPOSED TO PUT NPM, AND THEN IT GIVES QUESTIONS?
@earnest phoenix uh?
npm init
Right
IDFK, ARENT u JUST SUPPOSED TO PUT NPM, AND THEN IT GIVES QUESTIONS?
@earnest phoenix wat
ohh yeah
Do a terminal in the folder and run npm init
Thanks @weak rain
Np
cd /my/project/folder
npm init
u can directly use vsc

I could not join the voice channel: Error: FFmpeg/avconv not found!
?
Packages
Show code.
uhm
how do I ban a user using d.js v12
not a guild member, a user
there was a Guild#ban method for v11
but it is in file
@weak rain then do a hastebin
@weak rain What lib and what version?
version?
12
well did you install ffmpeg-static?
well
Do the staff accept bots made from Bot Ghost?
npm i ffmpeg-static @weak rain
Do the staff accept bots made from Bot Ghost?
@sage meadow of course not
why
using a template doesnt make u dev
It's nothing to code
if I use 2 api --- Bot ghost and BDFD . They will accept?
no
please help @weak rain
i cant
if I use 2 api --- Bot ghost and BDFD . They will accept?
@sage meadow no
It's trash
^^
ok
It's
trash
@fringe axle Yeah
does anyone know what's the v11's Guild#ban for v12? (d.js)
Use hastebin...
you don't need one to play a video from youtube

are you using ytdl-core?
In the index? really?
yes, that's your index file
const dispatcher = serverQueue.connection
.play(ytdl(song.url, { filter: 'audioonly' }))
``` try this
where


In play?
Your play case don't has any code to play something
it has
const dispatcher = serverQueue.connection
.play(ytdl(song.url, { filter: 'audioonly' }))
``` try this
@wheat jolt
i have a question, how do i add my bot to this server. it’s already on the site.
it is already here then
yes
i have a question, how do i add my bot to this server. it’s already on the site.
@limpid plinth it's just muted because of the common prefix
ah
Why isn't it working
Did you ever login?
Login to the bot?
Yes
yess
And do a new Terminal (top) and run node main.js
Regen your token
Yeah, ik, mate
And do a new Terminal (top) and run
node main.js
@fringe axle what
Just tryna help you
Terminal
Terminal
If you haven't already
This ^^^^
Go into Terminal
Do New Terminal
and type "run main.js"?
You have this in your package.json file, right?
i hit enter, nothin happened
Change index.js to main.js
f i consumed all my free dynos for this month
heroku bad
imagine not managing your bot's time on Heroku
Wait, the test says "Error no test Specified"
cuz
that's the default test
Im dumb ;-;
it just echos that string
doesn't cause any errors
me real dumb
no
you just need to learn
by learn i mean go nuts
I am learning, im taking coding classes, and rewatching the same tutorial 5 million times ^^
Lol
Self learning is a lot better
Don't take coding classes
Well, so far, coding classes has helped me a bit, soo ehh
Im self learned in Lua, and Json
@earnest phoenix, all is working now?
Nopeeee
Try to run node .
Classes are always a good idea if you have time, they can explain things faster and make sure you know what you are doing
Classes are always a good idea if you have time, they can explain things faster and make sure you know what you are doing
@ionic dawn Exactly
I did @fringe axle
Btw, whats your problem?
My bot wont go online even tho im typing node . / node main.js
coding classes suck for these reasons:
- everyone hates school
- they most likely won't listen to you 99% of the time cuz they have to teach a mountain of people
- they grade you for your hobby which is terrible
- you need to pay fees
i tried it in the terminal inside of Visual Studio code, and cmd prompt
huh
I dont hate school
discord doesn't update immediately

Do you have Node installed?
coding classes suck for these reasons:
- everyone hates school
- they most likely won't listen to you 99% of the time cuz they have to teach a mountain of people
- they grade you for your hobby which is terrible
- you need to pay fees
@earnest phoenix
I take private Coding Lessons
try running a command of your bot
Do you have
Nodeinstalled?
@fringe axle Yup
@earnest phoenix
I take private Coding Lessons
@earnest phoenix uhhh ok
Hmm
Whats the error message?
Thats impossible
Did you save the files
in 2 days my bot will be again up
lul
lmao
What folder is your bot in and what terminal are you in? You can get a terminal in vscode so it's in that folder
Check the dir you are in
When i do node . or node main.js all it does it go to the next thing wimmigie thing
Maybe your bot files are in a different folder and VSC opens terminals in C:/Users/(your name) by default

Bruv ;-;
Can you send a screenshot of the console
lmao check atleast
** ** ** ** ** ** ** ** 
What console?
what did you try node in
Check /app/package.json: command not found. Is a start script missing? https://glitch.com/help/failstart/
the terminal
how to fix
debug console
Where did you type node at

But i forgot
send a screenshot of that
show the code
Open the terminal, go to the right directory and then magic
"name": "real",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"discord.js": "^12.3.1",
"random-puppy": "^1.1.0"
}
}
debug is broke
huh
but whats the start script
there is a test script
Run npm init
@earnest phoenix you still there?
Add a start script
,
"start": "node ."
oh ok
after test
LMAOOO
Not run
Ik
if you know then why do run
If you do node, the terminals name (see image) is changing to node?
Is the name
if you know then why do run
@winter basalt
Because Vale told me to do run before
And then told me not to
So I took a screenshot of the thing saying run instead of node just to make her mad like be before 💩
Is it once/on?
vale is a dumbass

LMAOOO
please rule 1
vale is a dumbass
@earnest phoenix ;_;
@winter basalt
Because Vale told me to do run before
And then told me not to
So I took a screenshot of the thing saying run instead of node just to make her mad like be before 💩
@earnest phoenix I don't
You thouht it's run and I wrote node
her?!
Yeah, but u also said do 'run something"
Ur Picture is a "her" LMAOO
Yeah, but u also said do 'run something"
@earnest phoenix I said open the terminal and donode .
where the term 'loli' should not be?
Ur Picture is a "her" LMAOO
@earnest phoenix who cares? I'm a male
@earnest phoenix who cares?
@fringe axle That makes people think ur a girl, duh, bish
Lol
nothin' happened, mate
That means it ran and stopped
Your code is wrong
Wdym ;-;
If the bot is waitibg for events like messages then it won't stop
it isnt even online
dosent work
have you saved the file
no
packje.json
"scripts":{
"start":"smth"
}
ok
Bruv.
the process exited
try installing code runner vsc extension
the only people that actually know what i need is @fringe axle @golden condor and someone else, i forgot
use it for debugging
Becuase it actually tells you when your process stopped
Did you fix it?
ya'll just think ya'll helping, but ya'll making my head go brr, jesus christ, mate
then
Well, if your answering to all is not working we just jump to the next option
learn actual javascript before attempting to make a bot
This isn;t javascript, u dumbass
auto-correct remembered that sentence cuz we have to tell that to SO MANY PEOPLE
uh it is javascript??
Actually is weird to see someone with "dev" in the name and cant even run the bot
Json?

Actually is weird to see someone with "dev" in the name and cant even run the bot
I'm taking coding lessons, and shit, jesus mate, and im a Roblox developer
so i dont know shit yet
then
feelsbadman
why are you guys shitting on him
it's always terrible to see people argue over a smol thing
We tried to help you and you blame us
fucking relax
We tried to help you and you blame us
You guys just keep on going to the next option, and not let me explain what i need fixed
No reason to talk us that way 
wtf
wrong server invitr
dbl hates discord.js ig
Im not wasting my time on him again :CBBlock:
i dont fucking care
then
don't ask us for help
16d since applied and still have +30d to go
go back to your coding classes where it's people's JOB to teach you

Lmaoo, ok, fucking "Smarty pants"
Okay "Dev"

if you guys are just gonna be playing insults please leave.
I call myself a dev because im a roblox developer, are u fucking dumb or some shit
i said that 8 minutes ago
I call myself a dev because im a roblox developer, are u fucking dumb or some shit
@earnest phoenix dude
Self learning is a lot better
@earnest phoenix that is 100% a person's opinion
Whats a Roblox developer?
STOP ASKING FOR HELP IF YOU'RE GETTING TRIGGERED BY US
@earnest phoenix hasnt someone already told you how to start your bot before???
like
multiple times
Whats a Roblox developer?
Its where a asshole goes when he doesnt know shit about the world
@slender thistle
What?
how to install a specfic version of node in terminal
mod ping
now stop
@earnest phoenix hasnt someone already told you how to start your bot before???
No, everybody said different shit
how to install a specfic version of node in terminal
@fickle dune use npm
man code your kinda being a dick here:)
yes but how
npm i node.js@version
how to install a specfic version of node in terminal
@fickle dune you can list the version and update to the available ones
wait
Dont remember the commands
discord.js v12 doesn't work on older than v12 node.js
yeah it doesnt
its so funny how i ask for help to get my bot to run, and i get so much blacklash for being a dumbass, even tho im new
Mate, cut it 
hey why not ask your question again so some could help? will be better that way
Do u want me to get people.
calling me a dumbass?

Well, my question is how to get my bot online, even tho the command to get it online is node. or something
"Boy"
node . only works if you have a main script defined in package.json iirc
what's your main script name?
is it index.js?
Its main.js
you can try node main
I did that, as well
He did, but nothing happend
nothing? can you show me your directory structure? e.g. your files
He was in the right directory aswell
Package . Json?
Theres a screenshot above
aight wait
thank you
Dont look at the run part :<
run?
Oof
he now knows it's node
i see
I knew it was node the whole time, but someone else told me to do run
let me actually test on my vsc, i like never opened it
I dont know what's wrong
hmm
Its weird
let me ask a stupid question, did you install node?
That is a stupid question
Yes
Try tu run any other node command
looks like you're in powershell
try typing cmd and enter
after that, type node main.js
In terminal?
yeah
lol

It doesnt say anything @pale vessel
can you show me a screenshot of the terminal?
I dont think it's the terminal or anything else that's wrong, i think it's the code
Is the argument over?
I dont think it's the terminal or anything else that's wrong, i think it's the code
@earnest phoenix it's not the node terminal
it's not the code either
try using the run and debug function :^)
you literally said it
no, it's fine

jeez
your code
@earnest phoenix it’s fine code
Should I apply for helper role in plexidev
idk
it worked?
THANKS MATTHEW
don’t forget to read the docs

f i was gonna link the docs
that provides cool stuff that you’ll need
Why not tho
Yeah
why not
Does anyone have used ytdl-core?
yes?
Im using the Youtube API to find music and then passing the link into ytdl
But for some reason the second time I put the command it dsnt go in the queue, it crash the bot
But when I use raw youtube links and not the api the second link it does go in the queue
Well, im actually at bed, just askin incase someone could have an idea of thecproblem
lol then we can't help
ill send it later
any suggestions if i should use a CSS framework for a Bot Webinterface or build from scratch?
let items = [...response.free.rewards, ...response.paid.rewards];
items.forEach(go => {
setTimeout(() => {
let m = new Discord.MessageEmbed()
.setTitle(`Tier: ${go.tier}`)
.addField("BattlePass Season:", `Season ${response.season}`)
.setImage(
go.images.full_background ? go.images.full_background : go.images.icon
)
.setColor("#0012f5")
.setFooter("the official bot for lazy leaks server");
message.channel.send(m);
}, 5000)
it send 5 embed then wait 5sec
how to make it send 1 embed then wait 5sec ?
use a loop at the end of the loop add a timeout
function sleep(ms) {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
}
``` i use this to create timeouts
just call await sleep(3000) as example at the end of your loop to wait for 3 seconds
await can't use outside async function
apparently n9
you're executing it in a non async function
items. forreach(async go =>
I want a to put bot.on("ready", async () => {console.log(`${bot.user.username} is online!`); }) in my main.js but that code of "on ready" event is in abc.js.
How do I import it to main.js and no I don't wanna copy paste the codes?
ig
Anyone can help me in rooting my device ? :c
Anyone can help me in rooting my device ? :c
@earnest phoenix this channel is for bot development
Ok 😭
Anyone can help me in rooting my device ? :c
@earnest phoenix ig that's something not related to bot development, so... please find other server
@sterile thicket you know any ?
We don’t have to talk about bot dev here
yes and you can find it in youtube as well
it’s about (bot) development
@sterile thicket the easier would be to make your abc.js a function that you export and then call it in your main.js
bot development, as the channel topic says
also it was working before
implying that bots are the main topic, but other development issues are allowed here too
@sterile thicket the easier would be to make your abc.js a function that you export and then call it in your main.js
@tight plinth how do I make .js a function?
do you know how module.exports works
yes
I tried
I mean I know a little
module.exports = {
run: async () => {
// code
}
}```
right?
@lusty quest u here ?
How can you do if you @ the bot he'll send a message?
ye
How can you do if you @ the bot he'll send a message?
@fringe axle set channel type to dm
can u help me ?
@fringe axle set channel type to dm
@sterile thicket uh?
code?
I want if you do for example @fringe axle then I'll send a message in chat
Me = my bot
let items = [...response.free.rewards, ...response.paid.rewards];
items.forEach(function sleep(go) {
let m = new Discord.MessageEmbed()
.setTitle(`Tier: ${go.tier}`)
.addField("BattlePass Season:", `Season ${response.season}`)
.setImage(
go.images.full_background ? go.images.full_background : go.images.icon
)
.setColor("#0012f5")
.setFooter("the official bot for lazy leaks server");
message.channel.send(m)
sleep(3000)
});
@fringe axle message.author.send()
Okay
I want if you do for example @fringe axle then I'll send a message in chat
@fringe axle do it, if message ==<@urbotid>message channel send something
@viral iris your full_background is not defined
Never knew i'd be mad about getting my bot offline after I got it online after 2 hours
@viral iris your full_background is not defined
@lusty quest it was working before i add function
also make your loop async the same goes for the function
@fringe axle
message.author.id.send()
@sterile thicket no.
then remove the function and see if it works
your loop is still sync
you need to send it to the object
How do I get my bot offline? 
stop the process
kill it
process.exit()
process.exit(69)
process.exit(420)
@fringe axle
message.author.send()
@sterile thicket It will send a message in the DMs
Yes
use my npm module, node-exit-process
what do you want?
Process.exit(420,069)
if i did await sleep got error can't use outside async function
If I @ the bot he will response...
make the function async then
you did not
you didn't as the error says lul
your loop is still not async
if you dont run the sleep async it will run all embeds then wait
items.forEach(function sleep(go) { where is this async?
also you got a loop inside the forEach loop
the funcion i send you was a standalone function you call to wait
Anyone knows how to do it if I @ the bo he'll send a message in the chat?
If I @ the bot he will response...
@fringe axlecss message.content.startsWith(`@`)
still send 5 embed
i told him he needs to run a loop async to use the sleep function i sended him but idk if he manages to do it
@sterile thicket wrong, pings don’t start with @
@fringe axle
css message.content.startsWith(`@`)
@sterile thicket then I can @ everyone and he'll respond
ik
pseudocode
I just don't want to spoon feed him
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
} ``` this is a standalone function you call just the await sleep(3000) inside your loop to wait for 3 seconds
also you got a loop inside the forEach loop
@lusty quest it's inside
@fringe axle
message.content.startsWith(<@botid>)
forEach cant be async
bruh
use a For in loop
@misty sigil, did that
@fringe axle replace '@' with your bot tag
id
I feel like a dumbass for not kowning how to get my bot to respond to a command
@misty sigil js message.content.startsWith(`<@botid>`) || message.content.startsWith(`<@!botid>`)
Yes
I have that still
I feel like a dumbass for not kowning how to get my bot to respond to a command
@earnest phoenix use an if statement that looks at message.content
nah, use a new message event for each command
@reef aspen is my trigger.
@fringe axle is it in an if statement
No
check for both <@ and <@!
bingo
check for both <@ and <@!
@pale vessel I do that
> message.content.startsWith(`<@botid>`) || message.content.startsWith(`<@!botid>`)```
In an if statement
bruh
@misty sigil

well looks like you copy pasted
Still not responding
command gets rid of the prefix so you don’t need the prefix in the if statement 
Yeah, but I added the prefix because it wasn't working
@lusty quest still send 5 embeds
also, do you have any programming experience
BTW how can I fix this? The code is working but this console warnings are annoying
How do I make abc.js work on main.js?
also, do you have any programming experience
@misty sigil
On roblox ;-;
module.exports = function
@viral iris code?
not working somehow
@misty sigil
On roblox ;-;
@earnest phoenix I’d suggest learning js before making a bot
Still not responding
It makes things a lot easier
@fringe axle one of your field values is an empty string
not working somehow
@sterile thicket did you require it?
It isn't...
Yes
@earnest phoenix I’d suggest learning js before making a bot
@misty sigil
Yeah, I will, but I'm making a bot for the soul purpose to learn js
@lusty quest
https://hastebin.com/akuzizored.js
@fringe axle which presence extension do you use on vscode
definitely not a beginner project, but if you insist
you still cant run forEach async
.addField(`Old Content`, oldMessage.content, true)
.addField(`New Content`, newMessage.content, true)
All normal
Message content can be empty
Oh
For example, a message with only an image attached to it
Or embeds that bots post
How can I fix this then?
if you use Node V14 you can use optional chaining
Me?
returns undefined
its not a thing in V12
you still cant run forEach async
@lusty quest why
you need 14.x.x
bcs forEach cant be used async
oof...
use a for In Loop as example
okay, thanks
don't add the field if either/both is/are empty
aka if !oldmessage.content && !newmessage.content
And one more question: @reef aspen is my trigger but it won't respond if I @ my bot
aka if !oldmessage.content && !newmessage.content
@slender thistle okay
I did require(./abc.js) in main.js
and module.exports = { run: async () => {...}} in abc.js
It's a messag edited event. But it triggers in pins and other things too @slender thistle
but no response
You can check if message contents are the same
basically comparing old message content to new message content
Okay, thanks.
bcs forEach cant be used async
@lusty quest so how to use it?
Do you know how to fix my @ problem too?
use a for In Loop as example
how
Link me some trusted sites where i can learn Json
@slender thistle, he still login every updated message
What's your code
client.on("messageUpdate", async (oldMessage, newMessage) => {
const member = oldMessage.member;
let lchannel = await db.fetch(`logchannel_${member.guild.id}`);
const embed = new MessageEmbed()
.setTitle(` Message edited`)
.setColor(`#ea6ef1`)
.setDescription(
`**User: ${oldMessage.author.tag} (${oldMessage.author.id})\nChannel: <#${oldMessage.channel.id}> (${oldMessage.channel.id})**`
)
.addField(`Old Content`, oldMessage.content, true)
.addField(`New Content`, newMessage.content, true)
.setThumbnail(member.user.displayAvatarURL({ dynamic: true, size: 512 }));
if(!oldMessage.content && !newMessage.content) {
console.log(`-> Message Update -> Same Messages`)
}
client.channels.cache.get(lchannel).send(embed);
});
are you checking whether the old content and the new content are the same?
add if condition for that
@lusty quest i didn't understand
are you checking whether the old content and the new content are the same?
@pale vessel yea
messageUpdate can trigger if you post a link with its embed (preview)
why not oldMessage.content == newMessage.content?
You're only checking if message contents are empty
Oh
I suggest you nest that into an if that will check if message contents are the same
for (item in items){
//your stuff you used in your foreach loop
await sleep(3000)
}
```use this inside a async block @viral iris
if(!oldMessage.content == !newMessage.content) {
console.log(`-> Message Update -> Same Messages`)
}
``` I did this now but he's still sending the message
the fuvk
Well
Remove the negate operators
wait i think a for of loop is better
Okay
you're comparing booleans
Apple pen
Pineapple pen
the exclamation checks if the thingy doesn't exust
so it returns a boolean
Move to #memes-and-media, Void

let channel = client.guild.channels.cache.find((x) => (x.id === "749542048025280552"))
let embed = new Discord.MessageEmbed()
.setColor(`RANDOM`)
.setTitle(`**Joined a Server!**`)
.addField(`**Name**`, `**${guild.name}**`)
.addField(`**Guild ID**`, `**${guild.id}**`)
.addField(`**Users**`, `**${guild.memberCount}**`)
.addField(`**Owner**`, `**${guild.owner.user.tag}**`)
.addField(`**Owner ID**`, `**${guild.owner.id}**`)
.setThumbnail(guild.iconURL)
channel.send(embed)
})
WHY THIS IS NOT WORKING
error?
no spoonfeeding
no error
Then
it’s client.channels.cache.get("channelID")
Try to check what's wronf
not whatever that spaghetti is
for (item in items){
//your stuff you used in your foreach loop
await sleep(3000)
}
```use this inside a async block @viral iris
@lusty quest item not defined
@viral iris its a example code
gosh
@viral iris its a example code
@lusty quest what should it be ?
the fuk
idk its your code?
lmao
oh
also, it doesn't give you client, just guild
so client.on("guildCreate", async guild => {});
depends if the event loader attach the client to the event then it does
it's not an event loader from what i'm seeing




