#development
1 messages · Page 1631 of 1
ok I misunderstood you a bit, I thought you wanted to have a DHCP server on your windows 10 home PC
what exactly do you want to do
You would need to have a fair understanding of Networking, and Subnets.
Although, I would recommend using programs like Wirehsark, or ASA Systems to get into Networking

Even ESXI is good, for netting VMs or vRacks.
hmm, yes, I am aware of tools like those, but I would like to understand the architecture behind it
Idk if it would help, but you can install Wireshark and filter for those DHCP packets
you do have to pull your ethernet cable and re-plug it, while wireshark is running, for your client to send a DHCPDISCOVER as far as I know
That would be a lot to explain to someone over Discord. You should probably take classes for Certs
yes, yes, I know, but at least one thing that I am not understand by reading all of those network subjects.. they always talk about servers
DMZ servers, DHCP servers, DNS servers
but they aint servers like a vps one, since they do not have a distro, but a firemware?
I guess to simplify: The server knows which IP addresses are not used and assigns the client an IP within the specified DHCP range
the client, when you plug it in, sends out a request which gets picked up by the server
^^
the server sends you back the informations which your client will use: Your IP, subnet mask, gateway. Etc.
"dhcp server" in that context is just a software which runs on anything
your router most likely runs linux in the background
so it would be the linux implementation of the dhcp server
that is closer to what I wanted to know
how to access that "linux" distro? all I can see is the firmeware 👀
if you want to inspect the packets you can use the Wireshark method, but the basic functionality was explained here
Routers are very locked down, unless you buy one that was specifically made for you to access it
you only can access your router's webinterface with those basic settings
This is mine. I can only activate and deactive it through the checkbox.
Then I have to define from where to where it can assign IP addresses. In my example from 10.0.0.20 to 10.0.0.200
The IP address will be valid for 10 days ("10 Tage")
-> After 10 days the IP address will be released, so it can be used again. Your device most likely will get the same address assigned after that time, unless another device is faster.
Those settings also specify a custom DNS server (1.1.1.1) in my case
hmm thanks for the answers
idk what that is but i just wanna say that looks cool 
I guess I found a way to understand the architecture of those servers
😎
Hello, can someone help me? I do a help command system that allows you to select you language with reaction emojis, but I don’t know how to do that when I react for example to English, the bot replace the embed of language selection with one that says select your type of help, games, moderation etc etc, and then the help on the language that you select.
These is the code of the help.js actually. Thank us for helping me!
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
O can give us acces to the GitHub for the full code of the bot if you needed
We don't help you code
When I try to make that the bot says another emoji selector, it give me error
And... what error?
I found the error, thank you very much

