#development
1 messages · Page 1876 of 1
And if i add it i can enable this
member.activity requires presence intents
add a cmd which tracks member statuses or activities
why do u need to enable it tho
I need
member intent it is
If i dont why this doesnt work
did u enable the member intents
bruh
Member Intent¶
Whether you want to track user updates such as usernames, avatars, discriminators, etc.
Lemme tell you again
Member intents = ✅
Presence intents = ❌
My code include
client.user.username
when the intents
Presence = ✅
Members = ✅
NO ERROR
but if
presence = ❌
cannot read property of name undefined
hmmmmm
🤔
if u want it so bad just add a tiny cmd which includes member.activity or member.status
user=discord.Member
user.activities[0].name
My problem discord doesnt lemme activate this intent
random noob question, has the discord api implemented already a gif api or would i have to implement a specific api myself to my bot? Im using c# so i need proper c# documentation. ive seen the giphydotnet one but it may be outdated.
Is it ok if a bot is hosted in NY and the database server in Frankfurt?
well yes
but that is
not the most optimal thing in the world
especially if you're doing alot of DB queries
don't most databases have replica sets in different regions
yes but multiregion replication isn't as simple as picking a random replica to read from
guys how do i know what permissions the bot is missing?
for banning a user or kicking are those perms required?
Yes
then ban or kick perms
its just my bots name and that servers channel id and stuff
if you knew WHERE it happened why didn't u just check those 2?
Note that you have to check if the user has a role above you too
no cause thats not my server lol
yeas i have added that condition already
const { Permissions } = require("discord.js");
if (!message.channel.permissionsFor(message.guild.me).has([Permissions.FLAGS.VIEW_CHANNEL, Permissions.FLAGS.SEND_MESSAGES, Permissions.FLAGS.EMBED_LINKS])) return;
then how u know it happened when banning or kicking?
Check for this.
because it console logged they error which includes guildmember.kick
read it carefully
if you knew WHERE it happened why didn't u just check those 2?
where as in "where in the code"
Jeez (nuts) djs permission checking is so much better now
if it happened in ban/kick command it obviously is missing ban/kick perms
then how u know it happened when banning or kicking?
goddamn
are those required for banning and kicking users?
did u read the error?
it says in the console log
Most likely..
the path can tell you which request exactly it failed at
there is no reason to hide the path
then u know EXACTLY where it happened: during kick
that's what I was talking about
if you knew it errored during kick -> bot is missing kick perms
no but it has a condition check for those perms
then it is hierarchy error
checking for perms is not enough
you have to check if your bot's role is above them as well
wait can kick members be a different permission for specific channel?
since you cant kick members with a higher role
already have a condition for that
debugging is no guessing game
E - happened during kick
S1 - bot has no perm
S2 - bot is below the target
you just make a checklist and eliminate options
whats this?
e = error
s1 = solution 1
s2 = solution 2
also, member objects have a kickable property which you can check
also whats this?
if(!member.kickable) return
target is above the bot
oh damn
nice
thanks for that
is their a same property for ban?
in terms of roles?
u r a legend
thnxx
just to be sure this should also work right?
!message.member.kickable
for the event messageCreate
instead of just member.kickable
i did check with the docs
@quartz kindle
message does have the member property
it do
just note, message.member is the person who sent it
@worthy cloud bro
so cool bro
@woeful pike Since you're a moddum now
You better do the mod tings
I gotchu homie
Proud
anyone good at physics? I thin k I fucked up my gravety formula
forceX = 0
forceY = 0
for planet in planets:
distance = get_distance((player.get_position()[0] + 25, player.get_position()[1] + 35), (planet.get_position()[0] + (planet.get_radius() / 2), planet.get_position()[1] + (planet.get_radius() / 2)))
# Planet.radius * 0.05 is planets mass
forceX += (planet.get_radius() * 0.05 * (planet.get_position()[0] + (planet.get_radius() / 2) - player.get_position()[0] + 25)) / distance
forceY += (planet.get_radius() * 0.05 * (planet.get_position()[1] + (planet.get_radius() / 2) - player.get_position()[1] + + 35)) / distance
delta_time = (frame_time_in_seconds / 1000) * 60
player.set_velocity(player.velocity_x + forceX * delta_time, player.velocity_y + forceY * delta_time)
player.update(delta_time)
the player seems to be orbitting relative to the edge of the planet instead of the center
eh, wtf
Lol
What u trying to do here
radius is already half the diameter
y are u dividing by 2
create a vector to move the player into a direction based on the gravitational strengths of the planets
oh$
also, save commonly acessed values in variables
Yeah I prob should
pX = planet.get_position()[0]
pY = planet.get_position()[1]
This was kinda hard to read ngl
still gives me the same issue
also ngl I cant remember much of my gravity physics classes but
Why u adding + 25 to player position
I dont think thats how you work out acceleration due to gravity
And + 35
to get the center of the player
Its not acceleration though its force right?
woops typo
Fg = GM1M2/r^2
yes and that translates to a acceleration due to gravity
Oh
and yes it is acceleration
ok so, let's first start sanitizing that so we can understand better the code
vigint make a player.get_center_pos()
so we can reduce that code
how did u get 35?
player model is fixed at 70?
then u have the dimensions
Yea
yes
(frame_time_in_seconds / 1000) * 60
frame_time_in_seconds / 60_000
btw, why divide seconds by 1000?
then u multiply by 1000
oh
seconds to millis is s * 1000
fuck I'm brainless
lul
alright so now the player is not on screen anymore
# In the player class
def get_center_pos(self):
return [self.get_position()[0] + 25, self.get_position()[1] + 35]
# In the game loop
forceX = 0
forceY = 0
for planet in planets:
distance = get_distance((player.get_center_pos()[0], player.get_center_pos()[1]), (planet.get_position()[0] + planet.get_radius(), planet.get_position()[1] + planet.get_radius()))
forceX += (planet.get_radius() * 0.05 * (planet.get_position()[0] + (planet.get_radius() / 2) - player.get_position()[0] + 25)) / distance*distance
forceY += (planet.get_radius() * 0.05 * (planet.get_position()[1] + (planet.get_radius() / 2) - player.get_position()[1] + 35)) / distance*distance
delta_time = (frame_time_in_seconds * 1000) * 60
player.set_velocity(player.velocity_x + forceX * delta_time, player.velocity_y + forceY * delta_time)
player.update(delta_time)
u don't need parens in delta time formula btw, and can be multiplied by 60_000 directly
ok, let's see distance
def get_distance(obj1, obj2):
return sqrt((obj2[0] - obj1[0]) * (obj2[0] - obj1[0]) + (obj2[1] - obj1[1]) * (obj2[1] - obj1[1]))
why the _ in 60_000?
_ can be used in values to separate thousands
it has no actual effect other than aesthetics
save planet coordinates to variables so you don't access it everytime
right
wait, ur getting the bottom right coordinate of the planet
am I ?
pX + radius = right
pY + radius = bottom
oh
or are the planet coordinates focused on top left?
Now we have this:
forceX = 0
forceY = 0
for planet in planets:
distance = get_distance(player.get_center_pos(), planet.get_center_pos())
forceX += (planet.get_radius() * 0.05 * (planet.get_center_pos()[0] - player.get_center_pos()[0])) / distance*distance
forceY += (planet.get_radius() * 0.05 * (planet.get_center_pos()[1] - player.get_center_pos()[1])) / distance*distance
delta_time = frame_time_in_seconds * 60_000
player.set_velocity(player.velocity_x + forceX * delta_time, player.velocity_y + forceY * delta_time)
player.update(delta_time)
what does 0.05 represents?
the radius * 0.05 is just what I do to get a mass
so the bigger the planet is
the heavier it is
really?
nice
indeed
sometimes reducing the code solves weird issues
I noticed
was probably something regarding planet center or get_distance args
probably
no
I am finally getting coding in school but I'm already ahead of my class (not that good at python tho but still far ahead of my class) and my teacher just gave me the task to make a puzzle game, and some time ago I saw a video of some guy who made a puzzle game where you have to navigate a space guy through space by placing planets
that's what I'm making
if u have enough ram you can use virtual device
diff
ty'
yw
you could also try unity, it does run in c# but shouldn't be that hard to port
all you'll need is to draw ur assets and make a shitton of levels with varying challenges
I'd say ur concept is good enough to be on par with candy crush or angry birds
well
it's not mine
someone else made it
for a game jam
i think
I'm just recreating it in python
but use the "place planets" idea and make something unique
idk, I was thinking abt something where you gotta move the player to the exit (a ship for example) while dodging hazards
that is kinda what he made
that by placing planets or other objects to change its path
oh
nvm then
but still, make it just for the sake of making
I will
you said you wanted to learn unity, use it as practice
another question tho
the character seems to be moving like it should but it kinda just goes straight to the planet
instead of "curving"
gravity is the inverse square of distance
so, now in english pls? 🙂
nvm, noticed the / dist * dist
is it just falling to the planet?
maybe the planets are too small to properly apply real gravity falloff
it is going in an elliptic way "around" the center of the planet
but it's like
really small
like the width
is really small
try changing the mass modifier
usually the arc is defined by the angle of attack
yeah, keep in mind I'm still a 15 yo student
I don't understand anything of that sentence x)
I have a feeling it has to do with the velocity
uhuh definitly
angle of attack is the angle between the player's direction and the planet
I just put the standard velocity values back to y 0 x 0 so he doesn't start with movement
like, lemme find a gif for that
and he just goes straight at the planet
wdym?
it does start moving from anywhere
it's just that it moves straight at it
and I want it to curve too
if you get what I mean
like a meteor
entering space's orbit
like, let's say you have a bowling ball in one corner of the universe and you are on the other corner
it curves
that because, even though you are extremely away, gravity will still affect you and the ball
I just have to give the character a starting x velocity
now it's going around the planet
ye, that'll solve it
if you want stable orbit u just need to find out the planet's escape velocity and stay below it
it stays in the orbit
blue is a ship, black is a planet
that's interesting
note how depending on angle it'll be affected differently
yeah
Yeh, But how'd I loop it?
orbital mechanics is fascinating, you'll be amazed on how interesting it is once you go down the rabbit hole
for instance, do try KSP if you're interested
someone said obital mechanics? o_O
yes tim, kaboom
ooo awesome
Tim no explosives for you
will do, if you were talking to me at least
ye
they'll release a 2nd game next year, so you can hop on the hype train if you like it
looks cool ngl
if you remove the max: 1 then it loops already no?
how can I decrease the size of background-image?
width and height properties
is there an invite event? in v11 djs
not that im aware of
hmmm. How would i ever check and log if a user invited someone then?
i've seen it in many bots, there must be some sort of event or way to check that
If your client has perms for audit log events, you'd have to listen for that and check the type
store each invite use count somewhere, whenever someone joins check the counts again
whichever invite get the value increased is the invite used
Has someone made a tool that turns slash command configs into documentation?
not that im aware of
const keepAlive = require("./server");
keepAlive();
What I’m supposed to put into the index
While using express
const express = require('express');
const server = express();
function keepAlive(){
server.get("*", function(req, res, next){
res.end('baldy')
});
server.listen(3000, ()=>{console.log("Server is Ready!")});
}
module.exports = keepAlive
Anyone in here who has knowledge of the interactions API endpoints and how to use them without a library? I am trying to respond to a button press and seem to be doing something wrong.
i use the interactions api endpoint without a library, but i've never made a button
I have the button made and the message sent, I just need to respond when someone clicks it though.
are you getting the event? it looks like a button click should call the INTERACTIONS ENDPOINT URL
So I am listening to the INTERACTION_CREATE event
And its the raw data from the API
docs seem to say it sends an interaction. is there such a thing as a gateway interaction?
Is it app id or token?
bot token
any of the content missing required fields?
headers are in the body
i thought content was the body for a sec
is the string empty?
try doing a PATCH request to this endpoint instead
/webhooks/{application.id}/{interaction.token}/messages/@original
are you doing an ACK response first?
oh yeah
wtf is the point of the folder locales in electron
kek
is the string less than 2000 characters>?
yes
maybe this endpoint is needed for buttons?
https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message
POST /webhooks/{application.id}/{interaction.token}
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
wtf
Invalid form body
oh, is the JSON.stringify needed?
try type:5
Make sure the header doesn’t require JSON as content type
Wdym
didn't do anything
we removed it earlier
I mean you might need to set the correct content type for the request to application/json
lol
damn thats annoying
good ol' fetch
axios has a nice api
return await axios.patch(`https://discord.com/api/v9/webhooks/${application_id}/${token}/messages/@original`, data, { headers: { Authorization: `Bot ${discordTokens[application_id]}` } });
That’s why I asked if you sure not to declare the content type
Nah same thing when I do that too
An endpoint is not supposed to expect an image if you send an .exe file you know
type 7?
Still unknown


