#development
1 messages · Page 318 of 1
Crystal is getting into Node.js so yes
Use npm install -g pm2
The apt version is probably outdated or a ripoff version
o.0 we're talking about PM2 here
Moin


will storing a large amount of data in a PersistentCollection adversely affect performance?
PersistentCollection 
Part of d.js
ya that
The more data u store the more storage will get used idk about Performance tho
i dont think so
How do I post server count with NUMBER Servers | SHARD_COUNT Shards? 
.
....
.........
..................
..........................................
....................................................................................
....................................................................................................................
...................................................................................................................................
rekt
How to cluster with pm2 and d.js sharding manager?
Whenever I've tried it just makes multiple instances on each shard, instead of splitting between them.
#development new #general
(╯°□°)╯︵ ┻━┻
(╯°□°)╯︵ ┻━┻
rebel
Tonkku will mute this too
TONKY CANNOT SILENCE US
me too
i would but im banned
hi @weary shoal
._.
why @earnest phoenix
@woven drum "posting memes"
Look lol
im appealing now
#RIPAllChannels
HAHA
jks
c.ping
only shitpost
s@userz
nice prefix
Has anyone else encountered this while using PM2?
I have no idea why but it restarts my app outta no-where
Ya
that's what my process.exit()s look like, anyway
Only I can access the VPS and I'm only monitoring the app rn

It happened like 4 times
what lib?
Commando
I have put codes everywhere to throw errors or unhandledExceptions whenever they occour but currently there are no errors in the logs but the bot is still exiting out
are you sharded?
No, my bot is only on 190 guilds
hmm, but like Aethyr is saying, exit with code 0 is a clean exit
But my code doesn't contain anything which tells the process to exit.
Are you by any chance happening to copy something with ctrl-c with the terminal open
I cross checked every file to see any funny business
Inb4 evaled process.exit()
I'm not evaling or copying anything
I know the basic things, come on guys lol I'm not that dumb
is your eval locked 🤔
Only I can use it you mean?
yes
of course 😛
yes, there's nothing that is causing this
how long has it happened?
For a while I think
Shit vps?
bruhhhhhhh
My bot uses like 15MB ram
xD
my VPS only has that single bot, nothing else
i did everything but my node moduals are not installing right?? wtf welp
npm i?
install npm?
how did you install node?
sudo apt-get install nodejs
what happens when you run node -v?
ok now what
sudo apt install nodejs-legacy
yes that is what it said
it should output the version
no not istalled it says
then you didn't follow it correctly
run this curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
then this sudo apt-get install -y nodejs
its gay
gay 

