#development
1 messages · Page 1113 of 1
@umbral pollen basic js
的好看到她们的话
@honest perch i am still learning it
@surreal notch Where are you from?
@honest perch pls help me
@earnest phoenix lol
@surreal notch 대답해 병신아
Korean I think
@honest perch i know that it is a token error but how to fix it ??
Asian
can you tell this guy
No•1
- Speak english. This way everyone can understand you. It is our lingua franca after all.
#rules-and-info @earnest phoenix
@earnest phoenix #memes-and-media
@earnest phoenix wrong channel
please move over to #memes-and-media as multiple people have asked you to
petition to add an iq test before joining the server
🤣 😂
@earnest phoenix last chance
@earnest phoenix 
Okay
move to #memes-and-media or get muted
Yes
Petition accepted
@sinful belfry he left lmao
bruh
botghost sucks
lmao
but anyways i added a fake Listening to botghost status for my bot
activate your windows
bruh
I just realized the activate watermark isn't on my screen today. Nice
activate linux
activate a kernel
onlyfx the error is sort of self-explanatory: the file cannot be parsed
yes
you need to set node v12+ in your package.json engines
ok
activate your windows
switch to linux for PEACE
aka no forcing you to activate anything
activating windows is easy tho
ye but i cant be busy with it
it only unlocks some customisation (win10 home)
and most computers these days come with a windows key embedded in the bios, so you dont even need to (as long as you stick to the original edition)
which api
dblstats.com iirc
yes it is I think
View the historical performance of up to 11810 bots listed on Discord Bot List (top.gg). Updates hourly.
from there yes ^
just scrape 
then the API is not puplic for now
this bot is exploding
why - ping is bad
-ping or - ping?
I'm alive!!!
interestening
wait what
minus ping
its a bug
less than 0
happened to me usually when i host the bot on my PC
my bot was running with -200ms off my pc
luca is allowed too
it just sends statistics to DBL
i mean, no useful commands for users
if (!message.guild.me.hasPermission("SEND_MESSAGES")) return message.author.reply('Please give me permissions to send messages.')
This doesn't seem to be working and is causing an unhandled rejection error?
hasPermissions.
UnhandledPromiseRejectionWarning: Unhandled promise rejection.
run it in a try / catch block so you wont get the rejection
k
but better fix the code. this helps more
What's my error
either pass a string or a Value with token attached
did you name you client client or bot?
(client = new Discord.Client())
hasPermissions is also not working
if (!message.guild.me.haspermissions("SEND_MESSAGES")) return message.author.reply('Please give me permissions to send messages.')
changed it to permissions no effect still
OnlyFX you can hover over the red dot by the way
oh wait
try permissions.has()
if (!message.guild.me.haspermissions("SEND_MESSAGES")) return message.author.reply('Please give me permissions to send messages.')
changed it to permissions no effect still
@mild flower Because it'shasPermissionand nothaspermissions
does capitalization really matter?
yes
yes
Yes
did your IDE doesnt cry about it?
its scary. 10 Million servers and a shitton of shards
mee6 has 7 million
Accordign to Rythms website its 8 mil, where do you get the 10 from @quartz kindle ?
View the historical performance of up to 11810 bots listed on Discord Bot List (top.gg). Updates hourly.
by inviting
nvm wrong link
also
Ah, ty
oh my gawsh
im such a big derp
it wasnt working
cus i was using message.author.reply instead of send
worked
now

it will still throw errors if the user has DMs blocked
entrate in vocale
is there a way to send a dm to the server owner?
guild#owner.send
you need to fetch the owner first
welp
is there any better way to inform taht the bot doesnt have permissions to send messages?
@quartz kindle how do you create bot?
@olive narwhal go to ur discord applications and create a new aplpication
that triple ping lol
you code it first
like can u not
oh ok
you only add it to the list once its working
is there any better way to inform that the bot doesnt ahve message perms than dmming the person that wrote it?
but then what bout the unhandled promise rejections?
catch the error and send a message into the channel that the bot is unable to DM the user
you catch them
any one can help me
(node:4388) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined
catch the error and send a message into the channel that the bot is unable to DM the user
it wont have perms to send messages
as tim said, ignore it
what about UnhandledPromiseRejectionWarnings then?
as tim said, catch it xD
...
(node:4388) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined
message.author.send().catch(error => console.error(error), message.reply("No Permissions to DM you")) @mild flower this does both. it acknowledge the error and notify the user that it wont work
i guess ill log it in my bot testing sserver

