#development
1 messages · Page 1667 of 1
probably gonna keep the ipv6 blocks for more useful stuff tbh
seems like a waste to use on that
Well multiple applications can use it no?
indeed, but it seems a bit of a waste rn to put stuff on them yet
its not a valid reason per se
the main reason i tell you that is cuz i need to write the proxy for it
i think its a 16 or 8 block
let me check
But what block can you use?
That's ipv4
So you have 5 ips v4
usable, yes, can request more
You won't be able to do much with that
but i dont have a need for it
Fair I guess
apart from some sites im hitting annonymously
im changing the user agent
and some other stuff
so far so good
but if they catch it, rotating ip's is an option too
I mean yeah but there's only 5
they're barely catching one
Only if you correspond to the RIPE guidelines
2 would probably be more than enough
How many active players do you have
for genshin?
Being punished for telling the truth 
Before the ip is banned by YouTube
For what reason does he actually need multiple addresses?
me? i dont have a reason to
He
currently it would scale as is
since there are no api calls
i set lavalink to pull from local
I would guess if they detect a pattern they will actually ban a whole CIDR stack
They ban complete /64 IPv6 blocks yes
No matter how ban is ban
That would be funny...
Imagine all the kids watching yt and other stuff would be banned because of a single or multiple abuse
I would spam yt the whole day to fuck up all the kids out there
Which would be on the same (banned) ISP I am