it did not work
then you're doing it wrong 
ok
I still use 6.x
but that works p well for arm
that same source is what I use on new pis and stuff
I use 8 cuz I need async
it dose not install at all
@earnest phoenix can you try npm -v
that works
and node -v doesn't?
nope
¯_(ツ)_/¯
ik
no such file
ya sry for assuming it's sexuality
Are MySQL and MariaDB's database same?
I'm trying to import a dump into Maria which was in MySQL before but it isn't working correctly...
It only loads like half the data
yes i installed node now how do i install pm2 the right! way
npm install pm2 -g
Lol
do you even
please help @tawny lava
wtf do you want me to do
what's the error
it did not install right wtf
sudo npm install pm2 -g
give us the error or we cant help
yeah that could be very possible
worked but it is not runing it at alllllllllllll
whose pm2```
/bin/sh: 1: whose: not found
o wait
that's the wrong file
did you open it in the project folder?
is it in another folder
the main file is called discordbot.js?
what's the folder called
then cd to that folder
is it in discordbot folder
yes
cd DiscordBot that is it?
cd to the folder
what ever Just thanks man
np
in cmd i think md is "make document" and cd is "check document", if i'm not wrong
cd is change directory
oh, yeah ok
and md is make directory
makes sense
Does anybody know if it's possible to get the discord id of a patreon supporter?
By API or similar?
not that I'm aware of. They'd have to have their discord linked, and even IF it was, I don't think they release that info
👀
hmm
doesn't have dicksword though
where's the docs tho
Patreon is empowering a new generation of creators.
Support and engage with artists and creators as they live out their passions!
Just use the there bot to add them to a role
Then get the ids from the role
Lol there API has Facebook Id no Discord
cuz bad api™
could be old docs someone should check
Can confirm it does have discord id https://mercy.needs-to-s.top/11fc87.png
oWo
nice
their bot is shit @sinful jolt
@paper perch 
make it yourself
I would if I knew how to
send a zip of pics I'll make one 🤷
Here's my lizard
lemme pet him
Pong! Latency is 278ms.
!ping
:3
ponged™
Pong! Latency is 133ms.
client.ping```
108.66666666666667```
Pong! Latency is 582ms.
LUL
Eval:
INPUTMath.floor(client.ping)
OUTPUT
70```
get rekt
got a better ping latency
gg
Error:
INPUTclient.setGame("Lizard has a worser ping then me")
OUTPUT
TypeError: client.setGame is not a function```
gg
fuck XD
client.setGame
/eval client.user.setGame("Lizard has a worser ping then me")
/eval client.user.setGame("Lizard has a worser ping then me")

:kappa:
kappa
Eval:
INPUTclient.user.setGame
OUTPUT
[Function: setGame]```
/eval client.user.setGame("Lizard has a worser ping then me")
@tawny lava U win this time
kappa
XD
Error:
INPUTboi
OUTPUT
ReferenceError: boi is not defined```
/purge 1
/purge
hmm
@weary shoal unban me right this instant
You're not banned
no
u wot
oke sry
kkk
-botinfo @meager jetty
😏
-botinfo @stable jolt
-botinfo @hushed snow
-botinfo @onyx kelp
330044809651814412
Robot Hamster
2058
Robot Hamster is a multipurpose bot that has moderation commands, fun commands, and useful commands! Overall it is the bot to choose!
discord.js
h!
3
268 Servers
@karmic radish
@lavish mango
-botinfo
Please include a bot mention
-botinfo @fair grail
Pretty sure botinfo should be done in testing channels unless it relates to the conversation
nah, this is the bot info checking channel 

already done @earnest phoenix
you using the message event?
What event are you using to get the guild
nothing 😦
dunno how you are getting guild then
You'd need to use an event like message after they run a command, then <Message>.guild.id it
np.
can anyone help? i use discord js and check if bot has permission to "send messages" but it's not working:
if(!msg.guild.member(client.user).hasPermission("SEND_MESSAGES"))
{
msg.author.createDM().then(dm=>{
dm.send("It appears that I don't have permission to talk in the server/channel you tried to talk to me, please change it or notify an admin.");
});
return;
}
if(!msg.guild.me.permissions.has('SEND_MESSAGES') {
// DO STUFFZ HERE
}```
if(!msg.channel.permissionsFor(client.user).has('SEND_MESSAGES') {
// now do stuffz here
}
try that
also @earnest phoenix msgauthorcreateDM is totally wrong
just msg.author.send
one liune needed
return <message>.author.send('STUFF');
both ways work, ill use the shorter one
So in djs I can get ws events with raw how can I send on the ws connection?
Trying to make a client lib for lavalink
-botinfo @molten wren
213466096718708737
Mantaro
4454
Stable and fun multipurpose bot with moderation, images, actions and music!
JDA
~>
96
48429 Servers | 49 Shards
@cosmic plover 
@cyan flax 
@inner jewel
bot for rules and permision ?
Bot for welcome ?

bot for command
bot for ping
bot for president
bot for bot
client for bot
bot for client
bot for pizza
bot for robbie rotten
soo im trying to get server count with this code
https://puu.sh/wZVyx/0a6ca22563.png
but it gives me an auth error? :c
that means you gave it the wrong token
also instead of doing bot.guilds.array().length just do bot.guilds.size
did you give them the bot token? it's not the right one
not the bots token
And use snekfetch 
you get your token here https://discordbots.org/api/docs
but its right :\
LOL
they need to mention it's on the bottom lol
Monofur actually

i used comic sans for my bot's name in here https://discordbots.org/bot/325608201175433216
@tawny lava thank you!
why my bot crash for this??: http://prntscr.com/g3p9si
Discord.js and JavaScript
You should catch unhandled Errors so they don't crash your bot
334186716770598912
neko
5531
A bot to post random nekos from https://nekos.life
discord.js
~
7
564 Servers
@sinful jolt
With .catch ?
process.on('uncaughtException', err => {
let errorMsg = err.stack.replace(new RegExp(`${__dirname}\/`, 'g'), './');
console.error("Uncaught Exception: ", errorMsg);
});
process.on("unhandledRejection", err => {
console.error("Uncaught Promise Error: ", err);
});
I'm gonna add that
But i not created !role, why the bot send me this error ?

@zenith ocean Why are you under the locked Administrator role?
net user Administrator /active:yes
:p
Hahahaha
Anyone gud with js wanta work on a new bot I'm planning to integrate with Alexa voice service hit me up
+eval hasUpvoted(ctx.message.author.id)
-botinfo @shut pumice
how to do to authorize my bot for the server counting ?
the output of console is all time: unothorized.
Should I be certified?
you need to get your token from this https://discordbots.org/api/docs
ok ty
-botinfo @humble echo

@coral crown
mass dm?
lul
client.users.forEach(user => user.send('add my bot k ty'));
👀👀
cough .map
XD
no
yes
forEach > map
banned :/
no u
Looool
var > let



@sinful jolt http://prntscr.com/g3x3tz I can not figure out what the problem is 😦
I do not understand sorry 😦
Ok
So your bot is attempting to add a role
The parameter being passed to it
Isn't a role or a id
Hence the Error
becouse my bot is attempting to add role ? where start this ? Then it only happens after a while that the bot is active because?
maybe server overload ?
your bot doesn't have permission to give roles
but not should crash in this metod
<voicecon>.player.dispatcher.end(); is throwing error saying end is not a function
that's DJs btw
what should I do
@zenith ocean you need to add a .catch to the addrole
ok, so with .catch my bot should not crahs ?
Yes
process.on('uncaughtException', err => {
let errorMsg = err.stack.replace(new RegExp(`${__dirname}\/`, 'g'), './');
console.error("Uncaught Exception: ", errorMsg);
});
process.on("unhandledRejection", err => {
console.error("Uncaught Promise Error: ", err);
});``` add this somewhere too
i have added this at my main file (app.js) is correct ?
Should be fine
Or should I add this to any file commands ?
do you have sparate files for the events?
yes
put it in the events folder then
ok
can you help me, after some commands an error shows up saying it does not recognize 'msg' on this line:
if(!msg.channel.permissionsFor(client.user).has('SEND_MESSAGES'))
i use discord.js btw
msg isn't defined then
how come?
client.on('message', msg => {
this line says otherwise
is if(!msg.channel.permissionsFor(client.user).has('SEND_MESSAGES')) inside that scope
yes
what is the exact error
do you have an await around that area?
no
how can i fix it?
go over every line of code and check for the correct syntax. Semicolons, commas, etc
ok
you could also get a linter
lol
assuming linters catch all errors
still catches alot of errors
linter?
ok
@sinful jolt the same problem
Post the full Error here -token if it's there https://feed-the-wump.us
strange, up till now this error didn't show up, i'll tell you if it comes up again
@sinful jolt https://feed-the-wump.us/zenugakelu.tex
And that crashs it?
Uncaught Exception: TypeError: Supplied parameter was neither a Role nor a Snowflake. at GuildMember.addRole (C:\Users\Administrator\Desktop\AlphaBot\node_modules\discord.js\src\structures\GuildMember.j s:397:22) your Error is this
But it shouldn't crash it
here, now i have noticed the error returned, this is the error
what did you pass it as in your message event?
nothing, i think someone else did maybe
but i remember doing the same thing again and it showd up after few times
idk how to fix this...
wait, it's ok, finally figured it out and was just dumb not noticing
that wasn't the problem this THINGY is called msg for me, the problem was i had the same code in guildMemberAdd and guildMemberRemove, noticed it after seeing the line
@earnest phoenix Is that what I think it is...?
AAAAAAAAAAAAAa AN EASY PROGRAMMING LANGUAGE!! BATCH!!!
😅
@sinful jolt ok i understand the problem, the problem is the welcome message. my bot have the user add role when the user join on the server, in this server the bot not have the permissions for add the role, for this my bot crash all time. Solution: go out my bot from this server
@zenith ocean you need to catch that function because that's not the only time that's going to happen you don't want your bot to die Everytime it doesn't have permissions
@sinful jolt But the bot fails to add permission here only, because it does not have the admin role
So do you really want your bot to crash every time someone doesn't give it admin
Like a bot farm
- it doesn't need admin to add roles
I don't mind lol
sorry
@sinful jolt that is my code: https://feed-the-wump.us/usizufahen.php Do you say to put this into a function?
member.addRole(member.guild.roles.find("name", (role))).catch(console.log(e));
I think
@zenith ocean what's (role) in your settings file?
the role That the bot adds to the user who enters
@sinful jolt ok, the error is the same, but the bot not crash
ty
np~
i used .catch(console.error)
try, catch((err) => {})
catch(console.error) is depreciated iirc
it is
What do you mean? I do not understand
Because it doesn't properly catch errors anymore. It's supposed to be an arrow function.
0@fiery goblet ty nothing error with catch((err) => {})
how to do locales? thought that i would store it in a database as en, fr and so
and that i need to replace stuff
oh wait, i got an idea
mmmm
rip
const D = require('discord.js')
const token = require('./config.json').token
const shard = new D.ShardingManager('./memedaddy.js', {
token: token,
totalShards: 'auto',
respawn: false
})
shard.on('launch', shard => {
console.log(`Launching shard ${shard.id + 1}/${shard.manager.totalShards}`)
})
shard.spawn()
This is my sharding manager, and I keep getting dead shards and some shards duplicate themselves and double send messages. Why? I'm on debian, use the latest node version, d.js, and run it on pm2
Could it be an issue with d.js, or discord its-self?
I don't get errors when shards die or dup
Or does every lib/lanuages have this many sharding issues?
I have had 0 issues with py shards other the normal Discord ws unstableness
Why does Discord even let you connect with the same shard_id twice 
Idk, but I'm sick of double posting shards. I lose a ton of servers each time it happens.
can't help haven't got to Shards yet 🤷♀️
Starting to think its a d.js issue tbh
Add logs on disconnected, reconnecting, resume events might help pin point it
yeah
hey guys, can you please tell me what's wrong with these two lines?
if(!member.guild.channels.find("name","trolluminati").permissionsFor(client.user).has('SEND_MESSAGES')) return;
if(!member.guild.defaultChannel.permissionsFor(client.user).has('SEND_MESSAGES')) return;
it keeps telling me it does not recognize .has

Becuse permissionsFor takes a member object not a user object
oh
if (!msg.guild.channels.find(client.user.id).permissionHas('SEND_MESSAGES')) return;```
i see
or some shit
@vital lark that doesnt do what he wanted
no, it's not on msg, it's on member add and member leave
if(!member.guild.channels.find("name","trolluminati").permissionsFor(msg.guild.members.get(bot.user.id)).has('SEND_MESSAGES')) return;
``` Something like this
Input:
msg.guild.members.me
Output:
undefined
oops
Input:
msg.guild.me
Output:
undefined
I cant remember it
It is msg.guild.me
ok, thanks
rip
noo.... @umbral pelican doesn't work
what should i do then 😭
pm2 and sharding ??
i thought you werent supposed to use pm2 with the sharding manager thingo
@jagged plume No
A sharding managers already handles shards
pm2 just handles the process
if(!member.guild.channels.find("name","trolluminati").permissionsFor(member.guild.me).has('SEND_MESSAGES')) return;
if(!member.guild.defaultChannel.permissionsFor(member.guild.me).has('SEND_MESSAGES')) return;
please help, something is wrong with this code, it does not recognize the 'has'
probably does that when it can't find a channel called trolluminati
no, it does, this is the full code:
if(member.guild.channels.find("name","trolluminati"))
{
if(!member.guild.channels.find("name","trolluminati").permissionsFor(member.guild.me).has('SEND_MESSAGES')) return;
member.guild.channels.find("name","trolluminati").send("Hello " + member.user + ", welcome to " + member.guild.name + "!");
}
else
{
if(!member.guild.defaultChannel.permissionsFor(member.guild.me).has('SEND_MESSAGES')) return;
member.guild.defaultChannel.send("Hello " + member.user + ", welcome to " + member.guild.name + "!");
}
no one can help? 😦
because there's seems nothing wrong with that code
what's the error
What? ("name","trolluminati") What is this?
yes
Oh, crap. That's how you people do it.
that's how find works
it searches for a channel with the name "trolluminati"
but it does not recognize "has"
Make sure the channel is a text channel.
it does not show up now, i'll show when i encounter it
That's weird.
ok
yo guys is this correct make my commands only be in right discord but no other places
if (message.guild.id = config.mgnDiscordId) {
//stuff
return
} else {
message.channel.send("SORRY! you not allowed to do this commands");
}```
im making 2 bots rn i got 1 almost finished thats TalentRecordz 1 but still got no place run it yet. and MGN discord bot
im still waiting for my friend get his $10 get me VPS for my talentRecordz
It’s === not just =
Looks ok
kk
try it and find out
Is there a js equivalent to py for guild in bot.guilds: print(guild.name)
Basically I need to loop through all Guilds and add a field to my database
thats what mine is
all depends if using msg. or message. as message thign and end bit default sendMessage but mine is send
mine bult in as module
That could work as wel
unless your const needs to change then use let I believe
^
for(var guild in bot.guilds)
{
message.channel.send(guild);//Note: it will give you the mentional version of the guild so i suggest you'll change it to send(guild.name);
}
O ic ic Ty~
np
i have changed it up a bit, but it's still not working:
client.on('guildMemberRemove', member => {
if(!member.guild.me.hasPermission('SEND_MESSAGES')) return;
//something
});
Cannot read property 'hasPermission' of undefined
no one knows what to do or something? 😪
I don’t see what’s wrong with that code 
I guess I'll leave this here as im lost af wew so when ever i call this eveything stops working and all my api calls return a 405 tf did i break here
js client.awaitReply = async (msg, neko2send, limit = 60000) => { freeNeko = msg.channel.send(neko2send); const filter = m=>m.channel.id = msg.channel.id & m.content === ">catch" ; try { const collected = await msg.channel.awaitMessages(filter,{max: 1, time: limit, errors: ['time']}); if (collected.first().content === ">catch"){console.log("True");console.log(collected.first().author.id); freeNeko.delete(); msg.channel.fetchMessages({ limit: 50 }) .then(messages => { let msg_array = messages.array(); msg_array = msg_array.filter(m => m.content === ">catch"); msg_array.length = 50; msg_array.map(m => m.delete().catch(console.error)); });} } catch (e) { return false; }};
@sinful jolt I dont get why you are setting the length to 50 here? msg_array.length = 50;
@weary shoal because I don't know wtf I'm doing
@sinful jolt Can you explain what you want it to do so I know what is happening?
So at x amount of msg and time if a Neko Channel is set it calls that and that sends a neko I want to wait for the first person to do >catch then Delete the neko and anyones messages that had >catch
the code that calls that funcjs if (await client.nekoChannel(message.guild.id).catch() !== null && await client.nekoChannel(message.guild.id) === message.channel.id) { let guild = await client.getGuild(message.guild.id); guild.msgcnt++; console.log(guild.msgcnt); client.saveGuild(guild); if (guild.msgcnt===5){ client.awaitReply(message,"neko?"); guild.msgcnt = 0; client.saveGuild(guild);} }
it sends neko? then things go vary bad
I also need the ID of the first person that does >catch to update there balance
I am confused af :/
Hmm, I'll see what I can do
I'm basically trying shit till it works :/ learning along the way
code is all here and up to date https://github.com/TomsUsername/nekos.life/tree/master/bot
i changed the code a bit to this, hope it will work for me:
if(!member.guild.me||(member.guild.me&&!member.guild.me.hasPermission('SEND_MESSAGES'))) return;
it can be simplified to js if(!member.guild.me || !member.guild.me.hasPermission('SEND_MESSAGES'))
oh right XD
@sinful jolt try this ```js
client.awaitReply = async (msg, neko2send, limit = 60000) => {
const filter = m => m.channel.id === msg.channel.id & m.content === ">catch" ;
msg.channel.send(neko2send)
.then(freeNeko => {
freeNeko.channel.awaitMessages(filter, {max: 1, time: limit, errors: ['time']})
.then(messages => {
messages.first().channel.send('Neko Caught!')
messages.first().author.id // THIS IS THE ID TO ADD BALANCE
freeNeko.delete()
})
.catch(timeout => {
freeNeko.channel.send('Time up! The Neko escaped!')
})
})
}``` You'll have to add in all your catches and stuff but it should work
@weary shoal oo Ty ❤️ I will try rn
@sinful jolt one small adjustment, if you want to delete the neko message when time runs out add freeNeko.delete() under the line freeNeko.channel.send('Time up! The Neko escaped!')
lmao you're welcome ❤
smh neko would get muted unless u make it so it doesnt work here or dbots
for node?
Ty
@tawny lava look at my repo if you want a real sample
@keen anvil also I updated my repo everything uses rethink now 👌🏼
after looking at neko, it looks ez pz
yo how can i error log to discord chat in console aka discordjs
when i done mgn/eval message.channel.send(console.log) doesnt do it says not fuction
how will i make something which displays such @edgy carbon (=mods)? discord.js
just get members with ban perms
ye ik but nub
filter then map
so msg.guild.members.filter(u => u.user.permissionHas()).map(m => m.user.username ?
oh yeah
msg.guild.members.filter(u => u.hasPermission('BAN_MEMBERS').map(m => m.user.username ?
like so?
yes
what is a better db source? Rethonkdb, PostgreSQL, or SQLite
I prefer just using member.permissions.has() tbh
all, really
it's just preference
yes
JSON != Good
!= !== good
how will I make message.guild.members.filter(u => u.hasPermission('BAN_MEMBERS') ).map(m => m.user.username + ' | ' + m.user.presence.status) look noicer and clean?
Re🤔👌🏼
re
db 💯
@sinful jolt not Re🤔 it's Re
db
yep
Re
db
yes
I have json [{id:3728, Nekos:272,name:"bill"},{id:37247298, Nekos:72,name:"not bill"}] ect how can I sort it by the sum of Neko
wdym
Most to least? @sinful jolt
json.sort((a, b) => b.Nekos - a.Nekos)
sorry I'm on mobile atm
I wonder why this is causing this problem with Yumi
js 1|YumiBot | Error: Cannot find module './src/Commands/u.js' 1|YumiBot | at Function.Module._resolveFilename (module.js:485:15) 1|YumiBot | at Function.Module._load (module.js:437:25) 1|YumiBot | at Module.require (module.js:513:17) 1|YumiBot | at require (internal/module.js:11:18) 1|YumiBot | at Client.client.on.msg (C:\Users\AugustxD - Official\Desktop\other b0tz\Yumi\YumiDev\YumiBot\Yumi.js:72:21) 1|YumiBot | at emitOne (events.js:115:13) 1|YumiBot | at Client.emit (events.js:210:7) 1|YumiBot | at MessageCreateHandler.handle (C:\Users\AugustxD - Official\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34) 1|YumiBot | at WebSocketPacketManager.handle (C:\Users\AugustxD - Official\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:102:65) 1|YumiBot | at WebSocketConnection.onPacket (C:\Users\AugustxD - Official\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:325:35)
...
It can't find the file
Fuckin discord.js suddenly making my CPU explode.. wtf
RIp
-bots @harsh zenith
@quartz gull 
rip
-botinfo @quartz gull
-botinfo @gilded plank
Please include a bot mention
@earnest phoenix thanks what i needed 👌🏼
Fuck Node & PM2
ugh so i have ```js
bot.getUsers = async () => await bot.r.db('neko').table('users').run(bot.connection, function(err, cursor) {
if (err) throw err;
cursor.toArray(function(err, result) {
if (err) throw err;
users = result.sort((a, b) => b.nekos - a.nekos);
console.log(users);
return users
});
});``` now it logs <http://b1nzy-banned.me/WUiuC.png> this is gud however when i call the func it returns https://feed-the-wump.us/ahigebemew i am confused af 
What are u trying to do?
is (err) defined?
if (err) return throw new Error(err);```
but it returns that other shit
lol
return users should return the same thing it logs to console no?
Yea.
@vital lark Do you even js
you can't return a thrown error
and, don't purposely throw errors
handle them properly
if (error) {
msg.channel.send("An error occured!");
console.error(error);
}```
Ey, so before I attempt anything, is it possible to get all users of a server (no bots) and list them into, online, dnd, away, invisible / offline and streaming?
yes
yes
yes
oh ok thanks
if (msg.content.startsWith(prefix + `announce`) && msg.author.id === "336396409110659083") {
const args = msg.content.split(` `).slice(1).join(` `);
for (const guild of bot.guilds) {
guild.defaultChannel.send(args)
}
}
idk how i made that but would it work? (global announcer system)
but yes it looks like it will work
just prepare to lose atleast 5 guilds + per announcement
more than 5
try hundreds if you have it
1/5 maybe
¯_(ツ)_/¯
I've done two global announcements. First time lost 300, second time (a month later) lost 500
doesn't REALLY make sense as a single message in the default channel isn't annoying, but people hate it anyway
Who here uses N.JS?
node?
Mhm
like 90% of us use node
gg
85% does
im working on a party system ^w^
Anyone here use the bot lists' API?
90% does
if (message.channel.id === relayChannelA) {
client.channels.get(relayChannelB).send(`${message.author.username} said ${message.content}`);
} else if (message.channel.id === relayChannelB) {
client.channels.get(relayChannelA).send(`${message.author.username} said ${message.content}`);
}
// some of the code lol
the bot needs to be accepted before you can post
WHY DOESN'T ALL BOT LIST SERVERS HAVE THAT CHANNEL?

Because other bot lists are dumb
rekt
Because other bot list users aren't dumb
lol
¯_(ツ)_/¯
lol
how do i use this part of the discordbots.org api in my bot?
(yuh, its using discord.js)
const snekfetch = require('snekfetch')
snekfetch.get(`https://discordbots.org/api/bots/${client.user.id}/votes`)
.set('Authorization', 'UR DBOTS.ORG KEY')
.then(r => console.log(r))
.catch(e => console.warn('dbots.org down spam @oliy'));```
lol
do i have to install snekfetch by npm? xd
you already have it installed
snekfetch comes with discord.js
thx
lul
lol
its soo long
lmao
can i use the r thingy in other parts of the cmd
like in my embed
i tried but it crashed
and said r is not defined
You have to do the stuff in the .then
ya
oke thx
it still says r is not defined 😐
if (msg.content.startsWith(prefix + `votes`)) {
snekfetch.get(`https://discordbots.org/api/bots/${bot.user.id}/votes`)
.set('Authorization', 'is like blanked out')
.then(r => {
console.log(`[Quixl] Total discordbots.org votes: ${r}`)
const embed = new Discord.RichEmbed()
.setColor(0x2F69DF)
.setFooter("qvotes | Quixl ")
.addField("Votes", "Total votes: " + r, true)
msg.channel.send({embed});
})
.catch(e => console.warn('[Quixl] discordbots.org is down, votes couldn\'t be fetched.'));
}
thats my code im using
oh ok
no
instead of just r?
JSON.parse(r.text).length instead of r
yah
no
What's its name, I'll test and approve it
Becayse yeah, the code works lol https://mercy.needs-to-s.top/322895.png
oh ok
@empty moat done™