message.guild.me.hasPermissions is not a function???
wut
(node:4388) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined can anyone help me?
plss
@sinful sorrel your code?
wait
im just doing that, i declare the embed object (yes, my help menu is embed) and then just send to the author, if promise was rejected, then send in the channel, ez.
doesnt work with all commands
like i have a privacy-policy command that also sends the stored data from the user with it
if (isNaN(args[0]))
return message.channel.send("you need to send link..");
this is my code
@lusty quest
how do i tell if a variable has over 120 letters
args is not defined
message.guild.me.hasPermissions is not a function???
@mild flowerhasPermission
ye i fixed that
kk
args is not defined
@lusty quest how i fix
define args
var args = message.content.slice(prefix.length).trim().split(' ');
i added this
but still the same
how do i tell if a variable has over 120 letters
@mild flower if you mean a string,if(string.length > 120)
what is your output if you log your args?
what do you mean
TypeError: String.length is not a function
giveawayPrize.length > 120
oh
length is a property of an instance of the type String. Not a static function on its own.
hey
i need help
i accidently added
11 song listeners
but if i remove any of em it does not work at all
I don't understand the issue
When you say,
accidently added
Do you mean that you need to undo the change?
make sure you not nested events on accident
@lusty quest i actually use this package
https://www.npmjs.com/package/distube
@lusty quest my code https://hastebin.com/midesohuyo.coffeescript
making a bot called Justice: what would a good prefix be? i need it to be space-separated (like dank memer's pls)
ideas: jc justice jst jce j just
i dont get why you get so many canceled events
Yeh
so what should i do
i dont get why you get so many canceled events
@lusty quest
¯_(ツ)_/¯
;-;
i never used the package and dont really care about music bots
maybe its a bug in the package
@lusty quest how can i limi tit
limit it
there is something for limiting
i cannot recall
they are not responding
So if you're subscribing to an eventlistener 11 times, should you unsubscribe to the event listener at some point after using it?
Not to familiar with event handlers and delegates tbh
yes, you should remove the event listener if you don't want to listen to anymore events
how
i am not good at events either
({ limit: 1})
can i use something like this
look where in your code you are subscribing to the event listener
@quartz kindle what’s your bot??
@autumn widget
Thx
its one of them
const listenerFn = (someFunction) => {...}
client.on("event", listenerFn);
//When you want to remove the listener:
client.removeListener("event", listenerFn);
no one with more than 3 braincells will download random files of discord
I am not getting it
uhm if u dont belive this https://yildizweb.glitch.me
this my bot website. same templates
<![endif]--> ?
I downloaded it, but I opened in an editor to check for JS scripts first 😛
Still not going to open it in my browser though
you know you can embed stuff inside files that launch in the brackground
Are you saying that for an html file being edited as text?
Because I believe that for some files. Like sound files, video files, where the decoding can do some sketchy stuff if a bad actor is exploiting the software reading it
so i have a problem with my bot:
I have a json file which contains all english strings, but it seems that if i restart the bot it doesnt get "uncached" and doesnt update. The code to load it uses require, but when i eval "require('../languages/english.json')" the json file is apparently updated. any idea why? sorry if im not clear
wired
hey @lusty quest js distube .on("playSong", (message, queue, song) => return message.channel.send( `Playing \`${song.name}\` - \`${song.formattedDuration}\`\nRequested by: ${song.user}\n${status(queue)}` ))
if i try this
it says unexpected token
return
Sounds like a syntax issue
remove the return
remove the return
@sand condor then this happens
erm, looks like js delete require.cache[require.resolve("./path-to-file"))];
worked
hm
lemme try doing that
That might fix it
Sounds like a syntax issue
@faint prism here https://hastebin.com/mikenefeku.coffeescript
i am not seeing any syntax issue
I only say that because a compiler referred to syntax characters as "tokens" typically
like { is a token
' and [ is a token, etc
ok
Making me think, somewhere in there, you might have a missing symbol
i think i found the issue
it's not what u r talking about
but it might be issue
leme try
# Mongo db url. (mongodb atlas)
MONGO_DB_URL=
```What to do there if i have database with port, host, username, name and password
🤷♂️ I'm not familiar with JS specifically, just a few other languages
But then it would.throw an error not execute multiple times
But then it would.throw an error not execute multiple times
@golden condor saying me
@finite nimbus user:password@url:port
i am use dbb
Okey, thanks 😄
and mongo:// for local or mongo+srv:// for clusters at the beginning
hey i think i almost solved it
if you use atlas they give you the entire connection string you just need to fill in your password
it now just sends it 2 times
how to solve that
my new code
it sends message two times
like this
ok nvm
@lusty quest it first says 2 then second time 3rd then 4 then 5
Does this happen for other commands?
Np
no
@faint prism thanks i fixed it
i wasn't closing command box
like if (cmd=== "play")
code//
i forgot to close it with {}
So a missing token 😛
@finite nimbus user:password@url:port
@lusty quest Okey, but i have database on hosting, and i have database name too
Okey, where?
Behind the port?
yes
you use MongoDB Atlas?
@lusty quest Idk, i have it on hosting.
Name of database: mo14017_pl-bots
UserName: mo14017_pl-bots
pass: secret :P
port: 27017
Host: mongo.ct8.pl
ok
since you use the default port you dont need to define it
ok
mo14017_pl-bots:<password>@mongo.ct8.pl/mo14017_pl-bots
ok @lusty quest i really need ur help now i tried everything that i could but couldnt solve it
ok?
ok
Super brain it keeps on sending message i am gonna cry
it sends same msg 5 times
idk why tf
Should I use a SQLite DB or MongoDB?
Use this, or that host?
if(cry) dont();
;-;
remove all event listeners (comment them out) and then enable them one by one until you get mutiple messages. if it happens at the first idk i would guess a bug in the Package
@faint prism depends. Tim got SQLite pretty good optimized but if you want to access it via a API use Mongo
ok
Are you directly modifying your production code? @delicate shore
wym
@faint prism depends. Tim got SQLite pretty good optimized but if you want to access it via a API use Mongo
@lusty quest I was trying to use SQLite, and I setup a data access layer/context, but I'm getting a dependancy (missing DLL) on publishing. Unfortunately
You should look into Unit Tests
wired. your error auger
Unit testing my commands is awesome
should i regenrate token
it may be a bug
because in between it stopped
then again started
Unable to load shared library 'SQLite.Interop.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libSQLite.Interop.dll: cannot open shared object file: No such file or directory
running on Ubuntu (arm64). Only happens when reading/writing to SQLite db
(node:57133) UnhandledPromiseRejectionWarning: MongoParseError: Invalid connection string
[Python] [discord.py] I have a long docstring for one of my commands and to make it more readable, I obviously use line breaks. However, it causes issues with the default help command adding a line break in a weird location. ```python
@commands.command(brief="Shuts down the bot")
async def shutdown(self, context: commands.Context):
"""The shutdown command shuts down the bot by disconnecting from Discord and closing all processes. It may
take a few seconds to complete the shutdown."""
@finite nimbus did you added mongo:// infront?
😭
and mongodb+srv:// if it is a cluster
will my friends will still get the badge
if he is in your team he will get the badge. but beware currently all team members get Administrator Permission -> they can leak tokens etc
i have automates roled for particular channel, members will get roles by sending some message.
i want to stop giving roles as soon as role is given to 20 members, how can i do that?
Connected to the database on mongo://mo14017_pl-bots:pass/mo14017_pl-bots
[2020-08-03 16:26:23] Uncaught Promise Error:
[2020-08-03 16:26:23] FetchError: request to https://discordapp.com/api/v7/gateway/bot failed, reason: Hostname/IP does not match certificate's altnames: Host: discordapp.com. is not in the cert's altnames: DNS:ct8.pl, DNS:forum.ct8.pl, DNS:moa.ct8.pl, DNS:panel.ct8.pl, DNS:pga.ct8.pl, DNS:pma.ct8.pl, DNS:poczta.ct8.pl, DNS:repo.ct8.pl, DNS:s1.ct8.pl, DNS:stats.ct8.pl, DNS:www.ct8.pl
[2020-08-03 16:26:23] at RequestHandler.execute (/usr/home/Weberowsky/domains/polish-bots.ga/public_html/node_modules/discord.js/src/rest/RequestHandler.js:107:21)
[2020-08-03 16:26:23] at processTicksAndRejections (internal/process/task_queues.js:97:5)
count the amount of roles given
add a loop and let it count to 20
count the amount of roles given
@blazing portal roles given means?
add a loop and let it count to 20
@lusty quest it's set for on_message
how can i set it on loop
then add a counter to your add role function
how? can u explain?
then idk
Also basic py
just tell me the logic, i will make it
create a variable, increment it everytime a role is given...
await message.add_reaction(":white_check_mark:")
count + = 1```
willit work?
role is given by on_reaction
yo @lusty quest does this makes sense
so eventually we have to give 20 reactions
testitandsee
i still dont download random files from Discord
nice token leak
I think there's an IP in there as well
yep
idk wait until someone on the package discord answers. if they dont look for a other package
idk wait until someone on the package discord answers. if they dont look for a other package
@lusty quest
Any suggestions?
I want features like echo
And etc which they were giving
what is the problem?
how do i send a message to a specific channelID?
you dont want those logs?
what library
he has a yt api wrapper but some events are called mutiple times in a row
try and see
k
if you get a error make sure the channel is cached
channels are always cached in regular djs
^
-botinfo @hallow rain
491769129318088714
Statbot
3472
Server stats bot ★Dashboard, graphs, insights ★Channel counters w/ member counter, role online, clocks, statistics ★Roles using serverstats
Other
s?
5972
186
70000 Servers | 70 Shards
@marble junco
@south cliff
@storm oak
One message removed from a suspended account.
Ah yes sorry i'm failed
what bitrate would u guys recommend for a bot playing music
depends. default to lowest and add medium to high as a premium feature
thats 192kbs its fine
automated blacklistingggggggggg https://cdn.yxridev.com/u/UwFxnh4M.png
if (!message.guild.me.hasPermission("SEND_MESSAGES")) return message.author.send('Please give me permissions to send messages.').catch(err => {bot.channels.cache.get('739833622814654497').send('test')})
I do dis but still it shows that missing permissions error
so you leave every guild with more than 30 Bots?
@lusty quest is it too much or not enough
its fine
I am searching for 24/7 free hosting.
No heroku, or glitch.
if they have less then 100 members yes @lusty quest
you could partition the collection instead of filtering it twice
spend the money you use for discord nitro on a vps @finite nimbus
You could filter it once
there aint no good free hosting except from trials
Then use the minus operator on the collection size
spend the money you use for discord nitro on a vps @finite nimbus
@earnest phoenix I have discord nitro, because i win a giveaway
Though, to have less than 100 non-bot members and to have 30+ bots could return some false positives
how many bots is too many
30 is a lot of bots for a server with less then 100 members
@finite nimbus if you got a Credit Card Amazon AWS offers 1 year free
99 members and 30 bots, for example. I typically handle a lot of bots just by having a little warning message in a logging channel, but if it needs to be fully automatic, that should be fine for now (because it won't work if the member count is over 100, could use some division).
maybe a dynamic one would be better.
anyone know how to parse stuff like 1d, 1h, 1m and so on
@misty sigil you can do it with ms
oh noice
ms(thing, { long: true })```
thats how you do it
all the things are on https://www.npmjs.com/package/ms
Yxri did you forget to leave the guild
.catch(err => {bot.channels.cache.get('739833622814654497').send('test')}) this just gives me an unhandled rejection error
wont it blacklist the server again if someone uses a command? or did you got a second field in your database to prevent it
(if you appealed)
i suppose it would just keep blacklisting them over and over
i might have to add a blacklist bypass field to my database
add a field with whitelist and check it before executing the blacklist
yeah i know that
what's wrong here??
async def on_member_update(before, after):
if len(before.roles) < len(after.roles):
new_role = next(role for role in after.roles if role not in before.roles)
if new_role.name in ('3PM IDP'):
global count1
count1 += 1
print("count1 updated")```
@obtuse jolt what’s your bot ?
-bots
awesome!
But what does it do?
well when ive finished it, it will scan any files and links sent in the chat automatically and delete them if they're suspicious
well ive added alot of error handling so instead of crashing it just spams the console like heck
Oh
you too
nice the bot page of your bot is broken in Tor based browsers YxriDev
eek
wait nvm its my Pihole i guess
I tried to install pihole on my gateway
It tried to take it over
Like chill out lol I have other uses for my router device than running your random stuff like a DHCP client
I wonder why my bot is so popular and I have not released it yet it has 700+ servers XD
If you set it up as public bot, you released it
the bot just has one fact thing where one of the random messages is an invite link XD
Ohhhh
well its not released its in beta and it will be technically released when I get accepted on top.gg
Oops wrong quote
Lol
I wonder why my bot is so popular and I have not released it yet it has 700+ servers XD
@harsh moon How? It needs to be verified before it can pass more than 100 guilds?
nope
its not required yet
I have not verifed it
it will be soon
I plan to verify it soon
you should probably do it quick
How do you verify it?
you do it in the developers dashboard
OOP
I need to do one last thing before I verify it and that is make the two commands that I have not released yet have the data encrypted

im trying to get my bot verified
What are the two commands?
its so slow
I use node.js
32 guilds
and other
if everything works i could add it to a Guild with about 10k users, maybe there are some tech savy enought to add the bot
S8 Software
if i enable partials and receive an event for, say, a message deletion in a guild, and the guild is cached (as all guilds are) is it safe to assume that message.guild.id is defined? or no. using discord.js
I changed the prefix from ! to ? but now Avrae won’t work on my server.
Coding softwares are better than the dashboard in my opinion
@oak thorn what software do you use?
how do i select the font color in canvas
What software?
I am using “Avrae”, the dice bot, on our Discord server and tried to change the prefix from <!> to <?> and now the bot is not responding.
Hi does anyone know how you get if someone has nitro? Discord.js
How can I see in how many guilds my bot is connected to a voice channel?
while sharded
keep track of it yourself
@sterile minnow you can't
i'm pretty sure you can
Well yes but you'd need to go through auth
ouf

in the discord developer portal on your bot page
Discord will send you a DM
i am in team group so whole group will get the developer badge @summer torrent
yes
Anyone having that shitty "Ref" module error?
where like every single thing fails to compile?
its annoying and because of it i cant install like any module anymore
Hi is there a way to make my bot restart automatically if it crashes ?
D.js v12 have nitro boost event?
yes iirc
@cobalt eagle you can use a process manager like pm2

@quaint hound and if i wanna do it on a raspberry pi ? (linux arm)
nvm i'm dumb
it's not a software
member.roles.cache.map(r => `${r}`).join(', ')```how to make it ignore everyone role
and yes i defined member
filter(role => role.id !== message.guild.id).map()
NEED HELP i use the botghost website and i need help with the following github url servers this bot is in ? whats that ?
yess
lol help with botghost???
"servers this bot is in" are servers you can provide to further "advertise" your bot. Please note, that these servers have to be on the discord server list (on top.gg)
format: serverid1, serverid2, ...
for example 264445053596991498, 613425648685547541
or 256988924390408193, 648230713690292224, 620221720569053185 you get the point
@olive narwhal
im not a coder for a living im only 14
there are coders that are underage on here
15*
ok
but
aw man i realy wanted to add my own discord bot, i cant now i even paid 99 dollers
Oye got a stupid question. How do i get a property with a hyphen again? This is to access the property, but the parser isnt interpreting it the way i'd like
did someone here worked with chart.js and canvas? i try to make a dynamic config (the amount of datasets varies) the config i logs seems to be valid but the charts that are getting rendered are empty http://node0.s8s.app/XHUX
thats just node.js showing it that way
'
if you print it as string, it wont show like this
nah its sending the wrong header
JSON.stringify(json)
its ACTUALLY sending quotation
its not
i know its not
it may look like it, but it doesnt send that header
it sends a stringified version of that json, that would look like this
{"Prop1": "some value","prop2":"Some other value","prop3":["maybe","even","an","array"]}
so js 'Client-ID' will become ```js
"Client-ID"
@opal plank
const reactions = message.reactions.cache;
let array = [];
let datasetValue = [];
await reactions.forEach(async reaction=>
array.push(reaction.count)
);
for (var j = 0; j < array.length; j++) {
datasetValue[j] = [
{
label: `Option ${j+1}`,
data: array[j],
// The color of the line (the same as the fill color with full opacity)
borderColor: "rgb(61,148,192)",
// Fill the line with color
fill: true,
// Blue color and low opacity
backgroundColor: getRandomColor()
}];
}
console.log(datasetValue);
const configuration ={
type: "horizontalBar",
data: {
labels: data.options,
datasets: datasetValue
},
options
};
``` does someone know why the configuration is invalid? -> Canvas always empty with no data
and since Client wasnt defined, it showed that error
this then ?
yes
you can take the " quotes too if you want
wont make a difference
@NMW003
@summer torrent
https://discord-logs.js.org/ i just check this
Boost and unboost same event?
I don't think so
@earnest phoenix ty
out of curiosity, no one would know the answer for this, right?
https://stackoverflow.com/questions/63120042/vsc-debugger-console-logging-raw-objects
My debugger after i ported to Typescript somehow is logging my objects and responses as Raw view instead of the object explorer.
The way its usually displayed is like the following:
https://cdn.
its quite a hassle being shown this in the debugger
JSON.stringify 
@earnest phoenix idk
Is it possible with CSS to tell the difference between a PC and a mobile phone? I would like to change the location of some elements on the page of my bot and I'm afraid that the elements I will move will have a different display on mobile phone.
VSC has the Object Explorer for that reason constantin
Though for some reason it isnt working on my debug session
Should be displayed like this instead than the above
when i start my bot it comes online and goes offline and thats whats happening for 30 minutes now
i also restarted whole process but no change
so i thought maybe my vps is bad
so i tried in my pc and same thing happens
@heavy marsh message.author.fetchFlags().then(console.log)
ooh
Getting errors @plucky harness ?
can some1 help?
you should use user.flags if available
no
if not, then you fetch it
i was running bot earlier just restarted it
UserFlags { bitfield: 131328 }
But how to get the names like - DISCORD_EMPLOYEE
@plucky harness Its obviously ur code
Put two & two together
VPS is.. Bad? But local machine also has the same issue?

@earnest phoenix the codes running fine for 2 months now and also not showing error?
UserFlags { bitfield: 131328 }But how to get the names like -
DISCORD_EMPLOYEE
@heavy marsh use .toArray()
Then you are error handling wrong, or ur code is borked
Maybe a breaking change in the library you are using
¯_(ツ)_/¯
@earnest phoenix Worked thanks
Np
AttributeError: 'ConnectionState' object has no attribute '_ready_state'
getting this error
Hi 😄
props.help.aliases.forEach(alias => {
^
TypeError: Cannot read property 'forEach' of undefined
```I keep getting this TypeError 🙂 any ideas on how to fix it?
Props.help.aliases is undefined
Wow!
can someone explain me why chart.js only Takes arrays and not array[0] ?
is it in your ready event?
wait a bit
setPresence acecepts an object, not a string
not yet
ok thanks
i dont get how chart.js work. if i use a array inside of a array i can only display one dataset from the array. if i set in 2 datasets the same index in the array it displays both arrays but with the same data index
What are you talking about!?
Who codes in discord.py
@earnest phoenix setstatus
Is there a library which is able to get voice activity from the voice channels?
Quick question for any Javascript people
if (request.headers.get("cf-connecting-ip") !== "xx.xxx.xxx.xxx")
{
// Return modified response.
return new Response(maintPage, {
headers: modifiedHeaders
})
}
How would I go about changing this to check 2 IPs instead of just the single IP?
Iterate though a collection
&&
@lusty quest i think i get it.
https://www.chartjs.org/docs/latest/#creating-a-chart
labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange']
data: [12, 19, 3, 5, 2, 3]
red: 12
blue: 19
yellow: 3
if (request.headers.get("cf-connecting-ip") !== "xx.xxx.xxx.xxx" && "xx.xxx.xxx.xxx")
As such? @restive furnace
request.headers.get("cf-connecting-ip") !== "xx.xxx.xxx.xxx" || request.headers.get("cf-connecting-ip") !== "xx.xxx.xxx.xxx"
you probably mean || or, otherwise if the first is true, so is the second
^
Tysvm
@earnest phoenix You said you were able to retrieve voice data from voice channels with C#. I'm using JDA right now and they are saying that is not documented on discord api so they don't have that neither. Was it documented in the C# library?

@opaque seal implemented in discord.net however not documented how to use it
it's just a Stream though which you can call ReadAsync and you get back an array of bytes
I wish Discord had an official .NET library
@bot.command()
@commands.has_permissions(kick_members = True)
async def kick(ctx, member : discord.Member, *, reason = "No Reason Provided"):
await member.send(f'You Have Been Kicked from the {ctx.guild.name}, Because: ' + reason)
embed = discord.Embed(title=f'{ctx.guild.name}', color=0xF04E3F)
embed.add_field(name='Kicked Name:', value=member.name + (f" has been kicked from {ctx.guild.name} "), inline = False)
embed.set_footer(text='Shero', icon_url='https://cdn.discordapp.com/avatars/739120780960333906/3ede301ee4216557dbec102209ed1a18.png?size=256')
embed.set_thumbnail(url=member.avatar_url)
await ctx.send(embed=embed)
await member.kick(reason=reason)
await ctx.message.add_reaction('✅')```
my kick command is not working
please help
debug it
errors..?
Breakpoints and check values in variables
yeah, breakpoints are the best thing to debug
gl
@opaque seal implemented in discord.net however not documented how to use it
@earnest phoenix So I guess it's the same with JDA
so messageReactionAdd works for starboard system right?
just "reverse-engineer" jda's source or smth
that's a lot of work
jda should be using native java types though
you should be able to see the return type
and then how to consume it
Can someone help me with https://pastebin.com/qBtu5xgh, no errors are being printed, not sure whats wrong
I'm trying to get a link out of a message when a reaction is put onto it
fine ig
the docs are really good for this type of stuff
Can someone help me with https://pastebin.com/qBtu5xgh, no errors are being printed, not sure whats wrong
@gritty bolt
ty
@solemn latch yea i get slowly to it to get it work with a single array for the data
so whats the issue?
@gritty bolt are you trying to get reactions on messages sent before your bot started?
.... i want to throw my NAS rn out of the window
yes
use partials
how to check if an element is in an array?
or im trying to get reactions that were put onto a message that was sent before the bot was made
but the reaction is put on after it joineds
Array.isArray() @tight plinth
I mean
ah it's includes
ty
I've been testing that code on messages that were sent after the bot came online and it doesn't work then either
const badges = {
"DISCORD_EMPLOYEE": "",
"DISCORD_PARTNER": "",
"HYPESQUAD_EVENTS": "",
"BUGHUNTER_LEVEL_1": "",
"HOUSE_BRAVERY": "",
"HOUSE_BRILLIANCE": "",
"HOUSE_BALANCE": "",
"EARLY_SUPPORTER": "",
"TEAM_USER": "",
"BUGHUNTER_LEVEL_2": "",
"VERIFIED_BOT": "",
"VERIFIED_DEVELOPER": ""
};
${badges[member.user.flags.toArray().join(" ")]}
``` - It comes as undifined when the user has more than one. How can I fix this?
you're joining them
double check your isuri isnt just rejecting everything @gritty bolt
so if a user has flag1 and flag2, your code is doing badges[flag1,flag2]
which is not a valid object key
also, i think you might be feeding in everything after the url
for example
hi mom https://top.gg/api/docs wee woo wee woo
if this runs through the function
youd be sending
https://top.gg/api/docs wee woo wee woo
into the isuri function
maybe splitting by space might be the best?
let link = reaction.message.content.split("https://", "http://")[1]
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split
oh so splitting until a space?
yeah, just grabbing everything before the first space, after the link starts
so say my bot sends this 3 ⭐ | #channel, how would i get it to read that number?
reading the number from your bots messages?
or from the reactions from the messages?
the message yea
how do I split until a space
ssh into it @pure lion
like how do I put a space into those ""s
just yeet the code into the ftp
Okay got it
Ssh where
the ip of the vps
Ok cool
how do I split until a space @solemn latch
i really like bitvise for ssh and sftp
oh thanks
i used putty for starts
What's root?
just the root user
the main user
the sudo dude
its the admin user of linux really
trying to run bot and its going offline and online for a while now
I'm cumfused
root, is the admin account of your vps
Where can I find that?
const b = member.user.flags.toArray();
const ds = b.map(e => e.toString());
${badges[ds.join(' ')]}
Linked to this - #development message
find root?
Ye
root is default
better hope root's password isn't default though
""""he""""
lmao
it
nah root is a he
Is it literally root@ip
or youraccount@ip
Is that why #! <-- is called a shebang?
yes
I'm so confused
quick question: Is there a way for a bot to say what the next song is playing inside a voice chat?
Jeremy what did you type in
@quartz kindle - #development message Will this be wrong
do you have your vps's ip?
Now type tree /
And it filled <my fucking name>@ip
🤔
oh wait, tree isn't a default package, nvm
Try top
i need help
you're using cmd?
That's my favorite command
TypeError: Cannot read property 'forEach' of undefined
Damn, beat me to it
you cant use .forEach on undefined things
gz
you're using cmd?
Ye
lmao same
you cant use .forEach on undefined things
@solemn latch wdym?
command.aliases is undefined
alias.set that's what you want.
Not client.aliases.set
so what i have to do?
🤔
what
Lookup lambda syntax
It passes in an alias object foreach one in aliases
so you can directly interact with it
.forEach is the lamda shorthand for a proper foreach loop (at least it is in C#. JS might only do it that way idk)
is this not djs?
anyway, you can just have command.aliases set for every command to an array, populated or unpopulated.
or check if command.aliases is defined before foreaching aliases
@heavy marsh very wrong
const b = member.user.flags.toArray();
const ds = b.map(e => e.toString());
const b = member.user.flags.toArray();
const ds = b.map(e => badges[e]);
``` - @quartz kindle got it thanks 🙂
how do i send messages like embeds that include variables from an event to another shard (please ping me) - discord.js v11
yeah but when i broadcast it, it says that they're undefined
oh i can't believe i forgot to add that
i have a client event that sends a message when my bot joins a new guild, but it only works if the guild is in the same shard as the support server
i looked up some solutions and the closest one i could find had the embed being made inside of the broadcast, using outside variables
but it still didn't work for me
how do i do that?
lib?
discord.js v11
@lusty quest u here?