maybe the original url you used
/interactions/id /token/callback
Do you reply within 4s?
hi
Doesn't matter for a gateway connection
PATCH/webhooks/{application.id}/{interaction.token}/messages/@original ?
I’m sure I read somewhere the interaction webhooks are available for 4 s only until they’re invalid
Ok
Maybe I didn’t read well, who knows
15m
its 4s if you don't send a ACK back when using webhooks
With gateway its fine
nice!
???
getting close
i can see things
i cant believe i missed that too
At least you figured it out
congrats!
I had to make all my interaction handling from scratch due to the lack of a interaction handler apart from slash commands in the lib I am using
Just had to figure out how 
i didn't even know it was possible to handle interactions through the gateway
anyone have any idea what is causing this issue??? I havent changed any of my code and suddenly its been erroring out everytime it tries to send a message
maybe an issue with the bot token?
thing is its working in my own guild, but when others try and use commands it throws that
maybe those other guilds didnt give the bot permissions
hi
wait I just noticed discord added a bunch more permissions on the dev portal
now I need to manually select "send messages"
that's dumb
How can i make when the bot sends message to delete it for example in 2minutes
I forgot the code name
why are so many bots banned?
2021-09-15T01:13:50.976047+00:00 app[Worker.1]: throw new DiscordAPIError(data, res.status, request);
2021-09-15T01:13:50.976048+00:00 app[Worker.1]: ^
2021-09-15T01:13:50.976048+00:00 app[Worker.1]:
2021-09-15T01:13:50.976049+00:00 app[Worker.1]: DiscordAPIError: Unknown Message
2021-09-15T01:13:50.976050+00:00 app[Worker.1]: at RequestHandler.execute (/app/node_modules/discord.js/src/rest/RequestHandler.js:298:13)
2021-09-15T01:13:50.976050+00:00 app[Worker.1]: at runMicrotasks (<anonymous>)
2021-09-15T01:13:50.976050+00:00 app[Worker.1]: at processTicksAndRejections (node:internal/process/task_queues:96:5)
2021-09-15T01:13:50.976051+00:00 app[Worker.1]: at async RequestHandler.push (/app/node_modules/discord.js/src/rest/RequestHandler.js:50:14)
2021-09-15T01:13:50.976051+00:00 app[Worker.1]: at async MessageManager.delete (/app/node_modules/discord.js/src/managers/MessageManager.js:205:5)
2021-09-15T01:13:50.976051+00:00 app[Worker.1]: at async Message.delete (/app/node_modules/discord.js/src/structures/Message.js:709:5) {
2021-09-15T01:13:50.976052+00:00 app[Worker.1]: method: 'delete',
2021-09-15T01:13:50.976052+00:00 app[Worker.1]: path: '/channels/887506152936583198/messages/887506454754496542',
2021-09-15T01:13:50.976052+00:00 app[Worker.1]: code: 10008,
2021-09-15T01:13:50.976053+00:00 app[Worker.1]: httpStatus: 404,
2021-09-15T01:13:50.976053+00:00 app[Worker.1]: requestData: { json: undefined, files: [] }
2021-09-15T01:13:50.976053+00:00 app[Worker.1]: }
does anyone use patreon for their bot premium perks
if so can u explain to me how u did it
like webhooks etc
Not banned, declined
Because people don't pay attention when making stuff
Resulting in half-assed bots
any discord bots?
I think it is trying to delete a message that doesn't exist
guys if i wanted to use template literals for a string for example: `This is a string which includes ${something}` but inside that string i also want to do formatting for example: `This is a string which includes ${something} and `something in code block``
how do i do this?
cause that gives me an error rn
so it should look something like this: `This is a string which includes ${something} and code block stuff`
wait
i just solved my own problem
nice
just escape the `
Hello
I need some help with coding a bot using node.js
i coded the bot but i want to make a welcome message like when the bot joins a server it will put that message
I am unable to do that
Can anyone pls help me to do that?
Ok I think I can
oh ok
Can i dm you?
ok
you don't need to include send messages. send messages is unnecessary and is overridden by channel permission overwrites
The bot will inherit the <@&264445053596991498> role permissions and it'd be up to server administration to properly setup their permissions
<@&264445053596991498> is <@&guildID> btw
Maybe discord ratelimited itself 
Just needed to manually delete I guess
Since the role is called @everyone and roles are prepended with "@"
if i were to remove a role from a user when they don't have said role, what kind of error code would that warrant
or would discord say nah its all good
yes
unless the role is higher/equal to the bot's highest role (even if the target member doesn't have it)
this dosnt work, even tried console logging member but nothing
I'm not sure, I'm not on pc agr, but if I'm not mistaken it's
member.send(message);
dosnt work aswell
I don't remember if I have to activate an intent on the developer panel, I'm off the pc now
I'll see if I can execute the command on the cell phone
Do you have the intent enabled
WAIT THERES AN INTENT FOR IT?
Yes
There's the guild members intent which you enable in your code and on your bot page
the member list thingy?
No
On your bots page there is an option to enable the guild members privileged intent enable it and then go to ur code and add the guild members intent
Don't miss the direct message itent?
Also if you're using v13
Enable the channel partial if you're messing with dms
You need it enabled if it's the bots first time dming the user
Yes but you also need to enable it on the bot dev portal on discord
Google translator is so good that it translated your text as "If this is the first time they attack the user"
The one above aaaa
If you are sending dms you also need the channel partial if you're using v13 that is
its this right?
yes i am using v13
Yes
So for dms direct messages intent and channel partial
And it should all work
what are partials?
does anyone know how to make a table with just a pure number, no scale of up/down on grafana?
So you can have a dm object that may not have all the data it should
Or smth idk
Discordjs confuses me
Yea I was right
oh
It's basically just means it can be incomplete
Np
Can someone explain why this is happening?
The voice state isn't updating
I have the GUILD_VOICE_STATE intent
I dragged it
skill issue then
Could be caching issue
I think one of my friends got the same issue on eris too like a couple of months back
But idk how he solved it tho
hmm
I am getting the voiceStateUpdate but the cache isnt updating
cache isn't updating :/
how to delete slash commands
const commands = new discord.Collection()
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'))
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.data.name, command);
}
set of undefined
const { SlashCommandBuilder } = require('@discordjs/builders');
module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with bot latency.'),
async execute(interaction) {
await interaction.reply({ content: `Latency is ${m.createdTimestamp - message.createdTimestamp}ms. API Latency is ${Math.round(client.ws.ping)}ms`, ephemeral: true});
},
};
Anyone have any experience using the google docs API? I'm trying to write some text to a document, this is my request:
await this.docs.documents.batchUpdate({
documentId: id,
requestBody: {
requests: [
{ insertText: { text: 'Wow! So epic!\n', location: { index: 1 } } },
{
updateTextStyle: {
range: { startIndex: 1, endIndex: 14 },
textStyle: {
foregroundColor: { color: { rgbColor: { blue: 89, green: 18, red: 92 } } },
bold: true
},
fields: '*'
}
},
{ insertText: { text: 'Hello World\n\n', location: { index: 1 } } },
{
updateTextStyle: {
range: { startIndex: 1, endIndex: 13 },
textStyle: {
foregroundColor: { color: { rgbColor: { blue: 82, green: 235, red: 52 } } }
},
fields: '*'
}
}
]
}
});
but I'm getting Error: Internal error encountered.. When I remove the updateTextStyle objects everything works fine, so the error is somewhere in there, but I dunno where!
const Discord = require('discord.js');
const {Intents} = require("discord.js")
const client = new Discord.Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MEMBERS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.DIRECT_MESSAGES
],
});
const { setup } = require("./index")
setup({
client: client,
prefix: '!!',
commands: [
{
name: 'hlo',
reply: 'Hloooooo!',
type: 'reply'
},
{
name: 'boo',
reply: 'booo!'
}
],
triggers: [
{
name: 'hlo',
answer: 'Hloooo',
type: 'reply'
}
],
wlcm_channel: '863395716318625822',
leaveChannel: '',
wlcm_embedType: true,
wlcm_embed: {
color: 0x0099ff,
title: 'Welcome!',
url: '',
author: {
name: 'Welcome to {guildName}',
icon_url: "{avatarDynamic}"
},
description: '{user}',
thumbnail: {
url: '{avatarDynamic}'
},
image: {
url: '{avatarDynamic}'
},
timestamp: new Date(),
footer: {
text: 'welcome {user}',
icon_url: "{guildIcon}"
}
},
wlcm_msg: 'Hlo {user}',
leave_embedType: true,
leave_embed: {
title: 'byeeee {username}'
},
leave_msg: 'byeeeee {username}'
});
client.on('ready', () => {
console.log('hlo ' + client.user.username);
});
client.login(' ');

are you using google docs as your database
because google sheets is better
yeah
w h a t
client.login('')
Hello i Forgot how to code status to bot can someone help me with that im using node.js
im using Replit
@earnest phoenix when people posting their whole 2k line source code and find a problem

i think they meant client presence
relatable moment
im using replit for coding
oh
actually i forgot how to make custom status to bot can you help me with that
pls
what you need lies within ClientUser
<Client>#setActivity -> text status
<Client>#setPresence -> online / dnd / ...
(client.user.setActivity("status", {type: 'WATCHING'}))
thats how i have it
like its a a bit different but this is the thing that does the actual stuff ig
i dont remember much
@azure lake
help pls
error?
set of undefined
no like can u send the screen shot of error
ah
commands property doesn't exist on client
i recommend stackoverflow to find an answer instantly

ok
i have this doe
i dont want the answer lol why u telling me
client.commands = commands;
ty
k it works
it should
also split up code
if you import as a whole, you are basically patch up a bunch of code you don't use thus slowing it down
but small scale whatever
what happens if you say ur mom to xiuh's daughter
google docs API: I'm trying to create a table and insert text inside the table's cells in one API call. I've read online that the row index offset is 5 and the column index offset is 2, but I'm getting the error: Invalid requests[5].insertText: The insertion index must be inside the bounds of an existing paragraph. You can still create new paragraphs by inserting newlines.
This is the code which inserts the rows and cols text:
let ind = 0;
for (const row of rows) {
// row index offset
ind += 5;
for (const col of row) {
// col is an array with an insertText object and an optional updateTextStyle object
col[0].insertText.location.index = ind;
if (col[1]) {
col[1].updateTextStyle.range.startIndex = ind;
col[1].updateTextStyle.range.endIndex += ind;
}
obj.push(...col);
// text length + column index offset
ind += col[0].insertText.text.length + 2;
}
}
And this is what the final requests object:
[
{ insertTable: { rows: 3, columns: 3, location: { index: 1 } } },
{ insertText: { text: 'Name', location: { index: 5 } } },
{ insertText: { text: 'Role', location: { index: 11 } } },
{ insertText: { text: 'Targets', location: { index: 17 } } },
{ insertText: { text: 'Google', location: { index: 31 } } },
{ insertText: { text: 'Sheriff', location: { index: 39 } } },
{ insertText: { text: 'None', location: { index: 48 } } },
{ insertText: { text: 'Sal', location: { index: 59 } } },
{ insertText: { text: 'Goon', location: { index: 64 } } },
{ insertText: { text: 'Google', location: { index: 70 } } },
// There is more but the error is happening at the "Sheriff"
@modest kettle #topgg-api
how much time does it usually take for a guild to be available to send a message after the guildCreate event?
Dont think it even takes time, unless the guild went on a outage exactly when the bot got invited
aaaand we have a fourth
geez
so um i am working on a array list on vsc and i am using a theme
when i get past 1003 or smthn character the text of the array list loses color
is that normal or?
it's hashtags
an array*
not array list
my bad
setting in different categories of hashtags and making a randomiser
is the whole array a single string?
no?
vsc auto-disables syntax highlighting on very large files
idk if you can configure the threshold somewhere
but usually "very large files" are like millions of lines
what else is in that array?
maybe vsc also disables syntax highlighting for very long strings
yup i think that's the case
cuz i just ran the code and it is working perfectly
a single string would be if the array only had one ' '
right?
so basically
['abcd']
ye
i wouldn't use an array if it was a single string lmao
but why do you have such a long string in an array?
it's instagram hashtags
1003 chars worth of hashtags?
wouldn't it be better if you had 1 hashtag per array element?
If it works it works 🤷♂️
no?
1 post can have 30 hashtags
so it wouldn't be worht it
worth it
How to remove this from github pages??
I mean, you could just grab 30 random elements
the ./porftolio part
ok then
thx
the answer is probably "you cant"
you should be able to can
but take that with a grain of salt, it's been ages since I used ghpages
didn't u write the source code?
yes
I did
it's no where there
I created my own website using GitHub Pages here.
However the homepage has a big hyperlink at the top which isn't included in the Markdown. It also doesn't appear in the README.md file here.
How...
inspect element -> find class -> visibility: hidden
add the css to ur source code
what are some more examples of api abuse?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
thnx
let's see, dm to every member in server, spamming channel, rate limit via some webhook, etc
remember when discord introduced the 1 hour ban on 10k invalid requests?
oh
oof
they said some bot was doing 300k invalid requests per hour for no reason
lol
so just like being annoying?
also whats rate limit?
read the link I sent, that's the official api tos
it looks like some legal paper mate
it is
rate limit means to get limited on sending messages
still dont get it
not only that
so the bot rate limits the users?
ratelimit is how frequently you can do something
from discord tos: you've tried a specific action on Discord too many times, without much of an interval between attempts.
so you would get limited on the amount of messages/requests your bot can send through api
basically
ohh
also can someone explain me this?
can you like not advertise your brand?
or the bot owners website?
so basically for a brand you can't put a brand logo as your bot's pfp
considered trademark infridgement
basically by using the api you don't get rights to use discord brand nor they get rights to use yours
you can put a logo on your pfp, you just cant use discord or any other branding as if you owned it
except if you get explicit permission to do so
i thought it wasn't allowed
it is, you just can't do so without permission
no ig like if you are their partner then u can
like, using youtube branding without them allowing
skullbite's bot was given a cease and desist for using spotify logo and having the name spotify
they probably didn't allow it
pirating
or "unauthorized content sharing/reproduction" to be specific
youtube started cease and desisting discord bots basically due to what kuu said
until they get caught, exist
hmmm
there's nothing you can do against it, the devs are the wrongdoing party
yea
there's nothing really to be done, once every bot is taken down for youtube policies. game over
thats sad
well i mean every bot that uses youtube
not being able to listen to music with me mates
i cant type
you guys got any tips to get my bot into more servers?
i legit dont know what else i can do
i have already added it to multiple server lists
i believe there is an auctions
hmm yea
no advertising is as good as mouth advertising
have your users like it and they'll eventually advertise for you
@round cove sixth
Is the server search still under development on the website?
no, it's just buggy until they finish migration
ok, so voting will push servers to the top for searches again soon?
kinda, the sorting is not 100% voting
it also includes relevance to the search query and popularity
we have apex in the tags, short desc., long desc and about 40 votes and we used to be page 1 before migration, but now we don't seem to exist in searches?same for rocket league and other tags we have
How can I handle this?
let lookup = await dictionary.find(a);
if (!lookup) return console.log("An error has occured while trying to search for this word.");
If it errored in the .find(), I can't handle it since it just crashes.
await dictionary.find(a).catch(() => null);
Cant u just use try and catch?
Thanks.
no, it's just buggy until they finish migration
also note this
searching is not working as it's supposed to be currently
oki dokie, ty for the heads up
let lookup = await dictionary.find(a).catch(() => null);
if (!lookup) return console.log("\nThe word you entered is invalid.");
else console.log(`\nThe search system was able to find results for the inputted word, "${a}".\n`); // Return a message stating that it has found results for the word.
lookup.then((res) => {
console.log(JSON.stringify(res, null, 4));
}, (err) => console.log(err));
There are times whereas .then() is not a function.
if you use await, then you cant use .then at the same time
Oh, really?
unless you make a copy
Ah.. just stringifying a return value so, for sure. 👍
.find returns a promise, so you can do promise.then
but if you await it, its not a promise anymore
Ohh.. alright.
Yeah.. I'll remove the await temporarily just to see the entire object value then get it back.
.. or redefine a variable using the find method without the await then add then.
Edit: Solved.
Anyone knows some npm that searches for the antonym of a word since all the ones I found online are not working.
Check Thesaurus-synonyms 2.1.3 package - Last release 2.1.3 with MIT licence at our NPM packages aggregator and search engine.
It has the "antonym" tag
Oh.. let me perform the search method, then.
There is no other one, though.
Check Saurus 1.3.1 package - Last release 1.3.1 with MIT licence at our NPM packages aggregator and search engine.
Uses thesaurus.com to look up synonyms and, if available, antonyms.
thesaurus-com also does the same, and some other guy forked it and called it thesaurus-dom.
Same design.. tf.
Empty Arrays.
does any1 know the API for the tweet command in discord.js so u can create a tweet then it comes out as embed
Same thing, empty.
there is no such thing in discord.js
God dammit.
twitcord.js
Well it's on the master branch but there is the GuildImageManager for Guild where you could access the generate method, like js const attachment = await message.guild.images.generate("tweet", { member: message.member, tweet: "Hello world!" }); message.channel.send(attachment);
More information on https://discord.js.org/#/docs/main/main/class/GuildImageManager?scrollTo=generate
dafuq lmao
Tf
its just an empty page xD
You just ruined his hype. 😂
tim trolled successfully
Tim be like "wait did I forget to put this in my Discord lib?" 👀
ew no
Tfw the lib is so bloated it seemed possible at first /s
Anyone knows some type of antonym npm or something...
All the ones I found are returning empty arrays.
that means there is no available acronym
Not ancronym, antonym.
is there really an antonym lib?
I never found one.. 😦
thought so, it's not something logically doable
unless you manually define antonyms for everything like dictionaries do
YIKES.
might be more helpful to log the status code
@solemn latch please change ur name
👍
whats that?
the full error message
you need to supply a role into add_roles instead of the id
btw, iirc discord.py is abandonware, keep that in mind
abandonware?
abandoned library
oh so not up to date?
What npm can I use to read from https://api.dictionaryapi.dev/api/v2/entries/en/happy. Aka.. god dammit finally found one.
you can just use the default https module
How does that work? I want to convert it to an object I can use.
its pretty straight forward. https://nodejs.dev/learn/making-http-requests-with-nodejs
ye, it returns a json like any other api
Alright.. it logged it now, but as a string. 👀
const https = require('https');
https.get(`https://api.dictionaryapi.dev/api/v2/entries/en/${a}`, (response) => {
let data = '';
response.on('data', (chunk) => {
data += chunk;
});
response.on('end', () => {
console.log(data);
});
});
SyntaxError: Unexpected end of JSON input
let lol = JSON.parse(data);
console.log(lol);
JSONLint is the free online validator and reformatter tool for JSON, a lightweight data-interchange format.
put the string here
see if the json has something missing
Valid Json
Hm.. I tried an online npm playground, same error.
What do you mean, exactly?
That's what I did...
@lyric mountain sorry >.<
const https = require('https');
https.get(`https://api.dictionaryapi.dev/api/v2/entries/en/${a}`, (response) => {
let data = '';
response.on('data', (chunk) => {
data += chunk;
});
response.on('end', () => {
console.log(data);
});
let lol = JSON.parse(data);
console.log(lol);
});
Using data in the console.log(data), I added to that website the output, it gave an error.
Let me try again.
I guess so, did you try?
that won't work
you need to put inside 'end' event
it just did this
else it'll try to parse an empty string
you need to define guild
don't just copypaste stuff you see online
what is define guild
Ayy.. it worked. 👍
here's an advice, halt bot development for a while and start learning python
py
you lack some fundamental knowledge that'll be required to properly make a bot
my friend is helping me learn too
i just wanna make a bot too
but you can't just skip steps
wdym
ik making bots is fun and all, but you're putting the wagon in front of the horse
worked for me (im his friend lmao)

