#development
1 messages · Page 1331 of 1
the benifits of prepared statements are listed on that url
Aight
some one able to help me on discord.py im trying to only allow specific roles use a command but depending on the role they can have like a different amount of stuff cleared
example like
if role = admin then the can clear 100 msgs
if role = mod then the can clear 50 msgs
pls help me
just a basic if statement @earnest phoenix
Also why would you even do that
can u give an example by any chance ?
Mods can just use the command twice
its an example
Either check for role name or perms
i can link you a guide on how to use if statements in python
how would i check for roles
member.roles
hey guys
so if member.roles == 'rolename'?
how r u doing
i'm trying to open pycharm without the .bat file, cos as we know, bats are bad.
what dose this mean
It just doesn't work
you dont have perms to edit those files @charred nimbus
why
so if member.roles == 'rolename'?
roles is a list
Im guessing .includes or something like that
dont think python has .includes
@charred nimbus run it with sudo
so i would do
if member.roles == LIST
did it say if elm == list?
-_-
I need some help with opening Pycharm.
I'm trying to open it, but it won't open without the pycharm.bat file.
If anyone can help, I'd be very greatful.
it gives you examples of how to do it 🤔
dont gotta be rude abt it -_-
whats rude? i gave you a link
which explains it
asking if something is right, when i just gave you a source that says its wrong is rude.
I need some help with opening Pycharm.
I'm trying to open it, but it won't open without the pycharm.bat file.
If anyone can help, I'd be very greatful.
anyone knows why whenever I want to edit an embed wich already has an image attached to it to put a new one, nothing changes ?
its kinda hard to explain but
like an embed thats already sent?
yep
you cannot attach new images to existing embeds iirc
oh thats why then
someone else might want to comment on that, because i dont have a source on that.
well you can actually
just looked at the docs
you can but you have to attach the file first
thats what i said
hey guys
can someone help me
i asked
but noone listened
I need some help with opening Pycharm.
I'm trying to open it, but it won't open without the pycharm.bat file.
If anyone can help, I'd be very greatful.
Hi guys a have a question,
For making a music discord bot that you can search videos with, I must having a google api?
never used pycharm sorry
i do my best to help, but the question i cant answer, maybe shiv can but looks like he is busy modding some people
Hi guys a have a question,
For making a music discord bot that you can search videos with, I must having a google api?
@balmy anchor some plugins don't need one but most of the time you'll need a Youtube Data v3 api key
someone told me after like 300h u'll need to spend money no?
https://i.imgur.com/cbXV6CR.png someone knows why it doesn't adds the description?
i know :) ill update it later
if msg.member is defined is it safe to assume msg.guild will be defined?
guilds are pretty much always cached in every lib afaik
not for DMs
client.on('message', msg=>{});
the client will have the guilds cached
then check the type
msg.type?
the type of the channel it was sent in
msg.channel.type
nice, that will make the code more clear
so if msg.channel.type === "text" then msg.guild and msg.member will be defined
right?
can discord users post messages in guilds they dont belong to?
no
so msg.member should be define right?
the can when the have the contorl of a discord bot that is on the server you want
i tthink
bots have members associated
node . does not work it takes longer then usual (over 10 minutes and nothing happens)
use node filename
node index.js , or node bot.js or node main.js, whatever your main file is called
alright
its been so long since i used that i forgot about it
nothing is happening
سلاو
make sure your command prompt is in the right directory
how can i give my self perms on my vps in google cloud
So i want to make a auto response for my bot for example the user sends a messages which includes word invite basic stuff i can check if the array of responses includes that but how can i make it detect even if the user types invitei23u0912u312 or something like that?
js?
are there any node processes running in the task manager @fading breach
js?
yup
dont think so let me check
string.includes("")
bruh
also does node --version print a version greater than 12?
what are they called?
why not?
leme test it ig
why not?
okay yes it will
no, there shouldn't be one running until you run the node command
okay
does the node --version command work?
i've never used 13 with discordjs, but it should work
what did you change from your old code
should i get a newer/older version?
to the current?
me?
ye
image search like !image just gives some random image
did you add anything to your ready event?
no
did you delete your login?
the one with the token?
yes
no its still there
can you add a console.log("test 123")
near the beginning of your code?
and see if it logs
it logs
double check your client.login isnt in an event
like, is it at the very very bottom of your code
yes
with no
} or ) at the end
wait no it has that at the end
tysm it works now :)
not sure if commands work though lol
ReferenceError: options is not defined
oof
who is options
my name is options, because i have no options 
just wanted to say we are both mutuals with absolute lol
medic
haha but uhm i gotta fixx ReferenceError: options is not defined
just wanted to say we are both mutuals with absolute lol
o shit thats actually really cool
where is options undefined?
its usually just an object you pass in and not options.foo or whatever
How can i get admin command logs from my ARK server that is hosted in nitrado?
Okay so i know how to get if a string includes something from array
const resArray = [
{ trigger: 'invite', response: 'test' }
];
resArray.some(x => message.content.includes(x.trigger));
which will return a boolean if it includes or not but how can i find the object that with the trigger that was found?
if (value){ ?
why are you storing that in an array tho
do i just send the code for it
ye
cuz its gonna be an array of different objects
why
`var options = {
url: "http://results.dogpile.com/serp?qc=images&q" + "example",
method: "GET",
headers: {
"Accept": "text/html",
"User-Agent": "Chrome"
}
};
}`
the members gonna set up the auto response like they want
oh dogpile do be epic
yeah i just wanted to try it
"User-Agent": "Chrome"
would both guildMemberRemove and guildBanAdd listeners be triggered at the same time?
is that pptr or something
would both guildMemberRemove and guildBanAdd listeners be triggered at the same time?
yep
alr
"User-Agent": "Chrome"
what
why
any better way?
my code is bad
its an array of objects some can be added or removed 
const you = _stinky
might want to make it a map @earnest phoenix
would both guildMemberRemove and guildBanAdd listeners be triggered at the same time?
@snow urchin sort of. Not literally at the same time your bot handles the case, but more like one may be triggered before the other. For the most part I think it'sguildBanAddtriggered first, but don't rely on one of them being first.
its an array of objects some can be added or removed
@earnest phoenix Yeah, i think so
dm me a way to fix it if u want
might want to make it a map @earnest phoenix
Hmm i can but not sure since i wanna add more options dm the user instead of sending it to the channel
@snow urchin sort of. Not literally at the same time your bot handles the case, but more like one may be triggered before the other. For the most part I think it's
guildBanAddtriggered first, but don't rely on one of them being first.
@sudden geyser I am not really concerned as to which is triggered first, I am currently doing stuff for the PreMiD discord bot and they have the ban and member remove event do the same thing, meaning only one of them was needed if they both were triggered
No

maybe
Is there a setting to set the max line width for a line in visual studio code
you can change the max word wrap column
this setting?
Does someone knows how can i log that when a file or embed got deleted it will show it like this?
check for message.embeds and message.attachments
isnt it obvious?
24hours = 24 * HOUR
1week = 7 * 24hours
etc...
10/10 burber experince
@cosmic robin how do you rate your burber experience
@royal portal whats burber
hair cutter
Hi!! I need help, Im trying to detect the reactions of a message, but the bot doesn't detect it
return ['💰', '💵', '🤑', '💸'].includes(reaction.emoji.name) && user.id === message.author.id;
};
message.awaitReactions(filter, { max: 4, time: 60000, errors: ['time'] })
.then(collected => {
const reaction = collected.first();
if (Discord.MessageReaction.emoji == '💰') {
message.channel.send("1");
//act = false;
} else if (Discord.MessageReaction.emoji == '💵') {
message.channel.send("2");
//act = false;
} else if (Discord.MessageReaction.emoji == '🤑') {
message.channel.send("3");
//act = false;
} else if (Discord.MessageReaction.emoji == '💸') {
message.channel.send("4");
//act = false;
}
})`
Here is the code
Does anyone can help me please?
Why does .random() not work for this?
@snow urchin array.random() doesn't exist
oh right yes, my dumb brain 😄
you should be using
reaction.emojiinstead
@sonic lodge ok, im trying it
If I remember correctly, I will need + 1?
no
yes callum
getting mixed signals
*actually no
ah sure its -1 not +1, since 0 is start
it's 0
@drifting wadi what's supposed to happen
and mb, it should be reaction.emoji.name, not reaction.emoji, if you want to compare the actual unicode representation
look at your filter
return ['💰', '💵', '🤑', '💸'].includes(reaction.emoji.name) && user.id === message.author.id;```
it checks that the id of the user who reacted is the same id as the user who sent the message, which is your bot
your collector will then only collect those four reactions by your bot
you need the id of the user who triggered your bot's message
you mean message.author.id?
show the whole command code
uhm ok
const moment = require("moment")
module.exports.run = (client, message, args) => {
const embed = new Discord.RichEmbed();
embed.setAuthor("Creador de presupuestos", "https://i.imgur.com/GungfUE.png", "https://i.imgur.com/GungfUE.png")
embed.addField("a")
embed.setColor("#fffff1")
embed.setFooter(`Comando pedido por ${message.author.tag}`)
embed.setTimestamp()
message.channel.send(embed).then(function(message) {
message.react('💰')
message.react('💵')
message.react('🤑')
message.react('💸')
const filter = (reaction, user) => {
return ['💰', '💵', '🤑', '💸'].includes(reaction.emoji.name) && user.id === message.author.id;
};
message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
.then(collected => {
const reaction = collected.first();
if (reaction.emoji == '💰') {
message.channel.send("1");
//act = false;
} else if (reaction.emoji == '💵') {
message.channel.send("2");
//act = false;
} else if (reaction.emoji == '🤑') {
message.channel.send("3");
//act = false;
} else if (reaction.emoji == '💸') {
message.channel.send("4");
//act = false;
}
})})
}
oh noes i hate explaining scoping problems
// this message at the top here is the user's message. it contains the information you want.
module.exports.run = (client, message, args) => {
const embed = new Discord.RichEmbed();
embed.setAuthor("Creador de presupuestos", "https://i.imgur.com/GungfUE.png", "https://i.imgur.com/GungfUE.png")
// ...
// here, you send a message to the same channel the user sent their original message. so far so good.
message.channel.send(embed).then(function(message) {
// oh noes! the message that "message" refers to now is the message the bot just sent!
message.react('💰') // that works for these reactions, because the bot needs to react to the new message it just sent.
message.react('💵')
message.react('🤑')
message.react('💸')
const filter = (reaction, user) => {
return ['💰', '💵', '🤑', '💸'].includes(reaction.emoji.name) && user.id === message.author.id; // but once we get here, "message" is still referring to the message sent by your bot, not the one the user sent.
};```
all you need to do is distinguish between the user's message, and your bot's message, which just takes some renaming
for example function(m){}
rather than function(message){}
Suggest you look up how to do it and learn further
it still doesnt working
Suggest you look up how to do it and learn further
@blissful coral I have searched but I didnt find anything
@sonic lodge srry for being anoying
Well what did you search
How to detect reactions discord.js
you should be looking up how scope works
ok
is there any packages that improve the compilation and just the bot in general (JS)
??
like packages that speed up my discord.js bot
npm packages wont speed up your bot. they will slow it down..
atleast, if youre talking about performance & response times..
more efficient compilation?
.js files do not get compiled..
you know what i mean i hope
my friend, i think you have to start over learning the difference between different types of programming languages
wdym
there are different types of programming languages, js for example is an interpreted language and can not be compiled. c++ for example is a compiled language
but i wont explain to you how this works in detail, some googling should do it
oh understand i thought nodejs was compiling the files on glitch because ive never used js on my own machine like i have python and c++
although for websocket speed on the page it says "utf-8-validate in combination with bufferutil for much faster WebSocket processing (npm install utf-8-validate)"
thanks
... i wont answer any questions from you, i feel trolled.
sorry idk why you feel trolled
npm install zlib-sync
npm install bufferutil
npm install discordapp/erlpack
npm install utf-8-validate
^ should speed things up
jemalloc can reduce memory usage, but slightly higher cpu usage if that trade is fine for you aswell
because you were telling me about how the „compilation“ process should be speeded up, and then you send me a quote to speed up your websockets, which is kinda obvious if you have the right tools.
ooh ill keep an eye on jemallc
for webhook using
const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});``` do i need express?
for webhooks? nah
no?
then how come when i test it using my glitch url (https://CENSORED-juls07.glitch.me:5000/dblwebhook) when i test it nothing happens in the console
i belive glitch provides a dynamic internal port
what does that mean?
process.env.PORT rather than 5000
i dont have a .env on my project
process.env is not only from .env files
oh
i understand now
so 3000?
when i put the env thing it says in the terminal its running on port 3000
yeah
so using
const DBL = require("dblapi.js");
const dbl = new DBL(dbltoken, { webhookPort: process.env.PORT, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
``` and the putting my address and my password in topgg for it still doesnt spit anything out in the console
ive not used glitch ever, but somewhere in the glitch fourm/docs they cover ports
worthwhile to look at probs
k
let prefix = '-';
if (!message.content.startsWith(prefix) || message.author.bot) return;
``` how do i make it respond to two different prefixes?
&&
if(!prefix1 && !prefix2 ... )
its often easier to include rather than && every time
like ![].includes(content[0]) || bot?
yeah
You mean or, not and
Don’t get why searching the array should be easier than using an operator in the statement but okay.
it's cleaner, at the very least
It'd be ||
yeah 
But way slowlier
i tried
If you have a fixed amount using &&/|| is okay.
If you have &&, both prefixes would have to be true
why is includes slower 🤔
Wrong @faint prism
i mean are you running your bot on a potato
He checks if none of it is used
notice the !
lmao
Shhh go away with your snakes
if (msg.startsWith(prefix1) || msg.startsWith(prefix1))
{
// Prefix exists in msg
}
it's for a return code so it should be the opposite
Oh, yeah, you're right
You guys are weird
lmao
always has been weird
Aye
wheres always has been bot
hello
can someone help me with the dblpy module
I am not sure how to make something get called when someone votes for my bot
btw I do not use cogs for my bot```python
class TopGG(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.token = 'dbl_token' # set this to your DBL token
self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
@tasks.loop(minutes=30.0)
async def update_stats(self):
logger.info('Attempting to post server count')
try:
await self.dblpy.post_guild_count()
logger.info('Posted server count ({})'.format(self.dblpy.guild_count()))
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
await asyncio.sleep(1800)
@commands.Cog.listener()
async def on_dbl_vote(self, data):
logger.info('Received an upvote')
print(data)
def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(TopGG(bot))```
I am not sure exactly what to put instead of DBL token
and if I have to call these functions somewhere
like setup
ok
does anyone know here how to use on_dbl_vote without a cog
what did i dorked this time?

probably self invoking or recursive functions
i think
maybe
never had that error before
are you going to have to like, increase stack size or something 
im fairly certain i already fucked enough with the code
prob best to leave node as is

"It means that somewhere in your code, you are calling a function which in turn calls another function and so forth, until you hit the call stack limit."
lmao
hello
how do I make something it print something when someone votes for my bot on discord
WITHOUT cogs
are cogs not just listeners 🤔
oh ok
pretty sure cogs are pretty important to use in python. is there a reason your specifing without cogs @remote wharf ?
this is fine, its just one function trying to FETCH 5 slaves/shards, clearly its working fine with the FUCKING 4000 REQUEST PER MINUTE
because I do not use cogs for my bot because htey are impossible to use
and I do not understand one bit
and I how no clue if you are supposed to call them
or do something like that
do you understand webhooks?
not one bit
because youll have to learn either cogs, or learn how to make webhooks
would prefer the webhooks then
import dbl
import discord
from discord.ext import commands, tasks
import asyncio
import logging
class TopGG(commands.Cog):
"""Handles interactions with the top.gg API"""
def __init__(self, bot):
self.bot = bot
self.token = 'dbl_token' # set this to your DBL token
self.dblpy = dbl.DBLClient(self.bot, self.token)
# The decorator below will work only on discord.py 1.1.0+
# In case your discord.py version is below that, you can use self.bot.loop.create_task(self.update_stats())
@tasks.loop(minutes=30.0)
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""
logger.info('Attempting to post server count')
try:
await self.dblpy.post_guild_count()
logger.info('Posted server count ({})'.format(self.dblpy.guild_count()))
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
# if you are not using the tasks extension, put the line below
await asyncio.sleep(1800)
def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(TopGG(bot))
do I need to call this setup thing somewhe
how do I test if the API is working without voting for the bot 100 times
the test button on your bots edit page
how are 5 slaves doing that many calls?

its a for loop on those entries
how is it doing that many calls?
and also what exactly is DBL token?
is it hte one on the API page
and how do I know if the test works
the token provided
youd print the results from your listener
do I call the setup function somewhere
i would guess so
how would I call it
if it takes in the agrument of bot
do I put the client there?
cool, now all my shards broke
f
and what do I put for the webhook url
ok thanks
how do I call the setup command
what would I put inside for the arguments
setup(?)
presumably yes
oh ok
is there the same number of slaves?
somehow a self calling function is breaking the whole cluster
like wtf
exbrein plez
imma just turn that into a normal function
-.-
fuck that shit
can flask get stuff from discord py?
any lib can interact with any lib if you make it do so
remember that you're programming
not writing an essay
can discord js interact with discordpy? jk ofc it can
cough cough api cough cough
Cough cough hell cough cough
so is this correct?
import dbl
import discord
from discord.ext import commands, tasks
import asyncio
import logging
bot = commands.Bot(command_prefix = "&")
import os
TOKEN=os.getenv("TOKEN")
class TopGG(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.token = ""
self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='', webhook_auth='', webhook_port=0)
@commands.Cog.listener()
async def on_dbl_vote(self, data):
logger.info('Received an upvote')
print(data)
def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(TopGG(bot))
setup(bot)
bot.run(TOKEN)
How can Discord which is written in c,m ruby and a ton of other languages connect to my js/py/go bots?

Hmmmmm
it does not seem to be workign
WHYY
i only call it once

ONCE
Function,
wait delay,
run again
How is it duplicating itself?!??!?


I don't think that the client is supposed to go inside the bot parameter
because it is not working
and there are no errors 😭
does anyone know how to make the bot do something when someone votes for it in discord.py
or even get the webhook working
because I have absolutely no clue
imagine not double checking your scopes 
Uh
do you need to call the setup function
yeah
how
wdym how?
what does the bot argument mean
is it the client
because that does not seem to be working
you talking about me?
not exactly

abotu the webhook for the APOI
it is impossible to work
otherwise i'd help
i mean, people use the default code all the time
the default code does not work for me
because I have no clue what the bot argument means
and if I am supposed call setup
or just leave it there
and how to test it properly
your the python dev, you should probably know 🤔
how do i obfuscate nodejs code?
i can google how to use functions for you
I just don't know what the bot argument entails
How do u test code with vs code?
and what exactly you are supposed to but there
Like self host it?
not that
how do i obfuscate nodejs code?
@restive notch https://ourcodeworld.com/articles/read/607/how-to-obfuscate-javascript-code-with-node-js
Try that
thanks
I don't know if it works because I just googled it
have you checked the port you are acessing is open?
have you checked if the firewall is allowing incoming connections?
did you port forward
so if I just put this
from discord.ext import commands
import dbl
class TopGG(commands.Cog):
"""
This example uses dblpy's webhook system.
In order to run the webhook, at least webhook_port must be specified (number between 1024 and 49151).
"""
def __init__(self, bot):
self.bot = bot
self.token = 'dbl_token' # set this to your DBL token
self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
@commands.Cog.listener()
async def on_dbl_vote(self, data):
"""An event that is called whenever someone votes for the bot on top.gg."""
print("Received an upvote:", "\n", data, sep="")
@commands.Cog.listener()
async def on_dbl_test(self, data):
"""An event that is called whenever someone tests the webhook system for your bot on top.gg."""
print("Received a test upvote:", "\n", data, sep="")
def setup(bot):
bot.add_cog(TopGG(bot))
and filled in the right stuff
would it work
no
#development message im sorry but i read that as FUCKING slave0 for FETCH
or would I need to call the setup thing
you have others you need to do
like what
I am not sure if it is open
I just used 5000 as the port
how do I check
I am not sure about firewall
I am not sure what port forward is
firewalls are completely managed by you, theres a handful of them so i cant say what yours is so i cant really tell you about it
port forwarding depends on your router and only is needed if you are running off a home network
what does that mean
wheres your server located that your running this code?
google port fowarding
vps? home? server?
whats your url look like that your using(change it so its obvs not yours)
no
you need to include the path and port
I don't think you can do that
why not?
that is just the url that is there
What's the difference of .some and .find
is depends on the name of the probject
^
https://
for the link to the project it is
they using 3000?
i forgot the normal https port
youd add your path after their path iirc
@restive notch https://ourcodeworld.com/articles/read/607/how-to-obfuscate-javascript-code-with-node-js
@compact echo it doesnt work well for programs with `` which my program is littered with
https://discord.com/ <= url
https://discord.com/login <= url/path
https://discord.com:443/login <= url:port/path
there we go, a template for ya
What's the difference of .some and .find
but I thought the path has so be an integer
so how does this relate to the web hook
the path there is /subscriptions
but I thought the path has so be an integer
@remote wharf You mean port?
oh I keep getting confused
What's the difference of .some and .find
@carmine summit mdn says some returns true if found, while find returns the actual entry that passes the filter
@restive notch Sorry but like I said. I legit just search up how to obfuscate nodejs code and I didn't test it. Just google it
yeah thats waht i did and i couldnt find anything suitable for discord bots
so I need to change the path the to the path to get to my project?
thanks though
and the path to your webhook
it needs to be pointing exactly at the webhook
no matter what
how do I know if it is for the webhook
@restive notch I searched up how to obfuscate nodejs code discord bots and got this https://obfuscator.io/. This worked for me but I don't know for super big files so maybe try this and let me know?
JavaScript Obfuscator is a free online tool that obfuscates your source code, preventing it from being stolen and used without permission.
you get a response from the code when you test it
the link(url) IS the url you have already, the paht (/somePathHere) you need to specify within the code once it listens to the root
but I have no clue what this webhook link is
how do i use varables for html?
wlel its your fault
idk
well it your fault*
yeah I am pretty stupid
how do i use varables for html?
@drifting wedge google it?
I have no clue how to use cogs either
your setting it
self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
<var> tag I think
yeah
either pick one or move to something else
cogs are pretty important in py iirc
you'll likely have to learn them either way downt he line
why not get it over with already?
i personally dunno, Py isnt my area
def setup(bot):
bot.add_cog(TopGG(bot))
there is this thing
do I need to call this
and what do I put inside it
look at the docs, most people have no issue setting this up
I have been trying to set this up for the past 3 hours
oh well I guess I should just not add this then
which means learning c++
try sharding, you'll love it
it is so hard to add lol
shiv will be on soon prob
(at leasta for me)
how do i call a function from flask in html?
Woo, try sharding if you wanna a 5+ week project
flaskapp?

im too dumb for actually making a sharding manager
this shit is beyond complicated tbh
lmao
its fun to play with, but holy fucking shit is it hard and moody
it takes me roughly 5-10 seconds to spawn a shard

my bot will take 10 years to spawn more than 5 shards 🤷♂️
so much loading done with my stuff
oh gosh
will see it startup tomorrow
Takes a day to boot up
There, tell me how long that took pls
7 minutes~
oh just test it, rather than doing math
seems logical

91 minutes
wait
did i math right
am i drunk
yeah 91 minutes???
500
18 minutes if my math is right for 100
thats too long for mister ddossing twitch
hehehehhee
giemm5
well it died mid way but that proves the point lmao
@solemn latch
50 in 30seconds, take it or leave it
not good enought. 700 ever 10 seconds
says the boss who never programmed a day in his life
my pc cant even keep up with that many spawns
if i were to push that onto the host it'd probably do RAELLY decent
time to play with this more until i get dehydrated from crying


is there a way to sync a channels permissions to a category?
like idk <channelobj>.setPermissions(channel.categoryperms)
woo any fixes?
it should
ok
i assume permissions lock
o nbvm
channel.lockPermissions()
thought that was v11 but ok
so like what does utf 0 do?
um
there's nothing there but it looks like a space
no utf-8 with 00000000 or utf16 with 00000000 00000000
How can I see httpStatus with node-fetch.
As per the node-fetch documentation node-fetch
we can get the response status like this
fetch('https://github.com/')
.then(res => {
console.log(res.status);
});
and for gettin...
do you have a specific use case?
function checkStatus(res) {
if (res.ok) {
return res;
} else {
throw message.channel.send(`**${message.author.tag}**: Kullanıcının profili gizli.`)
}
}
const oyunistatistik = `http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?appid=730&key=${steamToken}&steamid=${ozet.response.players[0].steamid}`;
let istatistik = await fetch(oyunistatistik).then(checkStatus).then(url => url.json());
I tried it gives an error message. but it gives a try catch message.
@zenith knoll https://discordjs.guide/popular-topics/permissions.html#replacing-overwrites
@opal plank so um i tried doing .then to set it but i get this
(node:30376) UnhandledPromiseRejectionWarning: Error [GUILD_CHANNEL_ORPHAN]: Could not find a parent to this guild channel.
at TextChannel.lockPermissions (D:\dbots\Modmailtemplate - Copy\node_modules\discord.js\src\structures\GuildChannel.js:272:45)
at D:\dbots\Modmailtemplate - Copy\index.js:47:22
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:30376) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:30376) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
ok
@earnest phoenix idk if this helps but you could always just use the native http.request?
It's faster and simpler to use
chan.setParent(config.maincategory).then(() => {
chan.lockPermissions()
})
in your example, instead of using res.okay, use res.status, because node-fetch is just a wrapper for http.request @earnest phoenix
what is that function?
uh
tryna set permissions to parent
use that
category IS a channel
It's all channels 
channel.overwritePermissions(id of category.permissionOverwrites);
even im a channel
channel.overwritePermissions(id of category.permissionOverwrites);
@zenith knoll ?
you need the channel class for both @zenith knoll
@earnest phoenix i made it faster than last run we did in voice chat 
needs to be the actual category object
@solemn latch so
<server>.channels.cache.get(id)
should be
if you know that id is a category, yeah
yea
<channel>.type === 'dog'
Twitch Abusive Slave goes brrrrr
@opal plank thats awesome
good morning at all
i have just like yesterday the same problem with my code
my code doing 3 channal if i tipe (prefix)statson
if the code it is ´the main.js file is still worke but if i make a new file for the com extra the bot is nothing doing
god morning at all
i have just like yesterday the same problem with my code
my code doing 3 channal if i tipe (prefix)statson
if the code it is ´the main.js file is still worke but if i make a new file for the com extra the bot is nothing doing
@cerulean laurel
Main.js
Statson
vs
statson
Statson
vs
statson
@solemn latch u meen by the discripton the statson ?
the name
Im getting this error : UnhandledPromiseRejectionWarning: Error [SHARDING_READY_TIMEOUT]: Shard 0's Client took too long to become ready.
any fix to this issue?
how i can let command work only if somone have the role or higher
@solemn latch I tried that but then I got the same error and this error Cannot read property 'triggerReady' of undefined
might be triggerClientReady now
ripo
@solemn latch i put it in the same code in the error path (node_modules d.js) and it seems to be working fine
like im not getting the error anymore ;-;
welp tysm lol
nah I was guided lol
Ladies and gentlemen, we got 'em
How do I get all user flags?
Someone said it is oauth but bots have it without
and I can't figure out how
I don't think you can get all user flags/badges without oauth.
check for nitro perks, gif avatar, discrim
some of them are just improvises I believe. For example, do you have the nitro booster role
I don't think it's reliable as you can't be 100% sure, so I wouldn't bother putting the field myself.
the creator of the bot already shared his method in this channel
it's not 100% reliable but it works sometimes
can you link it plz
i would if i could find it 😅 it would be better off asking him but he does also do the things i said in the message above
Well
console.log(message.author.fetchFlags().then(flags => flags.toArray().map((flag, counter) => `${counter + 1}- ${(new(require("string-toolkit"))).toProperCase(flag.split("\_").join(" "), true)}`).join("\n")))
Found this
Promise { <pending> }
Get this tho
When he evals he doesn't get this tho
hmm
i don't think that's it, nitro information is not shown in userflags (if that's still what your looking for)
apart from userbotting an account to get access to that info, i cant see a reliable way to provide that info thats fail-safe
yea it's never going to be 100% accurate because there are people with nitro without gif avatars, have normal discriminators, and other things that comes with nitro that they don't use
could check for emojis in chat too
regex match every emoji, check if its a global/server emoji, if not its also a good indicator they have nitro
yeah but is fetching a users messages that efficient
though gifs are always nitro iirc
plus you would also have to choose channels to fetch them from
i mean, most likely the best and most affordable way would be to require CREATE_INVITE perm and add a userbot there whose sole purpose is to provide extra cache info for the main client, though thats likely against TOS
lmao
is it userbotting if the 'bot' doesnt do anything but retrieve info that users have access?
one could argue bots should stay on the bots endpoint, period
though the same goes for 'its not userbotting if its not automating stuff'
request cache => retrieve it => emit to bot
idk, im not a staff, ask em'

good question
personally, i doubt they'd allow it
over engineering™️
Yeah @opal plank @sand condor I just not gonna do it after lookin at it further
R there subusers in galaxy gate?
Like account wise? Or making second user accounts on the vps?
uhh can i ask about smething?, if we got verified at top.gg but after that the bot is offline
can we report it ?
Yeah any Linux os can do that
linux is similar to windows for accounts
you can make multiple ones
with sudo/admin perms
linux permissions is actually quite configurable
what will be the purpose of giving other people access though?
Like for example I don’t wanna give access to the code
wouldn't having like FTP to transfer files and a restart command be good enough?
You can give them anything you want any way you want
wait... if you don't want to give them access to the code, then why do they need an account
You can give them anything you want any way you want
@solemn latch so I can only give certain files?
wait... if you don't want to give them access to the code, then why do they need an account
@fluid basin well some part of the code
My dev team works In a pretty wierd way
I wouldn't suggest giving vps access in that case them (imo, personal opinion though)
^
How can I find a channel by name in a variable, I tried the code below and it didnt work.
let welcome = message.guilds.channels.find(chan => chan.name == “new-joins”)
Ik
where you can share and collaborate on code
If you can't trust them with all the code you can't trust them with your vps
installing?
Sounds like a docker kinda solution
we need like an api client thingy that we made to make the dashboard work and all sorts of shits
It’s super complicated
How can I find a channel by name in a variable, I tried the code below and it didnt work.
let welcome = message.guilds.channels.find(chan => chan.name == “new-joins”)
How can I find a channel by name in a variable, I tried the code below and it didnt work.
let welcome = message.guilds.channels.find(chan => chan.name == “new-joins”)
@agile lance .find returns a Collection, you need to access the collection either though checking the size to see if the channel is found, and them maybe using .first() to get the channel
yes we saw your message
you didn't need to send it again
.first() would only check the first channel listed, However in the private bot im making, My channel is listed 6th on the list.
then you need to find the channel you want
the best would be to use by id
name might have more than 1
Hello
channels.get(channel_id_here)
e.g. channels.get("272764566411149314") to get this channel
so
<guild>.channels.get(“ID”)
<guild> is a placeholder for how I define my guild class
const guild = message.guild;
const joinChannel = guild.channels.get(“ ID HERE “)
client.on(“guildMemberAdd”, async member => {
await joinChannel.send(“Welcome to the server, “ + member + “!”)
return;
})
Will that work?
How can I make Flask redirects with code? Like make redirect automatically?
return redirect(url)
On whatever route you want
Like calling from mongo?
Like we talked about earlier?
Youd have to make an request and build your url from that request
string input = "This casing should be varied";
string output = input[0];
for(int i = 1; i < input.Length; i++)
{
if (char.IsUpper(input[i-1]) output += char.ToLower(input[I]);
else output += char.ToUpper(input[i]);
}
return output;
Yeah that'll probably work
//.. file 1
bot.channels.cache.get(channel).send({embed}).then(() => {
let a = args[0]
let b = args[1];
if (message.content.includes("!")) {
if (args[0] == "catch" && args[1] == pkmn) {
//console.log(args[0])
//console.log(args[1])
//console.log("test: "+pkmn)
}
else {
message.channel.send("That is the wrong pokemon")
//console.log(args[1] === pkmn)
//console.log(args[0] === "catch")
}
}
})
//.. file 2
bot.channels.cache.get(channel).send({embed}).then(() => {
if (counter === -1) {
let a = args[0]
let b = args[1];
if (message.content.includes("!")) {
if (args[0] == "catch" && args[1] == `${pkmn}`) {
message.channel.send("You have caught a "+pkmn)
counter = 0;
// console.log(counter+" test")
}
else {
message.channel.send("That is the wrong pokemon")
// console.log(args[1] === pkmn)
//console.log(args[0] === "catch")
}
}
console.log(counter)
}
})
hi plz help
for some reason when i run the program using file 1, the commented statements get logged
while if i use file 2, the commented statements there dont get logged
btw ive commented the statements here just for clarity, the statements arent actually commented
while if i use file 2, the commented statements there dont get logged
@vale garden is thatbot.channels.cache.get(channel)channel is snowflake?
Try to catch the errors
and quick update btw, the statements on the else block of file 2 do get logged
const guild = message.guild;
const joinChannel = guild.channels.get(“ ID HERE “)
client.on(“guildMemberAdd”, async member => {
await joinChannel.send(“Welcome to the server, “ + member + “!”)
return;
})
Will this work for a private bot to send welcome messages?
if (args[0] == "catch" && args[1] == `${pkmn}`) {
try {
message.channel.send("You have caught a "+pkmn)
console.log(counter+" yeet")
counter = 0;
}
catch (err) {
console.log("error")
}
}
@viral veldt i did this and still nothing has been logged
hmm
I know why
const guild = message.guild; const joinChannel = guild.channels.get(“ ID HERE “) client.on(“guildMemberAdd”, async member => { await joinChannel.send(“Welcome to the server, “ + member + “!”) return; })Will this work for a private bot to send welcome messages?
@agile lance yes