Hello i have an error in my event handler, can someone help me ? :
const fs = require('fs');
module.exports = (Client, Discord) => {
const load_dir = dirs => {
const event_files = fs.readdirSync(`./events/${dirs}`).filter(file => file.endsWith('.js') );
for (const file of event_files) {
const event = require(`../events/${dirs}/${file}`);
const event_name = file.split('.')[0];
Client.on(event_name, event.bind(null, Client, Discord))
}
}
["client", "guild"].forEach(e => load_dir(e))
}
The error code is :
Client.on(event_name, event.bind(null, Client, Discord))
TypeError: event.bind is not a function
your problem is right there
How
everyone ignored you (then and now)
#development message
Try lowercase p
python
If that doesn't do it then add the python executable to PATH
Actually the error is accurate enough
bind is not a function for that data type the var is
Would be the same issue executing string.substring(); if string actually isn’t a string
Check your emails and confirm your email I think
The function or method bind expects event to be an actual function which it isn’t
It’s important to watch the data types
Try and see the example I mentioned above
Should cause the same error
let string = []; string.substring();
how can i make a role based command in discord.py?
so like you need a specific role to use it
By checking if the user actually has the required permission
public static void main(String[] args) throws LoginException {
JDABuilder.createDefault(
"BOT-TOKEN-13",
GatewayIntent.GUILD_MEMBERS,
GatewayIntent.GUILD_MESSAGES
).setActivity(Activity.playing("play.linnake.ee"))
.addEventListeners(new MessageEvent(), new Listener())
.build();
// Registreerin Eventid
}``` if anyone knows JDA, could you tell me what i'm doing wrong? the events aren't registering
did you put that code inside a class that extends an event listener like the docs show?
is it correct ?
const client = new Discord.Client({ disableRoles: true })```
yes
turns out I didn't start the queue for sending a message
but now it starts the queue
but doesn't send the message
this is the class ```java
public class MessageEvent extends ListenerAdapter
{
public void onGuildMessageReceived(@NotNull GuildMessageReceivedEvent event)
{
super.onGuildMessageReceived(event);
User user = event.getAuthor();
if(user.isBot() || event.isWebhookMessage()) {
return;
}
event.getChannel().sendTyping().queue();
event.getChannel().sendMessage("test");
String[] args = event.getMessage().getContentRaw().split("\\s+");
String raw = event.getMessage().getContentRaw();
if(raw.equalsIgnoreCase("tyra"))
{
event.getMessage().delete();
event.getChannel().sendTyping().queue();
event.getChannel().sendMessage("Ära ropenda pls");
}
}
}
So what is correct?
const client = new Discord.Client()
I want to disable roles
What do you mean by "disable roles"
In say cmd
Don't allow any mentions for the message your bot's gonna sned
Ok
you want to disable role mentions?
Yes
but keep user mentions?
I disable everyone and here.But didnt disabled roles
disableEveryone is not a thing anymore
@quartz kindle
there is disableMentions and allowedMentions
Man i am asking how to disable roles
you can try ```js
Discord.Client({
disableMentions: "all",
allowedMentions: {
parse:["users"]
}
})
but im not sure
also this will be changed completely when discord.js v13 is released
another way is to use regex on the message content
or a simple replace like this
message.content = message.content.replace("<@&", "<")
but of course that will show the role id, not the role name. you'd need to get the name by parsing the role id first
hey,im trying to do npm audit but its not working:
npm audit
npm ERR! Cannot read property '@discordjs/opus' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npm-cache/14.15.2/_logs/2021-03-23T11_35_16_737Z-debug.log
and i cant install npm packages
and when i install the pacages,it says cannot read property "some pacakge" of undifined 9 hour later when i install it
npm init does not work tho
can someone recommend some good chat ai api's ?
How to remove messages with bot?
Depends on what library and language you're using
node.js
Assuming you're using discord.js, it should just be <Message>.delete()
and of course the bot needs the manage messages permissions for it to work
if(command==='purge'){
const amount = args.join(' ');
if (!amount) return message.reply('You haven\'t given an amount of messages which should be deleted!');
if (isNaN(amount)) return message.reply('The amount parameter isn`t a number!');
if (amount > 100) return message.reply('You can`t delete more than 100 messages at once!');
if (amount < 1) return message.reply('You have to delete at least 1 message!');
message.channel.delete(amount
);```
Is it good?
Did you try it?
is someone know that problem
Also, you're trying to delete the entire channel
No, you wanted to delete a message right?
yes
use ```js
message.channel.bulkDelete()
i'm working on this app and its in JS, it currently uses an API from my own server but when I give out the app to people, people can see the IP of the API and I don't want that is there a way to "hide" the IP?
no
welcome to the internet
why do you want to hide it in the first place
very much http://xyproblem.info vibes
Asking about your attempted solution rather than your actual problem
keep the api server side
user makes request to mywebsite.com/api
your server then makes request to the api's IP address
your server gets the answer from your API, then returns the answer in mywebsite.com/api
<@&
thanks
how do I make multiple api requests at a time?
like if an api is 500ms average, and I need to make 5 requests, I will need to wait average 2.5seconds
how do I make them run simultaneously to save time?
make an array of all api call functions
and wrap it arround await Promise.all()
maybe that would work
let a = fetch('https://google.com/1');
let b = fetch('https://google.com/45');
let c = fetch('https://google.com/69');
let [x,y,z] = await Promise.all([a,b,c]);
you can add variables
you can use .map()
.map?
and wrap it around the Promise.all
Array#map
or use a for loop to make all requests
and wrap the array around Promise.all
so I need to like have the axios request inside a for loop
outside the for loop is a promise.all
nah like
the map?
let j = [];
for(let i = 10; i>0; i--){
j.push(fetch(`https://example.com/${i}`))
}
let values = await Promise.all(j)
maybe something like this
oh
check if it decreases the time
where is the new Promise ??
oh nvm fetch() is already a promise
promises are confusing
if you need the response of the request to figure out the urls of the other requests, then you need to await the first response anyway
but if you can calculate all the urls from the start, then you can request from all of them at once
I could
so j is like a promise
?
an array of promises
yes
oh ok
Promise.all() awaits them all and returns an array of all the responses
oh ok thanks
if one of them is rejected, all of them will be canceled, and Promise.all will return the error
ok thanks, btw when to use new Promise ??
if you want to continue fetching the others even if some of them fail, you can use Promise.allSettled
new Promise() creates a new promise
ok I was not wrong... it runs parallel
you only need it if whatever you're using doesnt already use promises
for example if you use a library that works with callbacks
oh
you can use new Promise to create a promise from the callback
I would suggest using node-fetch
if you like to make an asynchronus function, synchronus
it returns promises
or the other way around
no, it doesnt turn sync into async
it simplifies the use of async
for example you can combine a bunch of things inside a single promise
which will run simultaneously
you cannot make an async function sync
but you can make a sync function into async, depending on the situation
yes but an array of promises
ok
I kinda getting the hang of it
is promises really this confusing? or is it just me?
in this code... j is an array filled with promises
they are confusing at first, but very easy once you get the hang of them
auctions.push(axios(`https://api.hypixel.net/skyblock/auctions?page=${i}`).data.auctions);does this work aswell?
because of the .data.auctions
Hey all im looking for a bot that will show my recent twitch event (bits/subs/raids etc) within my discord does anyone know if there is a bot or how to make this possible? thank you
axios returns a promise, and promises don't have a data property
unless you've defined the axios function yourself
so id have to promise.all() before I do that?
make a for loop to make a new proper array with the data?
how do i escape usernames with ``
or some special characters. its messing with the bot embeds
if someone has `` in their username
the promise needs to be resolved to access their data
can someone tell some good chat bot apis ?
' '
alright
Either use .then or async/await
``
axios returns a promise, you can either resolve it immediately using await, or you can put it somewhere to resolve later,
that way you can put multiple promises in an array for example
does .then do the same thing as await?
not exactly
google said to use .then
Just discordjs its going with a bot
.then() gives you the result in a callback, if you want to do something with it that is not related to the rest of the code
or if you want to add some post-processing step
Hey all im looking for a bot that will show my recent twitch event (bits/subs/raids etc) within my discord does anyone know if there is a bot or how to make this possible? thank you
for example if you do ```js
promise1.then()
promise2.then()
but their values will be returned only inside the then as a callback
Both then and async/await serve the same purpose, async/await is just syntax sugar
so you cannot use their values together, nor in the rest of the code
their values become fully independent
you can only return the value to the current code by using await yes, and you can use Promise.all to await multiple promises at once
hello sir @quartz kindle, remember the reason why my command or event handler wasn't working, it was not because of the unnecessery stuff, it was because i was doing
const prefix = require('../config.json');
in place of
const { prefix } = require('../config.json');
and it took me 3 rewrites and 4 days to find this error out
Genius move
:)
gj
ok why does { }make everything fail?
thank sir, big fan
{ something } = bla
is the same as
something = bla.something
^
oh
b l a
that is one of the things that are fairly easy to understand but very hard to remember
you will remember it once you start using it
the best way to learn and remember something is to try implementing it in your code and see it working
you can do that after resolving all the promises
can't you just use map instead of reduce
map is confusing
everything
like this @carmine summit
let data = await Promise.all(auctions);
data = data.map(d => d.data.auctions)
map() is the easiest of the array loop features to understand.
Here, Cwickks, read this, it should become very clear! https://js.evie.dev/mid-level-data-types/awesome-array-methods#array-map
(I also have an entry on reduce in there)
yes, and it's an array of the same size as the input
Hey can someone help please
b r u h
my code is so f'n messy
how can we help if you don't tell what you need help with
I have buddy 😂 it’s just so busy
Hey all im looking for a bot that will show my recent twitch event (bits/subs/raids etc) within my discord does anyone know if there is a bot or how to make this possible? thank you
(key, value)
what is value?
maybe yapgvpgfg or something can
I'll check and be sure
second argument is the index and third is the original array
^
Thank you I’ve tried to look but can’t find anything
Hi, pls anyone tell me the mute and unmute command for bot. For Discord.js
cry is there a way to send an image in memory using DSP
it wants a file stream
so the third is like the copy of the original array?
how would i check how many servers my bot is in if im not in some of them?
yeah
when do you use that?
Hi, pls anyone tell me the mute and unmute command for bot. For Discord.js
you usually don't need it
@upper cape yagpdb can't (It can do Reddit, yt and Twitter)
I'll do a quick search (wait a minute)
then why did they put it there?
but if you want to access the original array while using .map() you can do that
just Google
why cant you just use the original array
arr.map(arr)
because sometimes you use [1,2,3].map()
Will do thank you, if there is a something that can grab a url and do it that way that could maybe help?
ah ok
i used RespondWithFileAsync
that's probably why
@upper cape I found one
It's called AprilBot (https://aprilbot.me/)
If you want more you can check https://top.gg/tag/twitch
it probably can, you just poorly implemented it
Awesome I’ll check it out thank you!
^°^
probably, but that method isn't even documented
i was talking to cwickks ;p
but anyway any other way of sending a message is deprecated, DiscordMessageBuilder is the way to go
Would be nice to see lines before and after + a error
describe your issue in more detail
"crashing" is very broad
what crashed? what was the error? where did it occur?
I have an array [["a"]["b"]["c"]]
how do I make it [a, b, c]
it was from a .map()
auctions = auctions.map((d) => d.data.auctions.item_name);
I think I ran out of ram
.flat() if you are on node 12 and up
didn't work buddy only has the going live part which i dont need but thank you tho
How to do that bot write something and after 3 second it write again?
send the message, delay for 3000 ms, send message again
Why can't you?
There's only trial and I ain't paying for shit. Can't apply for GitHub student pack either
F
why
import dbl
import discord
from discord.ext import commands, tasks
import asyncio
import logging
class TopGG(commands.Cog):
"""Handles interactions with the top.gg API"""
def __init__(self, bot):
self.bot = bot
self.token = 'dbl_token' # set this to your DBL token
self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
# The decorator below will work only on discord.py 1.1.0+
# In case your discord.py version is below that, you can use self.bot.loop.create_task(self.update_stats())
@tasks.loop(minutes=30.0)
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""
logger.info('Attempting to post server count')
try:
await self.dblpy.post_guild_count()
logger.info('Posted server count ({})'.format(self.dblpy.guild_count()))
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
# if you are not using the tasks extension, put the line below
await asyncio.sleep(1800)
@commands.Cog.listener()
async def on_dbl_vote(self, data):
logger.info('Received an upvote')
print(data)
def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(TopGG(bot))
How to get which member voted in on_dbl_vote ?
Anyone suggest me some tensorflow js tutorial
not from the official website
even videos would work
hi
Is it possible to setup a web hook to send a message in a channel when someone votes for a bot?
yes.
bot.on('guildMemberUpdate', async (oldMember, newMember) => {
const boost = new Discord.MessageEmbed()
.setTitle("Boost!")
.setDescription(newMember.user.username + `boosted the server :boost:\n ${newMember.user.username} got 50,000 coins!`)
var boostUsers = db.fetch("boostUsing")
if(boostUsers == null) boostUsers = []
for(var i = 0; i < boostUsers.length; i++){
const boostRole = db.fetch("boostrole_" + boostUsers[i])
const hadRole = oldMember.roles.cache.find(role => role.id === boostRole.id);
const hasRole = newMember.roles.cache.find(role => role.id === boostRole.id);
if (!hadRole && hasRole) {
bot.guilds.cache.get(boostUsers[i]).channels.cache.get(await db.fetch("boostchannel_" + boostUsers[i])).send(boost)
await db.add(`money_${newMember.id}`, 50000)
console.log("pog")
}
}
});
its not consoling it and not sending anything
there's the user property from data
you dont need to have .id at the end of boostRole if you are already trying to find the id through role.id .-.
what line is it?
ooo i see
let me try
theres probably other reasons why its not working 
you could just use https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=premiumSince and find out when they boost no?
as of now no
@tardy hornet are you running multiple instances?
how do I join 2 arrays? this.auctions.concat(newArray); doesn't work
concat returns a new array
These are the three main ways:
merged = Array1.concat(Array2);
merged = [...Array1, ...Array2];
Array1.push(...Array2);
First two do not modify the existing arrays
@tulip ledge
alr ty
ask em
I am getting {"error":"Unauthorized"} on accessing url f"https://top.gg/api//bots/805030662183845919/check?userId=488643992628494347" by requests python
are you using your api or the official one?
we do not have magic balls, whats you question lol?
do you use dblpy ?
no I just used python requests to access the given url
the problem is here, that the auth token is missing
instal the dblpy, it is the easiest solution
i need help with the reaction role bot please
https://cdn.discordapp.com/attachments/714045415707770900/823530404128096256/luca.png
You're in the wrong server
idk i just need help with the reaction roles
Yes, this is for Top.gg support
You clicked the wrong button
This is #development though, spax
Yeah, that's true. Still not for help with specific bots though
anyone know how to add command categories
Selects two columns from the Produto table, then groups all selected identical columns
Any difference between <@! and <@
I've never seen <@? ever
the ! means that a member with a nickname was mentioned
👍 👍 👍
\👍
@vivid fulcrum do you know a fix for this? tried everything from clearing symbols cache to clearing user data, nothing worked #development message
// Mentioning a channel
message.mentions.channels.first();
// Getting a channel name or ID
message.guild.channels.cache.find(c => c.name == args[0]) || message.guild.channels.cache.find(c => c.id == args[0]);
Is getting a channel name or ID correct?
use get() for ID search
use find for everything else
uh, reinstall vs maybe? i really don't know lol. vs became so buggy with the few latest updates
im considering switching to rider
That would take ages
isnt it possible to downgrade vs versions
SELECT Nome_Armazem, Sum(Quantidade),Tipo_Produto
From Produto, Armazem, Armazem_Produto
Where Armazem.Cod_Armazem=Armazem=_Produto.Cod_Armazem AND Produto.Cod_Produto=Armazem_Produto.Cod_Produto
GROUP BY Nome_Armazem,Tipo_Produto```
what this command does?
An inconvenient legacy, you could say
Though I'm really not sure why it was implemented in the first place
@frosty valve show a screenshot of your .env file, but without all the token written (use a blur or draw over it or whatever)
process.env
yeah no that's wrong
the name of the file should be .env
not process.env or config.env or blah.env. .env is not a file extension, it's the full name of the file.
that will just error it in VSC
yes it will
i'll try repairing, and if not reinstall
no no
no
I said the FILE NAME
you access it using process.env
the filename
not the code
the FILE is .env
the filename
i remember repairing once broke my installation even more, yes very stable software
Why is it so hard for people to just follow simple instructions
idk 🧠
Dunning-Kruger is strong in this one

For ID search, it is for roles as well not only channels?
message.guild.roles.cache.get()?
for any collection, if you're looking up via id, you should use get()
yup
imagine download 10 gb
imagine having an imagination
is anyone here good with NVM
because it isnt correctly installing any version aboutt nodejs v10
does jda have attachment upload event
it isn't a separate event
it's the same message event you use for command handling
...since it's a message
Check the docs to see if there's an attachment property on a Message instance
yeah saw
but why Condition 'event.getMessage().getAttachments() != null' is always 'true'
well
let's ignore this
did you read iz
it
the list wont be null if there arent any attachments
it will be empty
returning null lists goes against conventions in any OOP language
except C++
Null lists meaning empty lists/arrays?
nah, the value null
Interesting
As in like [null, null]?
My drunk ass should properly go focus on getting my OS back up instead of this ngl
i think he meant making methods that are supposed to return lists nullable are against conventions
this
I have an Ubuntu 16.04 VPS but no matter what NVm doesn't seem to install nodejs properly after nodejs v10.0.0 it will get to checksums matched and it will stop, nothing else, and then if u ctrl C out of it u can do node -v and it returns something but npm -v doesn't do anything,
You should check the node downloads page. Also, They may have removed downloads for specific Node versions because of a major security flaw they found
You should download the latest 10.x version
anyone have any idea why the bot is returning offline regardless of my presence?
I did, but i need a version like v12.18.2
or something, it works for other people
but not for me
Download what's recommended on nodejs.org
It's helpful if you provide the code that's not working
older versions just don't have a point unless you're working with native deps targeting a specific node ver
what is this development u speak of??
- install old version
- install nvm
- install later version through nvm
- make newer version default through nvm
- ???
- Profit!
i installed the old version with NVM
cus it was the only version that worked
i had already tried newer version
{ name: 'Preasence:', value: message.mentions.users.first().presence.status, inline: false }
it'll return offline regardless of how i use message.mentions.users.first().presence.status
are you saying you use nvm install 14.16.0 and then nvm use 14.16.0 you can't use npm???
that is extremely strange.
and then it never does anything
sounds like your OS be fucked, man.
so i tried installing through source code
and it just got stuck on one section and didnt move
16.04 is old though, maybe you should update.
ubuntu LTS is 20.04. Suffice it to say you're... a little behind
16.0.4 is old
i would if i had that option but its not my VPS it was just the VPS i was given
why wouldnt this work?
embed.image.url: Could not interpret "{}" as string.
at RequestHandler.execute (C:\Users\love_\OneDrive\Skrivbord\FoxGirl bot\node_modules\discord.js\src\rest\RequestHandler.js:154:13)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async RequestHandler.push (C:\Users\love_\OneDrive\Skrivbord\FoxGirl bot\node_modules\discord.js\src\rest\RequestHandler.js:39:14) {
method: 'post',
path: '/channels/775293747205242920/messages',
code: 50035,
httpStatus: 400
}``` (this should work, and the screenshot shows wrong, took wrong screenshot)
I've never used js, so I can't help you there. Sorry
You're confusing nodejs with ubuntu there, buddy
@urban olive you probably havent enabled intents
Show how you define hug
I did say Ubuntu 16.04 , which meant the OS version... and I did say 20.04 in almost the same sentence, there's not much room for interpretation here.
16
I just want the link that gets generated to work with .setImage, but how I generate the defining is let hug = anime.sfw("hug")
isnt that promise based?
I guess I skimmed over "Ubuntu"
ah my bad, thanks 👍
Hello, I'm working with an array from an API (the array has about 67000 indexes) but when I do .length on it it only sais 819, I even printed the data to a file and checked and there are definitly more then 67000 indexes
Is it possible that js just fucks up with huge arrays?
are there any children? arrays inside arrays? objects?
@dusky sundial
yes
does the 67k include the children?
Have you checked that the url works?
yes
no
it works
Well, for some reason your image url becomes "{}". I can't tell you why, I'm not experienced with js at all
oh, ok
One index looks like this
can you try console.logging some random index bigger than what length says?
and there's 67820 of those
Base64
like console.log(array[50000])
it gave undefined
but why is there 67820 indexes of it when I post it to the txt file?
async getAuctions(pages) {
console.log("auctions")
return new Promise(async(resolve, reject) => {
console.log(pages)
const response = await axios.get(`https://api.hypixel.net/skyblock/auctions?key=${this.apiKeys[this.currentIndex]}&page=67`);
this.calls++;
if (this.calls > 55) {
this.currentIndex = this.currentIndex > this.apiKeys.length ? 0 : this.currentIndex + 1;
this.calls = 0;
}
let data = response.data;
if (!response || !data || !data.success) reject("There was no data.")
else {
fs.writeFile("data.txt", JSON.stringify(data), () => {})
let auctions = data.auctions;
console.log(Object.keys(data))
console.log(data.auctions[2000])
console.log("length2", auctions.length)
let newArray = auctions.filter(auc => {
return auc.bin && !auc.claimed && ["RARE", "EPIC", "LEGENDARY", "MYTHIC"].includes(auc.tier) && auc.start + 24 * 60 * 60 * 1000 < Date.now();
})
this.auctions = this.auctions.concat(newArray);
};
//}
resolve(true);
});
}
Are you counting lines or entries?
apparently brython is a thing
data.auctions.length
client side python
That's char length probably
Do you want me to upload the txt file?
{"success":true,"page":67,"totalPages":68,"totalAuctions":68131,"lastUpdated":1616523140403,"auctions":[...]}
what the API returns
total auctions is always equal to the indexes in auctions
There are pages
im new how i code a bot on chromebook
Pages are chunks of the response
public static void main(String[] args) {
ExampleUtil.API.getSkyBlockAuctions(0).whenComplete((page0, throwable) -> {
if (throwable != null) {
throwable.printStackTrace();
System.exit(0);
return;
}
System.out.println(page0);
if (page0.hasNextPage()) {
ExampleUtil.API.getSkyBlockAuctions(page0.getPage() + 1).whenComplete(ExampleUtil.getTestConsumer());
} else {
System.exit(0);
}
});
ExampleUtil.await();
}
Imagine returning 68k entries
Would kill their api
Tim, My question in Astro bot support 
Imagine awaiting 68k in your bot 
Show that uuid
can u download stuff on a chromebook?
like nodejs or visual studio code
i dont know
I got a pc but its broken
if you can't u can use glitch.com to code nodejs apps
but i wouldnt use it for hosting them
mk
He can
There are tutos for node on cbook
what coding language do u wanna use first?
Installing Nodejs is an important part of getting your Chromebook up and running for Web Development. With the addition of Linux apps and…
For node
Cool, java dude
can u code discord bots with java lol idk
but not the best
i only know javascript and bit of python
If a language can make http requests then you can make bots
Just download an ide like intellij and your preferred jdk
ok
but I still dont know how to keep my bot online without being on the bots account
You'll need a vps
wdym being on the bots acc
like I cant keep it online
you need a server to keep it up
I have to be online for the bot to be online
something to host it
heroku?
Heroku for java is a nono
yeah idk 
Well, you CAN, but not for too long
what should they use for java
gtg
But I wouldn't worry about keeping it online 24/7 before you have an actual bot coded
so i have this code, which sends a text message, and then edits it to an embed
const message = await channel.send('test');
message.edit({embed: {title: 'test embed'}});
the result ends up being
Yep
how do i edit the message and get rid of the old text?
set the content to null
or an empty string
i forgot which one
or either
idk test it
My bot is has 5 shards, and sends guild join messages multiple times, and before you say it's being run multiple times, it isn't.
Any help?
Sometimes, it posts it once, but sometimes it posts it like 10 times.
Hello, in discord.js, how to check if args[2] is a mentionned role please? thx u
Using regex for example or check if the message has any mentions at all, making sure argument[1] isn't a mention
const persence = require("./src/client/persence.js");
var the = new persence()
TypeError: persence is not a constructor (its constructor tho)
can you come dm?
no, keep support here
imagine to assign 100GiB of disk space to a VM instead of wanted 1000GiB, just because you forgot a fucking 0,
building up the server, install roles, apps and libs,
start to generate a database which will require ~ 800GiB of the storage,
see the generation process stopped after 2 days,
accessing the logs and notice the disk full error,
can't stop the VM to resize the disk because of qemu limits,
rebooting the physical maschine which fucked up the qemu vhost config somehow,
need to fucking delete the whole VM and start from scratch again
That's what I would call learning by doing just because missing a fucking 0 and didn't check it twice before hitting continue
facepalm
try module.exports = your Class
it is*
whats best free way to host
host it yourself
My bot is has 5 shards, and sends guild join messages multiple times, and before you say it's being run multiple times, it isn't.
Sometimes, it posts it once, but sometimes it posts it like 10 times.
Any help?
the rest has too many catches
heroku or glitch are your best bets, but both are limited
any other way free?
heroku or glitch, but they are shit
if you have a credit card you can go aws for a year or f1 micro from google
you sure its not cause guild outtage?
How does one check such thing?
you can receive GUILD_CREATE multiple times, thats hhighly due to either your shard restarting (and hence recieveing it again) or the guild coming back from an outtage state
detritus has a .fromUnavaibale setting on it, i assume your lib should have it too
this means this event was triggered by an outtage, not my a new guild joining
"id INTEGER PRIMARY KEY AUTOINCREMENT," +
"user_id VARCHAR(20) NOT NULL," +
"coins INTEGER" + ");");```
What's wrong with this?
it's SQLite
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
https://discord.com/developers/docs/topics/gateway#guild-create this also gives more info on it @earnest phoenix
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Cheers

??????????????
this is what IDE shows me
What is that
this
or command prompt
Not sure why u creating tables on the go too
yeah
Unless you planning for a deployment bot, you shouldnt even need to create /delete tables on a whimp
Should be able to just do it in the command line mysql interface and cal it a dya
hm
yeahhhh
bad joke
Not me waiting for a response from github that I should get in the next few hours
Well, all SQL should end with ; but some libs do it for you
Like quickDB, Mongo...
QuickDB isnt a db
(The drivers do, not the command lines)
Nope they do not unless in command line
you aren't
just diffrent
mongo does not
but quickDB isnt a db
Yes, what I said.
it's document based, which has nothing to do with sql actually
completely different engines
You said "mongo does use sql syntax"
also quickDB isnt a db
3rd time is the charm
also quickDB isn't a db
lmao
quickdb isn't directly a database
It's a wrapper for one, so technically speaking you can kinda consider it one
i meant as in: its so shit it cant even be considered one, even if it was
better use the upcoming detritus db yikes 
just a really abstracted version of one
ORM is the word
but a shitty one
Which libary is the fastest and network/rma efficent lib for mongodb?
await client.connect();
const database = client.db('sample_mflix');
const movies = database.collection('movies');
// Query for a movie that has the title 'Back to the Future'
const query = { title: 'Back to the Future' };
const movie = await movies.findOne(query);
``` the findOne, does it fetch all? I mean if it index on the mongodb server?
how to measure the network usgage?
It doesn't have a built in one with the mongoose lib so you have to do it yourself
can you find many?
Yes
You should look at the driver's docs
.find()
from discord.ext import commands
client = commands.Bot(command_prefix="prefix")
@client.event
async def on_ready():
print("Bot Connected")
@client.event
async def on_message(message):
if message.author.id == 712027036511633429:
await message.delete()```
I need my bot to turn on and do the message so basically I need to add my token in somewhere which I will hide but in which line should I put my token in
if I search after a certain key, if its index it on my server or on the mongodb server
Documentation for mongodb
Indexes are always in the mongodb server
your server only makes the requests
const query = { title: 'Back to the Future' };
const movie = await movies.find(query);
console.log(movie) //Returns array of movies found
Whats the capital protocol of the dedicated process? I keep getting a error that says that it read unusable memory
what
what does that mean
I think my Linux install has terminalated early
jebać naleśnika
Or the memory has executed a harmful task
I tried to do ls in a Linux terminal
On a vps
How do I get them to fix the install, if thats the probelm
TypeError: Cannot read property 'cmdPrefix' of undefined
I get this error each time and my bot shuts down when I first run k!(default prefix). But when i restart it the server gets cached in the db and the bot works w default prefix. How do i make it so that it doesnt shut down and just goes to default prefix unless setprefix is run..
mysql btw
Whats the max find() limit on mongodb?
alright
result[0] ?!
isnt it result.cmdPrefix?
Just check if result[0] is not undefined then access it's property, if not assign a default prefix
(result[0] || {}).cmdPrefix || 'Your default prefix'```
tysm it worked i been stuck on this ;-;
👍
It makes me sad that old versions of node don't have let var = value ?? value
Nullish coalencing (??) and the optional chaining (?.) operators are only available in Node.js v14 and higher, it's not a bad thing since Node.js v14 is now the stable version (LTS)
Oh ok
I think https://www.repl.it still uses v13
Repl uses v12
Ohhh
is it possible with js and canvas to overlay a static png image on a gif?
Thanks
\`
@cinder patio I can't add this while putting it in \${author.username} this will throw an error right?
Lul
In js, it'll throw an error I think
Hey, question how long does it take to approve my bot on dashboard?
I tried user \username\ before
That's a question for #support, and 2 weeks approximately
Oof, ok thank you

in d.js v12
I have a sharing manger let say in x.js
And my bot file is v.js
And I have events on an event folder
So on event ready ...
I want to run a special something lets say
I want to check if all the shards are ready before running this.
How can I check this?
Idk about python specifically but usually symbols can’t start with a number in a bunch of other languages
I would assume python is the same
@unreal estuary It's discord.py?
thats a syntax rules
with any language
you cannot have a number starting the name
Ok
There’re only experts in here 
"experts"

Sorry, I do need this once a day
lmao
Can anyone pls tell me the mute and unmute command
So maybe one of you guys have a good idea
so i want to refactor my emotes into variables, because most of the bot messages contains them and the whole string with emotename and id is so long, but i didnt came up with a good implementation. i thought about enums or maybe a map but i didnt turned out to be actually shorter. (so im coding in java)
enum would be the way to go
public enum Emotes {
APPROVE(""),
DECLINE("");
private final String emoteID;
Emotes(String emoteID) {
this.emoteID = emoteID;
}
public String getEmote() {
return emoteID;
}
}
so that was my implementation
but i mean the call itself is Emotes.APPROVE.getEmote() which isnt really shorter than just typing the String, could be there a better way?
you can override the toString method to return the emoteID
that'll help you omit the last chained getter
so you can just use Emotes.APPROVE
oh nice, because thats what i want to achieve, thanks ill look into that
use toString
like cry said
if (args.isEmpty() || args.size() < 2) {
channel.sendMessage(Emote.DECLINE + " Missing arguments").queue();
return;
}
Yay now thats better, thanks 
yeah i miss that :c
im coding in c# at work and its smooth
i mean i could use String.format with %s and all that shit but thats not really better
String.format 🚪 🚶♀️
you should NOT do this at all
this is privacy breach my dude
why the heck you creating invites in all ur guilds?
"".formatted()
What can I do for my send notification of tw i don't know how?
what
Yk
TS is great
Don't get me wrong
But sometimes the things it yells at me about

I swear if it makes me install another types into my dev depends
how do I copy text by just clicking a link?
just like hastebin
but it automatically copies to clipboard once you enter the site
@opal plank I'm still struggling to figure out what's wrong after reading the docs you posted above: https://discordapp.com/channels/264445053596991498/272764566411149314/823998763110367272
I've realised that each event gets triggered multiple times in Shard 0
anyone know how I can merge 2 interfaces in typescript
I have an imported interface that I wanna merge with mine
idk how to
lol
a guild is only in a single shard, if its a specific guild failing, it might be ur shard reconnecting or the guild is unavaiable
||Don't use typescript in the first hand||
https://www.google.com/amp/s/www.digitalocean.com/community/tutorials/typescript-interface-declaration-merging.amp
@marble juniper ^
when a command is used, it registers it multiple times.
I get this doe
lol
I need to merge an import decleration
with the local one
not a local one with a local one
Try extends... I have never used ts tho
Or try this lol -> https://stackoverflow.com/questions/49723173/merge-two-interfaces
@marble juniper
fun problem with my bot
i cant change its name or pfp through the dev portal
it just doesnt update and i dont see a way to do it in the docs so is there a way
Thats not possible
it is
wym not possible
gotta be a way to change the name
cos i changed its profile pic in the dev portal like a month ago and it still hasnt updated
Try again
ive done it several times over a month