HI
Hi
hello @sudden sky
im looking for trust worthy mods ones that have good experience with bots and knows how to properly manage them
anyone up for it
I am using sort() on this array and I need to sort by the name variable
How would I do this?
nvm
actually not nvm lmao
nvm again LMAO
I finally figured it out
You pass a function and see if the X string is greater/less than Y
Need a mixture of JS and Java help
I've setup a listener and a socket connection on my java app using OkHttp
I'm trying to use websockets to communicate between my java app and a web page
It connects fine (as far as I can tell, it at least doesn't say it didnt connect)
But JS does a fuckoboingo and says it can't connect
const socket = new WebSocket("wss://tempobot.local/player");
socket.onmessage = function(event) {
console.log(event.data);
}
``` that's literally all I have for the JS part
And for the java bit
this.webSocket = Bot.HTTP_CLIENT.newWebSocket(new Request.Builder().url(websocketUrl).build(), new WebPlayerListener());
so does it connect or not? and do you require heartbeats?
It doesn't, and I don't
what is websocketUrl?
do websockets support X.local?
I tried localhost too
Still didn't like it
also tried localhost with a port
both 80 and 443

Why don't u use official socket lib?
Never had issues with it
For js I recommend reconnecting-websocket lib
Yep
this is going on a rendered html page tho, so idk if it behaves differently? never used node on a web page lol
No, it's always backend
why is my eslint using spaces for some files, and tabs for others..
https://i.callumdev.pw/oa3gn.png
https://i.callumdev.pw/tcklu.png
https://i.callumdev.pw/x7yc1.png
Frondend needs to fetch data from node backend
in permission_overwrites for a channel whats the difference between allow/deny and new_allow/new_deny
it's like the before and after context
but no docs seem to mention it?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
i was thinking new_* were 64 bit masks where they planned to put new stuff
lol

check the indentation for the file with the spaces
make sure it's set to tabs and 4 instead of spaces and 2 or tabs and 2
ctrl + shift + p > indent
Hello guys
What is the Invalid body in here
for (const mod of module) {
embed.addField(`${mod.name}`, mod.cmds.map(x => `\`${x}\``).join("** . **"));
}
It should tell you in the error message.
Maybe it's too long or doesn't have any text.
Here's the magic
The field value is too long.
Aka ```js
mod.cmds.map(x => \${x}``).join("** . **")
You'll want to cap how much content you present in the string. You could use .substring(start, end), but that could look weird in the middle of your map joining.
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring
The substring() method returns the part of the
string between the start and end indexes, or to the end of the string.
Are there any events for discord.js that include the member that moved the bot (ie, dragged them between voice channels)?
If there are no events, what would the best method be to retrieve this information? Audit logs?
hmm
is there a bot that sends messages with more than 1 page
Like you know when you ask for help for a bot, there are sometimes pages in the documentation
is there a bot that can do that kind of documentation?
If you are making documentation for your own bot, I would probably have it be part of your own bot, not reliant on another bot's features.
oh ok
i mean this feature*
You can use the message.edit() method to "change pages" after detecting the emission of message:messageReactionAdd I believe.
That's probably how most do it. You could also just use the help command for your bot with an argument for the page number to display.
ie, !help 2
Any documentation or guide about how to do image editing in python. Like canvas in js
One message removed from a suspended account.
could i get some help yall
@commands.command(name='flipcoin', aliases=['coinflip'])
async def _flip(self, ctx, side, amount):
otcm = random.choices('heads', 'tails')
if otcm == side:
async with aiosqlite.connect('/home/pi/Documents/Central_Communications/database/economy.db') as db:
cursor = await db.execute(f"SELECT money FROM economy WHERE user_id = {ctx.author.id}")
currentbalance = await cursor.fetchone()
await db.execute(f"UPDATE economy SET money = money + {amount} WHERE user_id = {ctx.author.id}")
print(f'Gave {ctx.author} {amount} K-Bucks')
await db.commit()
print('Saved!')
pass
embed=discord.Embed(
type='rich',
colour=discord.Color.dark_green(),
description=f'''{ctx.author.mention}'s Guess: {side}
Result: {otcm}
{ctx.author.mention} won {amount} :kbucks:K-Bucks!'''
)
embed.set_author(name=ctx.author, icon_url=str(ctx.author.avatar_url))
embed.set_footer(text="Developed by LIPD Productions Inc.#1205", icon_url=str(ctx.guild.icon_url))
embed.timestamp=datetime.datetime.utcnow()
Can someone tell me why the lost embed is firing even though I won?
@earnest phoenix If you’re typing for me, I already fixed it
Weird, choices method returns a list, and that's not how you random choose something either. Also why was it capitalized Heads and Tails when you don't call capitalize method whatsoever?
Well kekw
It was choices that was issue, had to use choice instead
¯_(ツ)_/¯
VoiceStatusChanged event
Can't find that in the doc
What class is it a part of?
additionally, does it include the user that dragged the owner of the voicestate?
You can find it out
I can't find it in the doc
Is it different from voiceStateUpdate?
I cannot find a voiceStatusChanged
Its the same
Then that's not what I'm looking for.
voiceStateUpdate has the user that got updated in oldState.member and newState.member
I realize this
how would I know who dragged the bot though?
It also happens when the bot is dragged
Wait
if there isn't a way to find out who dragged the bot from the voiceStateUpdate event, then would I use the audit logs?
Yes you can
to which part
is there a way to find the user who dragged the bot using voiceStateUpdate? or are you saying I can use the audit logs?
okay
You can get if the bot was disconnected using VoiceStateUpdate
I know
But why do you want to know who dragged ?
the bot isn't being dragged to the user's voice channel
Using viewAuditLogs permission for a music bot is lame
yo has anyone used the ffmpeg library before
is it possible to play two tracks at once
in the same vc ofc
Maybe this will help
You can use discord-ytdl-core for custom ffmpeg arguments
Forgot to mention, you had better type hint amount to int or use your own converter or use prepared statement to secure stuff as you're taking arbitrary input from users.
Parse it to integer
if(command === "ban") {
if(!message.member.hasPermission("BAN_MEMBERS")) return message.reply("Sorry, you don't have permissions to use this!");
let member = message.mentions.members.first(); if(!member) return message.reply("Please mention a valid member of this server");
if(!member.bannable) return message.reply("I cannot ban this user! Do they have a higher role? Do I have ban permissions?");
let reason = args.slice(1).join(' ');
if(!reason) reason = "No reason provided";
await member.ban(reason) .catch(error => message.reply(`Sorry ${message.author} I couldn't ban because of : ${error}`));
message.reply(`${member.user.tag} has been banned by ${message.author.tag} because: ${reason}`);
}```
Can anyone help me why this code is not working for me?
What part of it doesn't work?
I tested it but it is telling DISCORD_API_ERROR
What's the response
Wait a min
Sorry I couldn't ban because of : DiscordAPIError: Invalid Form Body
DICT_TYPE_CONVERT: Only dictionaries may be used in a DictType
Maybe the error => part?
That's the only point in the code you're calling a dict type
Idk djs
Hm ok
someone had the same problem yesterday and it was a pain to help them understand what objects were
Oh
reason needs to be an object containing the reason property, not just a string

Ohok
Ok
let reason = args.join(" ")```
change it into an object
lets see if this becomes the same incident as b4
I'm always watching. I was dying from the last day.
guys, why is this method not working
how are we supposed to know
I’m watching too and if it does i fucking swear
Hey
I have a problem to my event
When my bot joins/leaves a server, I have informations to my server:
const Discord = require('discord.js')
const { MessageEmbed } = require('discord.js')
const logsChannel = '815953311614107709'
module.exports = async (client, message) => {
client.on('guildCreate', (guild) => {
client.channels.cache.get(logsChannel).send(
new MessageEmbed()
.setTitle(`Omg, je viens de rejoindre un nouveau serveur !`)
.addField(`Serveur`, `${guild.name}`)
.addField(`Nombre de membres`, `${guild.memberCount}`)
.addField(`Fondateur`, `<@${guild.owner.id}>`)
.setFooter(`Je suis actuellement sur ${client.guilds.cache.size} serveurs !`)
.setTimestamp()
.setColor("GREEN")
)
})
client.on('guildDelete', (guild) => {
client.channels.cache.get(logsChannel).send(
new MessageEmbed()
.setTitle(`Oh nan, je viens de quitter un serveur :/`)
.addField(`Serveur`, `${guild.name}`)
.addField(`Nombre de membres`, `${guild.memberCount}`)
.addField(`Fondateur`, `<@${guild.owner.id}>`)
.setFooter(`Je suis actuellement sur ${client.guilds.cache.size} serveurs !`)
.setTimestamp()
.setColor("RED")
)
})}
But the bot dosen't send the embed to the channel
errors ?
any error in the console
module exports client.on?
module.exports = async guild => {
I need to change what?
Hi guys
why do i get this error?
Error: Unknown authentication strategy "discord"
i m using passport and passport-discord
How can i find a script running forever?
For my discord bot?
I have a discord.js foldier , an index.js and a package.json
?????
How can i find a script running forever?
To host a Discord bot you need a machine
A VPS (Virtual Private Server) is probably what you want, but it's not free
if you want to host in your pc just don t close the terminal
if you have a vps
you need module pm2
or any process manager
yea
I cant let a pc open so many hours
How can i find a free host?
Heroku is a host?
but it s a bit hard to setup
otherwise dont have a bot running 24/7 
But i want a free host running my bot forever

you cant
We all want free hosts, but that doesn't mean they will exist
pick one:
- free
- run forever
It's either free or good
servers cost like nothing
a free host
but
is like a trial
so eh
if you're sure it's worth it
buy it
cuz they are not so cheap
GOOD servers dont cost nothing
you get what you pay for, pay $3-4 for a server, get pants amounts of ram, contention on cpu cycles and disk iops with other people, crammed onto a hosting platform with half a million other vm's, sharing a small number of ips where if someone else gets their ip banned, so do you.
for bots they cost nothing
imho you have to pay at least $10 a month to start getting anything anywhere near acceptable, and that's pushing it
bots in the end use basically nothing resource wise unless the bot is rather large
because some of the really cheap vps dont even give you your own ipv4
kinda a shame speaking of ipv4 and ipv6
idk why you're telling us this
perty much
never. ever. leak. a. token.
if youre trying to make some lame honeypot, generate a correct-looking token by pattern that isnt real
pytorch updated now non of my nets work 
man you're asking this without any context, would you like us to read your mind?
this
i just got this error
what is the stack trace
when i go to login page
@modest maple having fun in here?
js
const router = require('express').Router();
const passport = require('passport');
router.get('/', passport.authenticate('discord', {
failureRedirect: '/',
successRedirect: '/dashboard'
}));
module.exports = router;
that s the code
i reinstalled all my modules
and i got this error
so what are you on about
until I reinstalled my modules
well according to passport.js there is no extension module called passport-discord that's supported
im assuming you have all this setup?
how do i match with "s in regex strings in rust
like you would anything else?
yep
r"^""
~ string ends here
why didnt i think of that
remove the r
pensive
since char
a regex string is an instance of a struct goose
so just pass that to the constructor....
it doesn't magically change the behavior of the language
We aint macros
mine is like this
You aint macro but yer definitely rusty
so what are you saying 
oops
nice client secret
I cant do my bot online forever with a command?
something has to run the code forever....
As the others said. The only way to keep your bot online is by having your PC running at all times, or using a server
Your bot's code needs to be running for the bot to be online. So you need a machine that runs your bot's code 24/7
What is 24/7?(sorry a
I dont now a lot at coding)
Is it free?
There are free hosts, but none of them will be any good. Like we said before
Is an other free solve for this problem without a pc opened all the time?
There is no way to keep your bot online without a machine that runs your bot's code. End of story
Is botghost good
no
Keep in mind that using a VPS usually requires a little knowledge with Linux. But it's not too hard to find a tutorial
Ok thnx
@quartz kindle i need your php knowledge
this is what my page is supposed to look like http://cdn.yxri.dev/u/102016050321.png
but when I add more than 1 domain record to my account it does this http://cdn.yxri.dev/u/102055050321.png
http://cdn.yxri.dev/u/102115050321.png
http://cdn.yxri.dev/u/102131050321.png
(it cuts off the bottom part of the page, signifying theres an error, but i dont have any logs of what the error is)
still broken
I also tried removing the null from the redirect column but nothing changed http://cdn.yxri.dev/u/102533050321.png
what about the long line
which one
the one thats going offscreen
oh
Youre echoing a very long line
Hello all,
I am programming in Java with JDA. Have more of a refactoring question. I want to optimize my checking for permissions and have the executing class throw the MissingPermissionException and catch it in the calling class. The problem is that when I throw an exception myself, I can only pass the missing permission as a string and then messily fetch the permission as a permission object in a map with that string.
is there a better way?
Ye but cant see if the tags are properly closed
What was it?
That doesnt show the actual issue
i know, but that's all it's logging 😐
the functions cannot be inside of the foreach loop, instead I fixed it by putting them above the loop like this http://cdn.yxri.dev/u/105411050321.png
Well, you have an unhandled promise rejection somewhere, you will have to find it
A promise you didnt catch
i know the area, it's just weird that only the host server im using doesn't like it
like it works fine in vs
it's only in the commands that I use the Hypixel API so ill just investigate
my god
yea
ty
Savior
mhm
Does anyone know how to retrieve current client's shard ID ?
I have a error:
module.exports = async (client, channel) => {
if (channel.type !== 'text') return;
const mutedRole = channel.guild.roles.cache.find((role) => role.name === 'Muted');
channel.updateOverwrites(mutedRole, {
'SEND_MESSAGES': false,
'ADD_REACTIONS': false,
'SPEAK': false
});
}
``` For my event
Its for if a channel is created, the bot set permissions for the muted role
but
updateOverwrites is not a function
:/
So I update to updateOverwritesOptions?
wha
but, it says unsupported format
message: "Failed to load because no supported source was found."
name: "NotSupportedError"```
and what is the format?
it's mp3
I am pretty sure
url is https://translate.google.com/translate_tts?ie=UTF-8&q=Hello.&tl=en-US&total=1&idx=0&textlen=6&client=tw-ob&prev=input&ttsspeed=1
oh i'm dumb, works thx

works for me lul
what does the network tab show
what does this mean
it says not found
doesn't work for me on w3schools either
What is the using of Presence intent ?
google charge for everything
make your own 
;-;
google's gay?
yes
Can the case occur that Discord fires a GuildJoinEvent and an UnavailalbleGuildJoinEvent of the identical Guild?
Because im adding the guildID on join to my DB to save the guilds prefix and would throw an error when i try to add an entry with an identical ID
Adjust your query and add the ON DUPLICATE KEY structure and your issue is gone, if it ever appears
yeah i added a check for that now
even that case would be extremely unlikely, but you dont know 
Added a check? You mean an extra query of the db if the server already exists? That’s inefficient just to say.
if (guildCollection.find(Filters.eq("_id", guildID)).first() != null) {
return;
}
Document newGuild = new Document();
newGuild.append("_id", guildID)
.append("prefix", Config.get("PREFIX"));
guildCollection.insertOne(newGuild);
i mean im using mongo with java
so if there is a more efficient way, sure 
Oh ok can’t help you with that
for sure mongo has a insertIfNotExists thing
much more efficient than finding then inserting
const collector = this.message.createReactionCollector(condition);
collector.on('collect',(reaction,user) => this._handleReaction(reaction,user));
collector.on('remove',(reaction,user) => this._handleReaction(reaction,user));```
this is my code... the collector does not run the _handleReaction function on reaction remove
how can I solve this ?
anyone ?
use replaceOne with the upsert option set to true
do you get any errors? where is the _handleReaction function defined, what did you attach it to
that's the kind of data we need to help you
{dispose: true}
you can just pass the function directly to the collector without wrapping it in an arrow function
my hands are freezing, jeez
In discord.py.
When I want to add the Server name into the json file, what is the command?
I mean the id of the guild is [str(guild.id)]
And for the name is [str(guild.name)] or what?
Oh, thanks
My function breaks it that way
you can pass it directly if you bind it
I use this.properties in the function which get broken
because it thinks the properties are of the ReactionCollector class
and not of my class
you need to bind it
Is there any kind of guide for beginners in discord.js
Other than the discord.js guide?
There's https://discordjs.guide/ and also https://anidiots.guide/
Thnx
how ?
if you are using as class, func.bind(className)
ok
Thanks!
Is there any documentation for mongoDB
literally first search result
it should be common sense that things as big and known as mongo db have a documentation somewhere
Btw.
If I would want to mention a user in the guildMemberAdd event.
do I do it like this?
<@member.user.id>
member.mention works too
or was it member.user- I feel like d.js just wants to feel extra
use member.toString() or `${member}`
Aight!
also works for roles, channels, users, and everything that has a mention
Happy to understand documentations finally! 😂
okay
How do I do this in embed ?
That thing is not an image
The shardID and Shard ping thing ?
Be unique and creative, don't copy paste designs 
I meant the table
Cuz as much as I know Discord don't allow tables in md
^
bruh
(How can I put a frigging box in Embed
with text in it
the text just happens to contain unicode symbols that resemble a table layout
oooohhhh
thanks

thanks for pointing my thanks
Box-drawing characters, also known as line-drawing characters, are a form of semigraphics widely used in text user interfaces to draw various geometric frames and boxes. Box-drawing characters typically only work well with monospaced fonts. In graphical user interfaces, these characters are much less useful as it is more simple and appropriate t...
thanks (already bookmarked the link)
.setDescription(server.joinMessage
.replace("{member}", member)
.replace("{member_name}", member.user.username)
.replace("{member_tag}", member.user.tag)
)
I guess this will be pain to edit in every message. I tried putting it in json files like this.
{
"{member}": "member"
}
But that will make me more lost.
Is there a faster way to do this?
The message server.joinMessage will contain those {} and I want to replace those with the actual code, but I don't want to do them in every single file and update them for all. Is there a way to use json for this?
short answer: yes but I don't recomment writing to a file that often, I'd rather store it in a global variable or something like that
how would i use a reactionCollector to collect 3 emojis from 3 seperate users and then log those user IDs
because im pretty sure it only prints 1 user ID instead of the 3
show your code, it should log the user that reacted, so it should log all 3 users
well nevermind its my internet
anyone know how to fix this
and btw the reaction wasnt saving for some reason
refreshed discord and it worked
What do you mean?
wait, how do i make it so the bot reacts then it adds user
cause right now it makes the author react
const filter = (reaction, user) => {
return reaction.emoji.name === 'check' && user.id === message.author.id;
};```
ah nevermind ill just await and have it react to msg
i guess
Cheers.
Send help
(Note that I don't actually need help with development. I know what I'm doing. Just, this is painful)
even me without proper js knowledge, i can tell that looks painful
im a fake dev. I do python, so anything that isn't almost plain english looks confusing to me :))
Writing a postgresql orm of sorts which is just a glorified statement maker. Not actually an orm since it can't do complex statements. This just supports singular query statement making or statements from multiple calls queued in a buffer and then joined together after a timeout has been reached in order to reduce calls
message.channel.send('Heist!').then(testmsg => {
testmsg.react("✅");
const filter = () => true;
const collector = testmsg.createReactionCollector(filter);
collector.on('collect', (reaction, user) => {
console.log(`${user.id} reacted!`);
});```
how do i make it stop when the reactions hit 3, and ignoring the bot's intial reaction
so 4 reactions in total, 3 excluding the bot's reaction
max: 3 probably but i dont know how to exclude the bot's reaction
after i collect 3 user id's, i check each of their balances,
then they can heist a user and they each get a portion of the targeted user's bank
who knows python3? I have Linux mints, I want to make a bot for my server in discord
look into the filter options on the docs. It comes with the ability to filter with the reaction and also the user in order to affect the max
me
do you have linux?
what version of python3
default
Ok
i got that part, i dont know how to exclude the bot's user ID when the collector ends
When the collector ends, it's done. There is no more collection
Yeah, that's the point
When it ends,
I want it to remove the bot's user ID from an array
Array.splice
splice is mutative
oh
i forgot 1
alr
i did if(array.includes('id'))
then the splice
but it doesnt seem to work
nvm
ty
hi
kinda development related - does the topgg api count under this question?
when i try and run resize2fs on the root mounted partition, it says that my filesystem is already x blocks long
however i have a large unassigned partition that i need to merge with my fs
not sure what to do, i cant resize root in gparted or fdisk
we don't know what interaction is
Hi can anybody help me with that?
i want to get the access token with the following code but...
let data = {
'client_id': 'secret',
'client_secret': 'secret',
'grant_type': 'authorization_code',
'code': req.query.code,
'redirect_uri': "http://localhost:3000/redirect",
'scope': 'identify'
}
request('https://discordapp.com/api/oauth2/token', {
method: 'POST',
json: true,
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}, (err, data, body) => {
if (err) { return console.log(err); }
console.log(body);
})```
It's return :
```js
{
error: 'unsupported_grant_type',
error_description: 'Grant type None is not supported'
}
But it's all correct...
interaction is the slash commands "INTERACTION_CREATE"
oh right
what do?
try interaction.user i guess
remember that you can always look at the discord API docs and discord.js docs for help
doesn't work
what library are you using?
doing that only bruh, and then group dms attracted my attention
discord.js
interaction.member.user?
let me try
https://discord.com/developers/docs/interactions/slash-commands#receiving-an-interaction the doc ref is here btw
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
doesn't work
does it say undefined?
yes
try console logging interaction
that's something different dice
i am doing that only
that's solely for slash commands
console logging
i thought they were doing slash commands
Hello, how do you configure that of the webhoock?
we are talking about slash commands
poopy
ok
oh boy
first time using ts just to make types xD... does this look correct ?
why are you using constructors and not types
interface
i thought you needed to use the lowercase types
just to make types for my package
nah
YEEEEEEEE
if he's defining types then
good job
anyway
oh this is rust
btw are the types correct ?
tias
Hi, how can i do my bot's status like this ; Racing On ~blabla~ race
U can't set it to racing
I did saw it from a bot
what lang and what lib, and, yes, u can't set a custom activity type
Idk if custom statuses are available for bots
@pale vessel nerd help
using custom status. What programming language are you writing your bot in?
.js
great, are you using discord.js?
yes
thanks 🙏
needs to be inside an event like ready() or a message event or whatever
0/10 TS sucks
@umbral zealot I didnt understand how can i do it.
bah who cares about types... I am ditching those
I am not English, I cant understand English well.
I did cant understand the page
She. literally. gave. you. the. docs.
client.user.setActivity() and inside that, the options. The options are documented.
Where is the docs ?
I did cant find it
It even has an example
can u take a ss?
pensive
@umbral zealot :(
a giveaway command but when I want to launch the giveaway
ok so type it in
I have errors to giveawaysmanager.start
I'm not going to spoonfeed you an answer, meshy, it's super easy to understand, considering there's literally an example right there on the page
I do'nt think the problem is the page.
Thanks.
damn thats quite some hindsight
im really sorry
ill see myself to the door
so i ask again because nobody responded:
when i try and run resize2fs on the root mounted partition (uwuntu), it says that my filesystem is already x blocks long
i wanna make it bigger because i have a large unused partition that i want to merge with root
or just expand root which i currently cant do in gparted
ive checked through everything online but nothing seems to work
pain
I did find, but You could just say I had to write
what is this meaning? how can i receive
Hey, I have a problem
I have this command:
https://hatebin.com/tmaeykjshd
a giveaway command but when I want to launch the giveaway, I have errors to giveawaysmanager.start
You can't set custom status for a bot
They're saying that CUSTOM_STATUS is only used for users' presences
god
Dice ignored?
Well this isn't #operatingsystems it's #programming , it's not like we Windows users can help a linux user that doesn't know how to use their OS 😛
Aren't Linux users supposed to be the geekiest of geeks that can google anything? lol
We have no idea what giveawaysManager is so we can't really help you unless you tell us
or show us
i would've helped dice if i knew the answer to their problem
go make the bot goddamit
I don't have a problem directly, but would like to post a code snippet to maybe spot bad code practices or get comments on how to implement something better, is this channel for something like this too?
go on lad
Maybe. Maybe not. can't guarantee it but there's no harm in trying, Timme
In Discord's Developer ToS section 2 part a, it states that I need a privacy policy that "clearly and accurately describes to users of your API Client what user information you collect and how you use and share such information with Discord and third parties."
What does "collect" and "user information" mean in this context? Does user information mean any kind of information I obtain (for example, the user running a message) and does it have to be information that's stored to be counted as "collected"?
Though, by experience, the best you'll get is "Your code is shit, bruh"
anything that isnt provided by discord
I'll help if its JS 
ids, basically
"user information" means anything the user has generated or given to Discord. That includes Usernames, avatars, nicknames, custom statuses, messages, etc.
message ids, guild ids, channel ids, user ids, all that isnt collected
Yeah basically discsord's IDs and timestamps are the only thing that's not user information 
Okay, but what would "collect" also mean in this context?
message content, nicknames, guild names, channel names, all that is user data
those should be noted if you're saving them
busy making my lang
Say your bot requires you to store a Discord ID linked to some other information, you need to tell the user you are storing it and for what purpose
technically memory isnt permanent, so, if you dont restart ur bot, technically bypasses the required for "storing" it
also i already have a bot thing i just need to delete all the commands 
so console logs for example dont fall into storing
The ID is not end-user information so no.
oh bet
@Override
public void execute(CommandContext ctx) throws PermissionException {
if (!IDatabase.INSTANCE.isUserInDB(ctx.getAuthorID())) {
ctx.getChannel().sendMessage(" You don't own an alpaca, use **" + ctx.getPrefix() + "init** first").queue();
return;
}
final long sleepCooldown = IDatabase.INSTANCE.getCooldown(ctx.getAuthorID(), "sleep") - System.currentTimeMillis();
if (sleepCooldown > 0) {
ctx.getChannel().sendMessage(" Your alpaca already sleeps").queue();
return;
}
final int energy = IDatabase.INSTANCE.getAlpacaValues(ctx.getAuthorID(), "energy");
if (energy == 100) {
ctx.getChannel().sendMessage(" The energy of your alpaca is already at the maximum").queue();
return;
}
try {
final int duration = Integer.parseInt(ctx.getArgs().get(0));
if (duration > 120) {
ctx.getChannel().sendMessage("The sleep duration must not exceed 120 minutes").queue();
return;
}
final int newEnergy = energy + duration / 2 > 100 ? 100 - energy : duration / 2;
final long cooldown = System.currentTimeMillis() + 1000L * 60 * 2 * newEnergy;
IDatabase.INSTANCE.setAlpacaValues(ctx.getAuthorID(), "energy", newEnergy);
IDatabase.INSTANCE.setCooldown(ctx.getAuthorID(), "sleep", cooldown);
ctx.getChannel().sendMessage("\uD83D\uDCA4 Your alpaca goes to bed for **" + newEnergy * 2 + "** minutes and rests well **Energy + " + newEnergy + "**").queue();
} catch (IndexOutOfBoundsException | NumberFormatException error) {
ctx.getChannel().sendMessage(":x: Couldn't resolve the sleep duration").queue();
}
}
so this is my typical approach 
Count me out that's not javascript. though it sure as hell looks close enough to it. LOL
Thank you guys for the explanation :)
because it is java 
ik
java
i meant as in: i cant tell you if its bad or not

jaca
cuz i dont juva
wanna see
no horni, staph it
syntax pls
one bit
let foo<Type> = Bar;
yeah i try to avoid deeply nested functions
fn foo<Type>(args<T>,) -> T {}
I literally wasted an hour investigating why my API doesn't work when I reverse-proxy it via nginx
Nothing is more fun than trying to find an error 5 functions deep
:o
oh also i stole am using the pipe operator
turns out I hadn't whitelisted the domain in my google devs console cause I'm using google captcha... half of my endpoints depend on it
"Foo" |> upper
I hate myself
we all make dumb mistakes
same
especially me
let iden = &input[..len]; this one line was why my entire lexer wasnt working
what if the only thing we make are mistakes and we end up drowning in booze to make coding more beareable?
too dark? sorry
not me yet
mine is not popular!!!!!!!!!!
i feel that
@gilded ice tried making a lexer before in python
it was not worth it
is it for a programming language or what
I find lexer/parser generators easier than writing my own
programming language
i wrote a very bare bones programming language in python
it was for me to understand how a lang is different than an interpreter
im writing my lexer in rust because its a dream
sounds like pain tbh
everything in rust sounds like pain
Rust is fun
I also hate coffee
ah, yes , i like scratch too
scratch is poggers
tetanus
Is a bot required to have a Terms of Service (like how a privacy policy is required) or is it just optional (since I don't see anything in the legal or policy document yet we can still set a terms of service link on the app)?
that sounds like a good question for Discord, Inc. or a lawyer ¯_(ツ)_/¯
would say depends also on your local laws, but for a verified bot you need one way to handle it
you could also ask in discord.gg/discord-developers
I'll go ask there or contact Discord if it fails
Hi, how do I make a command force a user to vote for the bot?
You should persistently store a list of users who've voted for your bot. You can then run a query to see if the user has voted or not. There's some documentation on how to receive vote updates: https://docs.top.gg/resources/voting/
let guildid = "675030984722350092";
client.shard.broadcastEval(`this.guilds.cache.get(${guildid}).name`)
.then(results => {
return message.channel.send(`Guild Name: ${results}`);
})
.catch(console.error);``` i make it this code but its not working help me pls
does it error out?
where is message defined?
hi
does the promise contain the message object?
No
cuz I'd like to get introduced in web-based game apps
well, you can make web games in pretty much any lang
I've made a pixelcanvas-like game with react
React with next.js
alright
I have a problem
In my giveaway command: https://hatebin.com/pgrfephdpp
I have errors to giveawaysmanager.start :/
this is your problem
const client = new Discord.Client()
whats the problem so
oh my
Yeah he'll learn if he reads what Tim is saying
this isn't even ignorance it's a basic lack of understanding for how the wrapper even works
He just doesn't know how to access the client
how to overwrite a photo ? like to make a "rip" command for example, to add the member avatar on the grave
You'd need something like canvas or some other image manipulation software.
^
you can also use stuff like jimp, sharp, gm, image magick, etc
for something simple like composition
image magick 
does anyone know how to make a repo-name.js.org domain in github?
as in github.io?
ye
This video will walk you step by step through creating a live website using GitHub Pages. This video is intended for people who may have experience building websites, but have not used GitHub Pages to host their website. Want to show off your beautiful website to the world? Then this is for you.
Checkout our website at http://programminglift...
well, they have pretty good docs about it no?
client.giveawaysManager.start(giveawayChannel, {
Its not defined client so
see instructions on https://js.org/ for the js.org domain
Dedicated to JavaScript and its awesome community since 2015
ye ^
Ok well where did you get the idea that this was a thing?
ok thx
did you find a code that had a giveaway manager and you thought you could just steal copy the command but not the rest of the bot?
you cant define client like that, you need to get the client you already created in your main file
you can do so in 2 ways: either pass it along the function, like execute(client,message,args,etc) or you can get it from any discord structure, like message.client
I test the message.client
message.client would definitely be the real client, yes.
read the entire instructions maybe
there's 4 steps here to follow
@earnest phoenix My DMs are not the appropriate location to continue the conversation
follow the instructions
i followed

but i dont know where and how to make a pull request and with which branches
lawl
the uptimerobot should Definitely keep it alive
yes

