#development
1 messages · Page 1234 of 1
Is there a way to make sure that if one YT API doesn't work, use another one without having to change it all the time? xD
@earnest phoenix #memes-and-media
Small question, my pc broke... and I still want to host my great bot.. but all I have is a chromebook now am I able to host on chromebooks
i mean
no replit or heroku
Can you get node on a Chromebook?
you can boot linux
Fun fact
on chrome os
Yes boot Linux pweaseeee
?
Lmfao
no its mine
@native osprey
@earnest phoenix use a try-catch statement
i suggest using that
you've had similar issues before that could be easily fixed by following a beginners guide

https://www.w3schools.com/js/ @native osprey this first
but first learn js
yes
:3
it tells you to learn js
with a bunch of links
@earnest phoenix use a try-catch statement
@pure lion How should it be? xD
try{}catch(err){err //the error object}
pog I was almost right
If you like reading bibles consider https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide
nice
yea
@spare mirage Heroku can keep your bot running on a server but has some drawbacks
first is that the free hours are limited
nvm
Thx
and also the bot goes to sleep every 30min when unused
should be fine
just register there and give it a try yourself. THen you'll see it firsthand
i wouldn't reccomend it either way though
I haven't used replit so i can't say anything
but its usable for one server
you need an uptimer for them
otherwise they will turn off
currently I'm using my old laptop to host my bot 24/7 if needed
since it's broken af and is laggy af
so if you have that option too (to use something old as a host)
then that's your best option
otherwise you'll have to accept the limits the free-hosting services provide
@spare mirage chromebook can install PyCharm, VS Code, etc... that is used to develop your bot, right?
if so - then you can use it to host your stuff.
will try
just this chromebook
@spare mirage use an azure vps. Students get $100 of credit free
With that you should be able to host anything. Compile code. And for coding, online editors would be fine
Bots can use animated stickers right?
yes, if by stickers you mean emojis
yeah emojis
const Discord = require("discord.js");
module.exports = {
name: 'vote',
category:'Misc',
async execute(message, args, client) {
const messageEmbed = new Discord.MessageEmbed()
.setDescription['vote for debbie'](["https://space-bot-list.xyz/bots/746228910743879782/vote", "https://mythicalbots.xyz/bot/746228910743879782?q=UPV"])
.setColor('RANDOM')
.setTimestamp()
message.channel.send(messageEmbed);
}
}
what am i not doing right?, or has this completely changed
TypeError: (intermediate value).setDescription.vote for debbie is not a function
at eval (eval at <anonymous> (/home/container/commands/eval.js:23:57), <anonymous>:3:47)
at /home/container/commands/eval.js:23:57
at new Promise (<anonymous>)
at Object.execute (/home/container/commands/eval.js:23:24)
at processMessage (/home/container/lemonbot.js:77:52)
at Client.<anonymous> (/home/container/lemonbot.js:56:11)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (/home/container/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
setDescription is a function. You are tying to get a vote for debbie property from it and call it.
Instead, you should call the setDescription function and pass vote for debbie as the first parameter
and the link as the second (and only the link - don't put it in an array)
has that changed tho?, cuz thats how i remember it
your desc is wrong
Nope. Your code doesn't make much sense.
ok
.setDescription('put your stuff in here')
not what i want
They want it to be a link
yes but not what i want it to look like
Warns command isn't working can anyone help me out a bit?
i don't think you can put two links in one spot
Warns command isn't working can ayone help me out a bit?
@rancid bramble https://dontasktoask.com
just like
Vote 1 > vote 1 link
Vote 2 > vote 2 link
i thought it was like how u do ids in a json
const db = require("quick.db");
module.exports = {
name: "warns",
aliases: ["warnings"],
description: "check user warns",
async run (client, message, args) {
const user = message.mentions.users.first() || message.guild.members.cache.get(args[0]) || message.author;
let warnings = db.get(`warnings_${message.guild.id}_${user.id}`);
message.channel.send(`**${user.username}** has **${warnings}** warning(s)`);
}
}```
Shows warns as null even tho user has been warned before
or add multiple things
you can link your own website and put a list?
im confused now cuz that above was posted
@rancid bramble show the warn
const db = require('quick.db');
module.exports = {
name: "warn",
description: "warn a member",
async run (client, message, args) {
if(!message.member.hasPermission("MANAGE_MESSAGES")){
return message.channel.send("You don't have the permission required to perform this command | Permission Required : Manage Messages")
}
const user = message.mentions.users.first() || message.guild.members.cache.get(args[0]);
if(!user) {return message.channel.send("Please mention a user to warn")
}
if(user.bot) { return message.channel.send("You can't warn bots")}
if(message.author.id === user.id) { return message.channel.send("You can't warn yourself")}
if(user.id === message.guild.owner.id) { return message.channel.send("You can't warn the server owner jeez")}
let reason = args.slice(1).join(" ");
if(!reason) reason = "Unspecified"
let warnings = db.get(`warnings_${message.guild.id}_${user.id}`);
if(warnings = null) {
await db.set(`warnings_${message.guild.id}_${user.id}`, 1)}
message.channel.send(`${user.username} has been warned.`)
user.send(`You were warned in ${message.guild.name} for the following reason: **${reason}**`)
}
}```
well, i can't see anything wrong off the bat, but db.add('warnings', 1) should probably be there
turns out im just a dumbass
my token didnt get leaked
my database got leaked
from an old github i had
and they created separate bots which connected to that database and recked havoc
or something like that
idrk the hell they did
anyone here with nitro wish to contribute something to society kong bot?
what?
is it possible to save login session ? to avoid message delay (during logging and redirecting to new page etc)
Heya !
I'm trying do give some permissions to a rôle in a channel and I tried with
message.channel.overwritePermissions('748231391614861433', {VIEW_CHANNEL: true, SEND_MESSAGES: true, READ_MESSAGE_HISTORY: true, ATTACH_FILES: true});
```but it returns me ```TypeError [INVALID_TYPE]: Supplied overwrites is not an Array or Collection of Permission Overwrites.```help please 
wrap 2nd param object in []?
overwritePermissions takes an array or collection of those objects.
You could use .updateOverwrite instead if you don't want to wrap it in an array.
like ? js message.channel.overwritePermissions('748231391614861433', [{VIEW_CHANNEL: true, SEND_MESSAGES: true, READ_MESSAGE_HISTORY: true, ATTACH_FILES: true}]);
try that
i dunno then..maybe try lites idea
It didn't work because the array of objects you passed couldn't be resolved to permissions. The example in the docs is a basic way of doing it: https://discord.js.org/#/docs/main/stable/class/GuildChannel?scrollTo=overwritePermissions
.updateOverwrite worked perfectly, thanks Lite !
how can i make a command me only?
check for ID
mine uses about 300gb a month
if num >= 300 && num <= 600
Discord server / website etc. that share open source code (discord.js). Do you have any suggestions?
how would u check if 2 numbers are inbetween 2 numbers? e.g
560 and 400 inbetween 300 and 600
@low orbit what xsfg5 said, but if you're using Python, you can also do something like300 <= x <= 600
Is there a way to list the powers of a member ? Except checing for each and every one in loop ?
DISCORD. Js v12
What do you mean by powers. The permissions?
Yea
How can I change the color in a console.log? (discord.js v12)
You can iterate over every guild in the <Guild>.members.cache collection. Then on the member object you receive, use the .permissions property to get an instance of their permissions.
first and third param iirc
There are many ways to check or see what permissions someone has, so the docs will probably do fine: https://discord.js.org/#/docs/main/stable/class/Permissions
@fringe axle console log is vanilla js,unrealted to d.js
@fringe axle this is how i done it https://github.com/OfficiallyLost/lostbot/blob/master/src/events/bot/ready.js#L7
I recommend the chalk library instead of hard-coding the color values.
even vsc has some plugins to allow color changing on console
@fringe axle this is how i done it https://github.com/OfficiallyLost/lostbot/blob/master/src/events/bot/ready.js#L7
@digital ibexconsole.log('\x1b[32m', oof, '\x1b[0m');
What's the color code there?
i forgot where i got the colours, i done it a while ago
i forgot where i got the colours, i done it a while ago
@digital ibex oh... okay
Thanks Google
https://gist.github.com/abritinthebay/d80eb99b2726c83feb0d97eab95206c4
@cinder patio And how can I make the text color in a different color?
how do u check how many shards your bot has?
Do you sharded already?
yes
how do i make admin commands
like ban kick warn
@somber sky read docs :))
ok
thx
nah
¯_(ツ)_/¯
well that effect 2 me 2
ta-da
@opal plank u know how to set up Embed for website

in discord
like when you get the url it gives the embed?
yes
imagine this justii
i think ace means that ^^
yes
when you get the link of a website,it embeds the contents of it
the embed
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
fuck this has been so long ago
im not finding it on my repo, this shit is too long
im asking a friend,sec
im pretty sure you can do it via the website
uh no
its a payload im pretty sure
where
OGL
Graph???
link ?
dont have,its just open graph protocol
???

hey guys
i've got a qeuestion
how do i actually send a link to google maps that is the same as the weather country.
so i have a commadn that does:
$po rain
or $po sunny
and it returns a list of countries with rainy weather. How can i add a google maps link of that country as an embed.
hmm
whats the best way to check if 2 numbers are similar?
my bad sorry
@earnest phoenix
if(parseInt(number1) === parseInt(number2))
{
//TRUE
}else {
//false
}
does "similar" mean they should be within a certain range of each other?
yes
subtract one number from another, take the absolute value of that, and see if the result is less than your specified range
ok, then calculate what the range should be before you do the check
btw u can do
return match = (something)
that's checking if the numbers are equal, not within a range of each other
they want the difference between the two numbers to be less than a certian value
take the absolute value of the differences first
anyone know how mee6 is able to use custom emojis lol
Math.abs(eloA - eloB);
lol
i learned this url from @ Cry
who made that video
idk
very cool
looks like bill wurtz esque
yeah
does anyone here know discord.py
no
nobody
@slender thistle hey.
so for some reason
pog
This doesn't work.
it gives a syntax error
name="Nitro Generator"
i tried google
bruh
think about it
it doesnt work
like
and oneday u will fix it
await client.change_presence(status=discord.Status.online,activity=discord.Streaming(name="A Bot", url=https://youtube.com))
kekw
url is string
yea ik
yea
await client.change_presence(status=discord.Status.online,activity=discord.Streaming(name="A Bot", url="https://youtube.com/"))
that works?
How do i make a bigger button
SO MAKE IT TO STRING
noob
@indigo flax yes maybe
^^
@pulsar forge style css html etc
we can't do anything with an image only.
^^
@pulsar forge
button{
width: 4000px;
height: 10000px;
}
A streaming status must be a valid Twitch URL iirc
no
@earnest phoenix and were do I put the link
someone did a yt link
button{
width: 4000000000000000px;
height: 1000111111119242304320px;
}
do that pog button
Link?
.
he didn't even say what lang
@pulsar forge u should know html to know how to make a button go to a link
just normal link tags lmao
@pulsar forge ^^ maybe
ive only been learning html for like 5 months
Im learning that y
huh
show code
@indigo flax huh ?
any1 helpp me pls
@blazing ravine btw u can do
member.flags.toArray().forEach(flag => {
flag = flag.split("_").join(" ");
return flag.toLowerCase();
})
oh thanks
™️
@misty sigil good right :))
i dont need to use const userflags ?
lets try
yes, lets
pog
wtf are u doing
return flag.toLowerCase()
just do only that
oh no
wait
let flag_result = [];
member.flags.toArray().forEach(flag => {
flag = flag.split("_").join(" ");
return flag_result.push(flag.toLowerCase());
})
if(flag_result.length == 0) flag_result == "None";
@blazing ravine ^^^
nah
;0
.addField("Flags", flag_result.join(", "), true)
Is this for every bot
@earnest phoenix wdym ?
the flaghe mean maybe
discord.js only
only for JS
"lets try" ;ddd 
Every bot in discord
bye imma sleep, if u have problem ping @ Dice he loves ping
what are you trying to do ?
msg.member
yes
message => msg
xd
i don't get it lmao
give me 1 sec
ok
@blazing ravine
yes
yes
i need help with my bot
it's the same
ye
but not work in me
@cinder fossil https://dontasktoask.com
lets see your code
huh
can you show me the code ?
are you trying to get from a member or user
1min
i still need help

my bot
ARGH
WHAT DO YOU NEED WITH YOUR BOT
1 sec
@blazing ravine try member.user.flags
what is this
.addField('**Flag:**', flag_result.join(", "), true)
1min
@misty sigil i need to get it online and also to make commands
1min
@cinder fossil bud
@cinder fossil do you know a programming language
no.
-faq 3 13
this should help @cinder fossil 
im dum i cant do anything
i m trying now ;d
@cinder fossil just read the guides
ok
where i can find the icons
userflags working only in v12
;d
ye?
maybe
where i can find the icons
just google ..
xd
use google 
i-
i cant
i see a lot of hacking and coding so idk how
showing country ;d
@cinder fossil please #rules-and-info 
its soo funny
how-
lmao
omg
you need to know a programming language
you cant just jump right in
its like jumping into the deep end at 1 year old ffs
cause idk where to start
i have to-
making a bot is this hard
im already in school school on top of that is harder
yes its this hard
its like
jumping into the deep end at 1 year old
writing a russian essay without knowing russian
i hate my life😩
it's not hard ><
eating cake without teeth
you need to learn the basics of js
huh
not js
yes then you can just read the documentation
just the language you wanna write in
i guess this is my goodbye
bye

im gonna probaly do this for like 4 years anyways
good luck
anyone know how to make a basic system like this to queue 2 people with each other that has a similar amount of points?
how do i check what badges a user has?
how do i check what badges a user has?
you can do that with flags
@blazing ravine idk let me check
he’s using py
anyone know how to make a basic system like this to queue 2 people with each other that has a similar amount of points?
@earnest phoenix search for players within a point range, if none are found, expand range
Can I use github to update my bot files and download them in the VPS everytime?
@earnest phoenix Heya, remember my issue with HttpClient NullReferenceException crap?
Seems that it's the client itself that's causing the error for some reason
~~```cs
var client = new HttpClient();
client
.DefaultRequestHeaders
.Add("Authorization",
$"{credentials.TokenType} {credentials.AccessToken}");
ASP.NET is complaining about the line with only `client`~~
Disregard this, the issue was with my custom object
:^)
Can I use github to update my bot files and download them in the VPS everytime?
@opaque seal you're describing a CICD pipeline
Continuous integration, and continuous development
Just Google GitHub Actions
@blazing ravine u know you don't have to do
const flags = {
};
hm
you don't need that
noo lmao
in footer ?
just make it emoji
you need to set it as an image in the embed
hmm
just make it emoji
or that
you need to set it as an image in the embed
you can't use it anywhere you want in the embed, just in the image field or thumbnail
so an emoji would be much better
for me, I store all the emojis in a json file
hmm
that doesn't seem good practice tbh
just modify your const status {} object
putting emoji codes in it
@blazing ravine but yes anyways, you can check if the user is boosting any server
Do you access it everytime you need them or just when the bot starts up @restive shell
for the nitro
@blazing ravine make sure the bot has access to the emoji
@blazing ravine the bot has to be in the server
oh
But you can check this to see if someone is boosting a server https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=premiumSince
yeah unfortunately
@earnest phoenix search for players within a point range, if none are found, expand range
@faint prism yh but i dont know how to work out the range from both users current elo
So imagine someone has 30 points, initially you would search for other players in the matchmaking queue within, say, 5 points (25-35). if there are zero available, increase the threshold by five more (20-40). And so on and so on until some max number
@earnest phoenix
they start at 250 elo and the matchmaking queue will stay within 100 elo so should i do like player1elo yeha idk
idk what the calculation would be for the if statement to check if they should be matched together
You mean if there are multiple results for matchmaking players within a range?
nah
idk what the calculation would be for the if statement to check if they should be matched together
@earnest phoenix you would just match them with the one that has the least difference between the player that's searching
what would the equation look like tho
if(player1elo <= player1elo - 100 && player1elo >= player1elo + 100 && player2elo <= player2elo - 100 && player2elo >= player2elo + 100) return match = true;``` @faint prism would this work ?
would this work ?
@earnest phoenix Eh not really what I had in mind
would it be possible to have a discord bot that could tell if there is a staff member in a csgo server
so like staff will have roles, and if someone has that role in any of the seervers it'l tell you
so moderators can quickly see which servers dont have any moderation atm
Idk, does csgo have public APIs? Don't think so tho
youre gonna need to use english
You'd need a lib that implements whatever the server browser does. Or the API for the server listings
But idk if you can actually find users
Without joining tbh
it doesnt seem that hard. ive seen loads of bots that advertise server playerlists
it would just need to label some as staff
it doesnt seem that hard. ive seen loads of bots that advertise server playerlists
then it's possible
Oh maybe a public API
would it be a good first discord bot project?
yeah I mean you would learn a lot probably
but it wont be easy for your first bot
I suggest discord.js to start too
Sounds unique and a bit difficult
Hello! I must get match detalis by CS GO Api. For Dota 2 this: https://api.steampowered.com/IDOTA2Match_570/GetMatchDetails/V001/?match_id=%id% How to use this for CS GO? And where is the documentation for CS GO?
Sounds unique and a bit difficult
yeah not too easy
but doable
if you have programming background obv
I really don't like Java
C#
Because c# exists
"The bot would have to hook into our player list and run a query for any player with staff perms and run that query every so often and then post an update like how are #📶welcome-servers is basically"
thats what a smart person said
c# was made to improve java
@earnest phoenix but they failed
Anyone still using Java is probably drowning in technical debt
they didn't...?
No they didn't
yes they did
so the bot would be possible
My entire company is currently transitioning from Java to c#
i can name more caveats in java than i can in c#
broo can u compile a c# program for every platform with the same file
yes
Yes
Dotnet core
no I mean if I compile the file on windows that works on windows, could I share it with mac
or linux
yes
Also it's performance is about to rival C++
how
explain
net core
what extension does it compile to
net core can publish apps as framework dependent and self contained
.exe or .dll
does that work on linux without wine?
inb4
how
yes
Since it matches the runtime for the OS
visual studio bad
I literally run my C# bot on Linux ubuntu server
It's eh, I won't argue with that lol
intellij best ide
^
Never used it
rider is made by jetbrains, next
rider is cool
It better be as cool as intellij
I'll use anything with autocomplete for an objects properties and functions tbh
On mobile
how do u edit so fast
I use c# 
give me pls
Nah
rider is made by jetbrains, next
anything made by jetbrains is noice
with .net 6 adding two way java interop i doubt there will be much use left over for java lol
why not
@earnest phoenix Because you won't get with the times and adopt C#
Rider != C#? what
idk
lol
ive coded c# and java before, just more java
now tell me
microsoft plans to rework their GUI libs too, cross platform c# gui apps, just swooping the market from java
I forgot c# was owned by microsoft
microsoft plans to rework their GUI libs too, cross platform c# gui apps, just swooping the market from java
@earnest phoenix God thank god. I hated wpf
keep in mind, the entirety of net core is open source too
java is open source
I think
since November 13, 2006, yeah
java is thebest language
debatable
Oh well, you're allowed to have a wrong opinion
Sounds like opinions
no
Unless you provide proof
any superlative is an opinion
ummm
java is cooler
@earnest phoenix define "cooler"
it's a programming language not a cooler what
its easy for retards like me
Well you got me there
have you seen the latest in #starboard ?
honestly js is probably easier for "retards"
yes but javascript is bad
ive never actually used javascript
but I think its bad
easy to start with and it's a togo if you need to write an app that "just works"
if you want performance throw interpreted languages down the bin
have you seen the latest in #starboard ?
@faint prism yes that was my whole motivation in saying java is best
Do you even know java?
Debatable™️
no
Write the main method right now
public static void main(String[] args) {
}
You pass
lol
3 billion devices
For decades
yes thats why java is the best 3 billion devices
always has been
no they just dont update it
lol someone make the meme
its prob 6 billion
no they just dont update it
@earnest phoenix it's open source
lol someone make the meme
@sonic lodge no dont
pls
@earnest phoenix it's open source
@faint prism no I meant that they dont update the numbers
adware on installation
No thanks
Explain that to my grandma
your grandma downloaded some sketchy version of java
Yeah, the official version
ive never got adware from downloading java
nah that actually happens
I don't know, when's the last time you updated Java
2 weeks ago
And the time before that?
around 1 week before that
maybe its cus I download the jdk version
not the jre
Sounds like they're trying to patch a lot of 0-days
no its just from me resetting pc
Because you're one of the 3 billion?
I see we've come full circle
Lmao alright
lol
in python
how can i do: if {var} has this word do this?
f
huh u mean
if var:
I think he's talking about string interpolation
and then u like tab
if var has {keyword)
iirc f"my {var}"
if var.contains("keyword"):
for loop
for loops are cool
so how can i do if var has 3 do this?
how can i get 2nd last message in a channel ?
thats against tos
how can i get 2nd last message in a channel ?
@cerulean salmon [length-1]
literally just write java
that'll get you started
sure, whatever
ok

does jetbrains rider have free version
Wtf is this with java and sharp
No, but there's the student pack
than*
@faint prism 😦
[length-1]
@faint prism that will give me last message
the student pack gets you that paid stuff for free
@faint prism that will give me last message
@cerulean salmon then [length-2]
i mean which method i can use @faint prism
Lenght - 1 is second last
Index 0 though
right
Depends on lang
so, the last element is length-1
let p = message.channel.messages.cache.array();
console.log(p[p.length-2]);
didn't work
Depends on lang
@opal plank are you talking about lua? lol
bro I can get 1 free domain name?!?!?!
Maybe lol
bro I can get 1 free domain name?!?!?!
@earnest phoenix.tkis free

then .ml
like I cant connect to .tk if im not on vpn
Bruh, one dollar
Sounds like your ISP sucks
Holdup

I bought domain from porkbun before
theyre pretty cool
they have cheap xyz
I dont even want a domain
lol
Fuck that cant search 5 days ago on mobile
But there are some cheapdomains for a dollar
who tf is buying ides
vim premium
@faint prism what ide do u use
VS and VSC
I'm a dotnet fanboy 🤷♂️
now you know
2020 isn't over yet
do they release at the end of the year?
Only if there is a major overhaul
ok
Well, anyone know how remove the default key shortcuts on electron?
hi asterki
UwU hi








