#development
1 messages · Page 1926 of 1
Input the ID as a string not an Integer.
f
It can get fucky if the ID is over the maximum safe integer
I don't think Discord.js v13 likes IDs as numbers anyway
What do you mean?
they are supposed to be numbers doee

Input them as string.
i did it worked
Great.
thx both of u
Hi guys
I need help
Problem is
there is no error.
I have problem with my code for a Firefox extension, I tried debugging as well, in-fact I have been debugging from last 4 hours but still cannot figure out what the issue is.
My code is available at https://github.com/pgamerx/yt-dislikes-viewer/tree/mozilla
Please have a review if you are willing, any help is appreciated
Maybe read the rest of the messages as well before replying?
I am trying to fetch the data from Youtube API/ My API (Both works fine as I tested them for chromium extension) and display it next to the đ icon, but firefox extension won't work
what package are u using
yeah discord sends ids as strings specifically for this reason
because 32 bit environments will fuck themselves
client.user.setPresence({
status: "idle",
game: {
name: "Send your Emote",
type: "LISTENING"
}
});```Is this wrong ?
Wouldn't be better to also send what error u got?
.setName('p')
.setDescription('Post a message'),
options: [
{
name: 'textId',
description: 'Text Id.',
required: true,
type: String,
}
],
async execute(interaction) {
is there a reason why the bot aint showing me the options
That syntax looks very wrong
i am editing a message and getting a 200 response, but the message isn't being edited
const axios = require("axios");
const discordTokens = require("../discord/discord.json");
const editMessage = async ({application_id, channelId, messageId, embeds}) => {
const res = await axios.patch(`https://discord.com/api/v9/channels/${channelId}/messages/${messageId}`, {
embeds
}, {
headers: {
Authorization: `Bot ${discordTokens[application_id]}`
}
});
console.log(res)
}
module.exports = editMessage;```
the message id and channel id are correct
the message is unchanged
is discord broken?
i have the manage messages permissions added for the bot
How can you make a function argument show properties from a other class?
Like for example the Discord.js message class
JSDocs lets you add that in.
* Blend two colors together.
* @param {string} color1 - The first color, in hexadecimal format.
* @param {string} color2 - The second color, in hexadecimal format.
* @return {string} The blended color.
*/
export function blend(color1, color2) {}```
I'm aware but as class
Like for example
I want to run a function when the messageCreate event is called
put in class name instead of string
thanks!
here's an example
was here earlier https://javascript.info/comments
you might need to create the class in javascript
like a clone of the class
Discord.js uses typescript so im not sure what will happen there
the creator of json advises against using the class keyword
make classes like this js const x = function(spec = {}) { const {get, stuff} = spec; const publicFunc = () => { privateFunc(); }; const privateFunc = () => { console.log("hello") }; return Object.freeze({ publicFunc }) } const y = new x(); y.publicFunc();
Are you living in 2012?
there's absolutely no advantage to this
only makes your code messier
object.freeze makes it so you cant mutate the object
so no confusion about what the object is
why is this broken?
do classes work exactly the same way as in java? i hope there is no confusion there
only classes needed are map and array
classes in javascript are just syntactic sugar and telling people not to use them is the same as telling them to write uglier code
classes are ugly. that just exposes it
beauty is subjective, though you'll have to make some very good arguments to make me see the beauty in the snippet you sent
you dont need to build classes and think that way
like you dont need to make a base class and extend it
and think of the whole structure up front
and get it wrong
Why is discord telling me it edited the message when it's not being edited
Is this endpoint broken? ```js
https://discord.com/api/v9/channels/${channelId}/messages/${messageId}
why discord!
can someone try editing a message with their bot?
const axios = require("axios");
const channelId = "";
const messageId = "";
const discordToken = "";
const res = await axios.patch(`https://discord.com/api/v9/channels/${channelId}/messages/${messageId}`, {
embeds:[{title:"asdfad", description:"asdfasdf"}]
}, {
headers: {
Authorization: `Bot ${discordToken}`
}
});
console.log(res)```
Isn't it js { data: { embeds :[{ title:"asdfad", description:"asdfasdf" }] } }?
Ah, never mind
yeah, not for the patch. that always tricks me too
does axios.patch do json by default?
yeah
it was a permissions issue, but it wasn't returning an error
the bot should always have permission to edit it's own message
and if it doesn't discord should tell me
weird
How can I awaitMessages in a slash command?
probably best to not await messages unless you have the message content intent at this point. we are not too too far from it being required to get messages
imagine the chaos that'll ensue after the lock
i cant wait
What is better, Watchbot or Statcord for getting Status and stuff.
discord hq after april
not anymore
how can I execute a command and get the partnership message of a server?
If I use the object in slash commands a partner message is too big
ask for a file maybe
the only way is to collect it
a .txt file
I want to code a partnership bot lol
hmm...by "status" you mean "bot is online/offline"?
Like uptime and status like that
I am tied on what to use
about the bot right?
What is better?
Yes.
hey. This thing, returns me an array of objects.
I tryed to do <array>.length, but it returns undefined. js deleteAmount = await message.channel.messages.fetch({ limit: parseInt(args[0]) }) console.log(deleteAmount.length) returns: undefined
wait
nvm
@lyric mountain so, which one would you use?
I sent it but never logged it
I prefer not to use third-party whenever possible
such trackers are quite easy to make
most of it is just styling
I aint that good of a coder ;-;
yet another reason to try
what are you guys talking 'bout?
the only way to become a good coder is trying
Since 9 AM I'm trying that partnership command and stil dont got it lol
just ask the user to embed a .txt file with desired partnership message
How can be this easy to be coded?
how can a user create an embed?
embed as in attach a file
aw
and then how can I send this message to other servers?
simple, you'll be dealing with an array of time-status pairs
it's really just a styled json visualizer
[time][data]?
{"time": "data"}
What are Shards?
sharp pieces of something
a shard of ice, a shard of glass, a shard of discord
:^)
On Discord Bots?
Do I need it?
only if your bot is big
sharding is recommended at 1500 guilds and mandatory at 2500 guilds
always mind
SDA(TGHJIOQWÂŁENGWED()"Q{PTKWEAMLSKN235235231V(ÂŁW)Q%UIÂŁQ(F)
- life of an operating system dev if you understand i will be happy
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
lol
anyone: hey, let's give clear names to our variables
windows registry: NFN81O391C213CYNY132F
Can I attempt to submit my bot on top.gg in it's "alpha" stage, or should I let other Discord users test it out to see if it works before apptempting to sumbit my bot?
wtf this gif is 32mb lmfao
let prop1;
let prop2;
let prop3
setTimeout(() => {
de9 = true
}, 60000);
const keys1 = Object.keys(carddatabase)
prop1 = keys1[Math.floor(Math.random() * keys1.length)]
g1 = prop1
const keys2 = Object.keys(carddatabase)
prop2 = keys2[Math.floor(Math.random() * keys2.length)]
g2 = prop2
const keys3 = Object.keys(carddatabase)
prop3 = keys3[Math.floor(Math.random() * keys3.length)]
g3 = prop3```how would i keep on generating till prop1 for exampele, is a property w/o an a in the name
i was thinking about a simple if statement and then a new generating
You could just do like ```ts
const keys1WithoutA = Object.keys(carddatabase).filter(x => !x.includes("a"));
prop1 = ...
I don't understand why it met me like that?
embeds[0].description: This field is required
then you need a description
you're probably sending an embed with a blank description of some sort
ÂŻ_(ă)_/ÂŻ
hey, so for permission change in v13
now instead of KICK_MEMBERS
or BAN_MEMBERS
its like Permissions.FLAGS.SEND_MESSAGES
does it mean you only need to change and add permissions.FLAGS. infront of them or is it different for some other permissions?
Ping in replies
In addition, the usage of string literals for bitfield flags such as Permissions and UserFlags is discouraged; you should use the flag instead.
discouraged
not required, however it's better to use the Permissions.FLAGS.PERMISSION instead of string literals, as it says in the docs
alright
Is it possible to put local images into an embed anymore?
I guess so, just use the attachment://name.ext format
Yep itâs still possible
Within the setImage method?
The embed sends fine with no errors but no image is with it. So that's why I ask.
Integrate your service with Discord â whether it's a bot or a game or whatever your wildest imagination can come up with.
shows you how to there ^^
Right.
const attachment = new MessageAttachment(
'assets/vivi_commands.png',
'banner.png'
);
const embed = new MessageEmbed()
.setTitle(`Hello World`)
.setDescription('Going to make a tutorial here.')
.setImage('attachment://banner.png');
interaction.reply({
embeds: [embed],
attachments: [attachment],
});``` Current code, which doesn't seem different from what the API docs want.
Is Discord trolling or soemthing lol
I absolutely cannot get this to work lmao.
this is gonna sound stupid
but try importing the buffer of the file with fs
and pass that to MessageAttachment
and see if that works
kinda like this
where data = the files buffer
I created a normal buffer variable with node's buffer but I GUESS I can try FS
Oh
const attachment = new MessageAttachment(
'assets/vivi_commands.png',
'banner.png'
);
this technically wouldn't work?

And I've done all sorts of paths
I'll whip up a test bot a sec and see if I can get it to work
y tho
I HAD TO DEFER IT??
Discord just took ten years to receive the stupid image
Presumably because it's large.
@round cove https://img.pyrocdn.com/nvcKShfD
I got it to work
client.on('message', async (msg) => {
const data = await fs.readFile('./image.png')
if (msg.guild.id === '817548193410580511' && !msg.author.bot) {
const image = new discord.MessageAttachment(
data,
'banner.png'
)
const embed = new discord.MessageEmbed()
embed.setImage('attachment://banner.png')
await msg.channel.send({ embed: embed, files: [image] })
}
})
you shouldnt have to defer it at all
you just have to attach it as a file to the message so the embed knows what file it is
I'm doing slash commands, Discord wanted it defered.
So unless you wanna test slash command for that too.
Wonder what happens if I give it an image that isn't 40320420mb
generally speaking, you should always defer if your code is async
because usually you wont have control over how long async things like files and networks will take
I mean fair
Yeah it's the size of the file that was the issue.
Also fs methods aren't async methods so unless I sleep the program

they can be?
i mean
Can deferring have raceconditions?
fs is i/o bound, so its either async or blocking, both of which should be deferred
I thought deferring means it has to take more than 3-5 seconds?
Or was it just if it does take that long you have to defer.
interactions are like a webhook that discord sends to you. they make a request to you and wait for a response, so to not keep them waiting too long, they abort the request after 3 seconds
so you have 3 seconds to respond to the request they make
Ah.
if you dont know how long your code will take to generate a response, its better to give them an immediate response and then follow it up later
thats what deferring is
Right.
Then yeah. I guess in this case with variable image sizes I probably should just defer.
Alright thanks for explaining guys. I never actually took the time to understand the new interaction stuff ;p
I mean, not even discord understood 'em yet
..
How the heck do you check perms now in Discord.js ?
ReferenceError: Permissions is not defined
at Object.execute (C:\My Projects\ella\v13-ella-main\v13-ella-main\commands\settings\setmute.js:8:54)```
permissions.has still gives of the same error
Did you import Permissions lol
create a script -_-
or.. whatever your main file name is.
yep.
if can simple use node . if you just specify the path from json to the main file and it will autmaticly start that file
u can use npm
ok
then try npm start and it should start the program.
can i put this under main?
so where?
under test?
yeah ok
under or on top of tests
yeah
try to solve it your self, if no work than ping me
Not needed to add node . as script
node . will call the value of the key "main" in your case index.js
after test
yee but it looks like he prefers to use the npm start
thx
Which will call node .
working
yep.
Which you can call directly
node requires you to type 1 more charecter than it takes to type npm start so its easier
wait...
nvm
if you call it something like A it will be đ
Nope just node .
Yikes.
Now... when I look like the smart kid
I would like to ruin that and ask how tf do I check perms
cmd /c cmd /c cmd /c notepad.exe
Did you not import Permissions from the package? Lol
yes
import { Permissions } from 'discord.js';
this ?
I thought that was... never mind. Thanks 
also...
is it required to have the P and FLAGS in full cap bc when I was changing it I accidently changed all of em to just low..
Well yeah.
welp.... there goes me wasting onather 30 minutes of my life fixing onather (out of multiple today) mistake.
welp that was quick..
Assuming you know that args is a string array then yes you can do args[0].toLowerCase()
Locale is localization
Like your language.
That wouldnât make much sense as something in lowercase can never be "Discord" starting with a capital letter
You're not in a browser so it doesn't matter.
I mean they could easily change the D to d and I assumed they knew that...
They were clearly asking fi they could lowercase them.

btw can you just do Discord.Permissions, or does it have to be imported directly from there?
You can do Discord.Permissions if you require the whole package as Discord
Which database?
For SQL either using SELECT count(*) FROM database using count as property of the result or just accessing num_rows which should be part of the result
hold up- dont say I also need the perms thing for this bc its not built in to the thing..
It wouldnt make since tbh.
me represents a guild member which can be checked for permissions, so nothing wrong with it
But something is completely wrong regarding the indentation
I keep getting this error on Mozilla but my code works fine on chrome
browser.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
// read changeInfo data and do something with it
// like send the new url to contentscripts.js
if (changeInfo.url) {
browser.tabs.sendMessage(tabId, {
message: "progressbar",
url: changeInfo.url,
});
}
});
Line which is getting the error:
browser.tabs.sendMessage(tabId, {
and I have 69 brain cell
if (/^discord$/i.test(args[0]));
hey anyone wanna help me in making About Us content?
dm me
I want to do a send in all server command where:
-User: /command
-Bot: 'Send the test that you want to share'
-User: Text
-Bot: 'Text received and send '
But I don't get how to do it
that'll get you rate limited
pls someone send me code to leave all guilds
of python

this is not stackoverflow
with awaitMessages? đ
you're sending a message to every single guild the bot is in
yeah
This is what I want to do
not every single guild, the guild that saved data of a channel in mongo
pika
chu
mew
bruh pls 1st and last time
how to do this?
Help me pls
- I don't know python.
- The weebs in #general already explained it to you.
- https://lmgtfy.app/?q=how+to+leave+all+guilds+discord.py
@earnest phoenix
Which library?
py
ok
Python is a programming language, not a library
lol
wot lol
discord.py? Hikari? Nextcord?
and i will be back to discord when i learn coding nicely
no error
An instance of discord.Client contains a property guilds, which is a list of Guild instances. Those Guild instances have a .leave() method.
So, if you want to leave ALL guilds your bot is in, you want to iterate over <Client>.guilds where <Client> is an instantiated Client, and then call .leave() on every item. Keep in mind that it is a coroutine, so you will have to await it.
i want my bot to leave all the server it is in
and i dont wanna delete it
Did you read/understand what I explained?
const fs = require('fs');
const guilds = require('../data/guilds');
const commands = new Map();
const fileNames = fs.readdirSync('./commands');
for (let fileName of fileNames) {
const Command = require(`../commands/${fileName}`);
const command = new Command();
if (!command.name) continue;
commands.set(command.name, command);
}
console.log(`Loaded ${commands.size} commands`);
async function handleCommand(msg) {
const savedGuild = await guilds.get(msg.guild.id);
const prefix = savedGuild.general.prefix;
const channelIsBlacklisted = savedGuild.general.blacklistedChannelIds.includes(msg.channel.id);
if (channelIsBlacklisted) return;
if (!msg.content.startsWith(prefix)) return;
const name = msg.content
.split(' ')[0]
.slice(prefix.length);
const args = msg.content
.split(' ')
.slice(1);
const command = commands.get(name);
try {
await command?.execute(msg, ...args);
}
catch (error) {
await msg.channel.send(`â ${error?.message ?? 'Unknown error.'}`);
}
return command;
}
module.exports.handleCommand = handleCommand;
module.exports.commands = commands;ââ
What does ```js
require(../commands/${fileName});
return?
It's for handler but it's not the error in the console I have this as error
const command = new Command();
TypeError: Command is not a constructorâ
huh
i didnt understood anything
i just wrote my own code and it worked
u want the whole code or i just explain it to u
client = discord.Client() # Instance of Client
# It is optimal to use the on_ready event for leaving all guilds your bot is in.
# However, it is possible to do it via a command.
@client.event
async def on_ready():
# Each element in client.guilds is a Guild object. We will simply use a variable `guild` to "point at it".
for guild in client.guilds:
# Every `Guild` object has a .leave() method that, as you could've guessed, leaves the guild the object points to.
# Once you call the method, you need to await it.
await guild.leave()
Abstracting away the part with running...
... welp.
hm
@client.event
async def on_ready():
print('Logged in as {0.user}'.format(client))
await client.change_presence(status=discord.Status.online, activity=discord.Game(name="]help"))
async for guild in client.fetch_guilds(limit=150):
print(guild.name)
await guild.leave()
print(f"left {guild.name}")
thats my code
Well, that works too, I guess
yep
its 0 server now
i am leaving all servers too
so i am gonna leave this server too
after requesting my data from
https://somehost.xyz
Free and paid hosting
In a database I've stored guildId and a channel Id how con I send a message in the channel of all the guild stored?
Select and query all the guilds you need, loop through the result and send a message to the channel each iteration of the loop
But keep in mind mass messaging may be considered as spam
for sure I have to do a forEach cycle, or a For with data from data
but how I extract the documents from the database?
I want to set my category on the top but the category has been set on the bottom.. is not position 1 ?
can anyone help me to integrate my bot with a rest api
I am using nodejs
if anyone know how, ping me
what Is a Rest api? đ
try position 0
That depends on your database
Well log your args and see
just do if args.length < 1 return sendmessage('give me argus you dingus')
what
thats like
the actual way to do it?
if there are no args
youre going to run into issues
if (args[0]?.toLowerCase() === "discord" && args[1]?.toLowerCase() === "moderator") {
would also work
You can, yes
{
_id: new ObjectId("619a30fed932cbdf8a2925bb"),
serverID: '846752749555286027',
channelID: '910152861277650964',
userID: '658234646932357140',
__v: 0
},
{
_id: new ObjectId("619b7a694d9214c7ba798b1a"),
serverID: '757896200320974899',
channelID: '838769630960812093',
userID: '658234646932357140',
__v: 0
}
]```
Extracted, now how can I send the same messages in this 2 channels?
Loop through the result
sincerly I have no clue in doing this
for(const item of array)
{
console.log(item.channelID);
}
sorry đŠ
for (i = 0; i < database.lenght; i++)
something like this?
Not need to overcomplicate things
Just use a for of loop
As I wrote
array is your result and you can call the var row whatever you like
How can I do this part, but I'm having this problem because I searched for this feature but I can't find it
in guildMemberAdd event how can I check if the member is a BOT?
if(member === bot) return?
member.bot
member.user.bot
same problem
dunno then
@quartz kindle 8 hours wasted of using sqldump directly to the remote location, inserting only 256 million rows in that timeframe
what in the actual fuck
Im really gonna give rsync a try
xD
what was in your db that needed 256000000 rows
his db is like 6 billion rows
Turns out watching the process list sqldump sends a fucking single insert request for every row
4 Billion
xD

Figured out rsync can sync to remote locations, too
Letâs hope thatâs faster
According to the docs Iâm okay with just moving the database folder for InnoDBs or MyiSAM
How can I check if the interaction.user is inside my support server?
I want to do this command in every guild, but you can execute it only if u r inside my support server
Well then register the command only in your guild
Or check if the interaction.guild.id is yours
But displaying commands globally if you canât use them seems nonsense
my english is rusty, I'm bad at explaining myself, I want that command to exist in every server, but the user MUST BE in my server đ
get the user id for the interaction
get the guild object for your guild
check if guild.members.fetch(userid) works or throws an error
const guild = client.guilds.cache.get("id_here");
if (!guild.members.fetch(user))
return interaction.followUp(
"you arent inside the support server, join and after use again the command"
);```
something like this?
.cache.get()
Also userid doesnât exist
const member = await guild.members.fetch(user).catch(() => null)
Since you defined it as user
speed error, also 'cause I'm dumb
is this the search action?
yes
fetch is a promise, so it has to be awaited
if the user is not found, it throws an error, so you have to catch it
const guild = client.guilds.cache.get("757896200320974899");
const member = await guild.members
.fetch(userID)
.catch((err) => console.log(err));
if (!member)
return interaction.followUp(
"you arent inside the support server, join and after use again the command"
);
Pretty sure I did something wrong without executing it
I saw that catch null
How can I change channel name ?
I created a bot which displays total bans in status, now I would like to show that as channel name instead of status as I would like to add another channel for kick count too
it will work
because console.log returns undefined, so the !member check will work
you can only change a channel name twice every 10 minutes afaik
so you'll be limited to updating it very slowly
Ohh for a particular channel or total no of updates ?
for a particular channel
I would be fine with it being updated every 5-10 minutes
if you're using discord.js pretty sure channels have a .setName() method
Ohh lemme check the docs once
Umm, which would be better , .setName() or .edit() ?
Also how can I fetch the channel , I can't understand .fetch() since there is not much written or should I use different method
you dont need to fetch channels, unless you manually disabled channel caching
I didn't
edit() is the base method, setName() uses edit() internally, its just a shortcut
Ohh, so how can I get the channel object so I can apply this method on it ?
yes
Umm, how can I get it ?đ
message.channel needs message to be sent, what I'm trying is to automatically update the channel name every 10 minutes.
PS : I would be using Voice Channel for this
Ohh I will try this
But this would return boolean , right ?
Yep
It doesn't return a boolean, it returns a channel promise
What's that, if you mind explaining a bit ?
lmao
really ?
Yeah channels are cached anyways
Thanks everyone it worked !!
Especially tim 
can people put normal names and not those characters
it makes me google them
and I get spoiled
did you just spoil tensura to me
Please speak in an human understandable language!
Anime Fan Language
One last thing, I want to have a similar channel for kicks too, ban was easy, I got the hang of it using docs, bans are stored in discord so we can get them.
For kicks I plan to detect the kick and then keep the count in database. But how can I get the trigger for kick ?
When you kick the member yourself or just by listening to if somebody got kicked?
The event guildMemberRemove contains the guild member object.
By bot
There's a property for guild member objects called deleted
Whether the member has been removed from the guild
That might be true if someone has been removed (not left)
Probably
Also this will then have banned members included too ?
Test it out, I'm not sure but I guess so regarding the description
There's an own event for banned members
Yeah I used that already, but if it includes bans, I would need to subtract bans from this to get kicks
Not sure if both events being fired
Create a listener for both events and ban a member and you will know
Let me try that
Just 4 files to move, Tim
Let's see if rsync can do the job at an acceptable speed
That's a lot faster than generating it or dumping the old to the new one
should have done that in the first place
xD
the speed is just weird... should go up to 65MB in theory
but stuck at < 20 MB
est 7h for the smaller file

at least it seems to be reliable
OH OH OH MOVING TO 30 MB/s
ahhh nvm
xD
welp, it depends on the files being transferred and the transfer options, as well as disk speeds and network speeds
it probably also has the overhead of a few checks and controls
plus the transfer protocol it uses
prioritized the server as real time tranfer in the router, helps a littble bit
đđŸ äč Glitch Editz, You just leveled up to level 1!
@rose warren
wtf
great
lmao
he level up himself
Let's pray the ISP can keep up my internet for the next, hmm 16h
rsync should support resuming
ahh good to know
it does
...
Should have started the process in screen 
imagine accidentally closing the command prompt
What are you doing ?
Imagine my bot has 5K of servers and each server has a "Test" channel.
If my bot EDIT every day at 00:00 the show name for all servers, will it be rated?
Moving a single database to a remote server
Btw I found out this is discord.js guidebook ```js
client.on('guildMemberRemove', async member => {
const fetchedLogs = await member.guild.fetchAuditLogs({
limit: 1,
type: 'MEMBER_KICK',
});
// Since there's only 1 audit log entry in this collection, grab the first one
const kickLog = fetchedLogs.entries.first();
// Perform a coherence check to make sure that there's *something*
if (!kickLog) return console.log(`${member.user.tag} left the guild, most likely of their own will.`);
// Now grab the user object of the person who kicked the member
// Also grab the target of this action to double-check things
const { executor, target } = kickLog;
// Update the output with a bit more information
// Also run a check to make sure that the log returned was for the same kicked member
if (target.id === member.id) {
console.log(`${member.user.tag} left the guild; kicked by ${executor.tag}?`);
} else {
console.log(`${member.user.tag} left the guild, audit log fetch was inconclusive.`);
}
});``` to record kicking a member.
Here I wonder if there's a raid and auto-kick starts, will it be able to record that fast or will miss some entries ?
ohh
I installed my font from here https://github.com/source-foundry/Hack#macos but I still don't get the icons in my terminal, anyone knows why?
Umm, may I know the advantage of that ?
I'm unsure as to why this interaction wont ping anyone? https://img.pyrocdn.com/ioMQ_wOZ
What does the msg look like?
Also here what's the use of limit ?
just doesn't ping anyone when mentioned
Looks like you overwrite the mention options
Add parse to the options, too
based on docs that should work
Hmm did you disable mentions in your client options?
i'm not using discord.js
just so ya know
I'm using no lib
just based http requests
hence why im confused
Hmm why do you actually need to ping the user if itâs supposed to ping everyone anyways?
it's not pinging everyone
I need it to ping that specific user but it's not working even without that object
Hmm then add parse: ["everyone"] to the object
To see if that even pings somebody
Or better
nope
parse: ["everyone", "users"]
nope
Umm, how can I record kicks using that ?
Isnât there a permission to ping everyone?
bot has admin
Ah nvm
According to the docs anything is right
But parse canât contain users, if you specify users as I can see now

Umm, I can't find something related to that, is that even possible ?
What about the events we were speaking about before?
there is no way to differentiate a kick from a leave, unless you check audit logs
What does the property deleted mean then?
that the object is still in the cache for some reason
even though its not in the api anymore
ah okay
or if you hold a reference to it in a variable for example
yeah makes sense
it's cause it was deferred
they dont support pinging after a defer
just like they dont support after an edit

Ah okay, damn didn't thought about that one
I had that issue myself lol
Needed to figure out, too I had to specify the message options when deferring the message as well
you cant ping people when you defer? lmao
Ah you can
But you need to specify it in the options when deferring the message
Adding the ping later when editing the initial message, doesn't work
Same goes for ephemeral messages
hmm?
wdym
example?
what options do I have to pass to the deferred message
did defer the interaction via. deferReply() and was wondering why ephemeral: true as message option was ignored later via. editReply()
Found out a while of trying the message options need to be applied when deferring the reply, not in the reply itself
errr... sending the message option in when deferring doesn't work for pings?
deferReply({ allow_mentions: ... })
not by the looks of it
lemme test it real quick
nope which seems really irritating
because they're treating deferring as a edit
Oh yeah I see there's no message option regarding mentions
Doesn't support base message options
Well then defer the reply and send a follow up message and remove the inital message at the same time
follow up messages support mentions
that's just irritating though
yeah indeed
Guess I'll just have to keep it how it is until discord make it so you can ping in a deferr
I wonder why that's not supported anyway
same
If something takes a while anyways a ping is a good idea if it's done
Seems like a bug
the docs clearly show allowed_mentions as a valid field in an interaction response object
because I cant get a deferred message to ping
Lemme check the dev docs again
this is why im confused
Yep
hmm
While interaction responses and followups are webhooks, they respect @everyone's ability to ping @everyone / @here . Nonetheless if your application responds with user data, you should still use allowed_mentions to filter which mentions in the content actually ping. Other differences include the ability to send named links in the message content (text).
No word about deferred messages
Following up a deferred message uses the /webhooks/ endpoint
(I will be cleaning this up before you scree)
The allowed_mentions field of the edit request controls how this happens. If there is no explicit allowed_mentions in the edit request, the content will be parsed with default allowances, that is, without regard to whether or not an allowed_mentions was present in the request that originally created the message
So.. it should be supported, yeah
but it's not working?
Tim is probably right, seems to be a bug then
am I gonna have to like contact a ddev then 
I also wonder how long it still takes until they push slash command nesting
I mean April is not that far away anymore
anyone know how you would change a channel name in d.js?
anyway... can confirm it's not working for me, too
almost ran out of hours so i had to add a CC to get those extra 450 hours per month lol
money to rent a server will solve all your issues
google's free tier is way better than heroku btw
well if there's no reliable "friend" you can host your stuff, yes it is
isnt the google free tier just a free trial
I don't use java I swear!


How's it ?
when compared to AWS
its free forever with a bonus 12 month free trial with $300 credits
it's always free, 24/7
im unable to use AWS free tier because it requires bank verification with my card
Yeah I heard that too
But how's the setup complexicity and uptime ?
if you go over the limit for bandwidth it just shuts off instead of charging you
"free forever" and "bonus 12 both free trial" don't make much in the same sentence lol
indeed but thats how it is
So should I increase the limit to avoid the api limits violation ?
any1 knows why this line of bug gives me an error? im new to bot developing and i followed a guide on yt but cant understand my mistake.
client.run(os.getenv('TOKEN'))
they give you 300 bucks worth of credits that expire after 12 months, you can use them for anything. after they expire, you can continue using the free forever stuff
Btw in your opinion oracle/AWS/Heroku and then comes Replit/GLitch, which one is good for small single server bot ?

you haven't defined the TOKEN environment variable
second one
Better performance ?
@quartz kindle @boreal iron turns out it's treated as an editted message in the api backend
use a free host then move on to a paid one
i made a new class and said TOKEN = (token) isnt that considered definding?
actual vps is always better
what ?
not in your code lmao
in a separate env file
Yeah since you are paying for it, but it's useless if the guild size is less than 5k, imo, right ?
Is that stated somewhere? I didn't read anything about that.
nope
Just asking in ddevs
yep
Is he talking about audit logs ?
Ah okay, good to know but should probably be written down somewhere
I'm not asking for support lol, I'm having a conversation based on previous topics
but yea
so are they going to fix or will not fix?
Ohh no I thought you were advising on that topic đ
Nah, I got pissed off with interaction followups
Yeah that's not really a solution, just useless work
i mean even if i dont use the env thing and write the token in the lient.run(os.getenv() it still wont work
Umm, ??
Also what might be the limits here like how many interactions?
Tim / FakE ?
huh what? I didn't follow your messages
@quartz kindle @boreal iron https://github.com/discord/discord-api-docs/discussions/4140 đ€
đ
I asked earlier that is there another way other than fetching audit logs to capture the amount of kicks ?
To which Tim replied this
SO that lead to me asking this
So should I increase the limit to avoid the api limits violation ?
How can I maintain that ?
technically d.js does it for you
client.on('guildMemberRemove', async member => {
const fetchedLogs = await member.guild.fetchAuditLogs({
limit: 1,
type: 'MEMBER_KICK',
});
// Since there's only 1 audit log entry in this collection, grab the first one
const kickLog = fetchedLogs.entries.first();
// Perform a coherence check to make sure that there's *something*
if (!kickLog) return console.log(`${member.user.tag} left the guild, most likely of their own will.`);
// Now grab the user object of the person who kicked the member
// Also grab the target of this action to double-check things
const { executor, target } = kickLog;
// Update the output with a bit more information
// Also run a check to make sure that the log returned was for the same kicked member
if (target.id === member.id) {
console.log(`${member.user.tag} left the guild; kicked by ${executor.tag}?`);
} else {
console.log(`${member.user.tag} left the guild, audit log fetch was inconclusive.`);
}
});```Code
You could either fetch them frequently or just fetch them if you receive a guildRemoveMember event
it has ratelimit logic built it
In case of raid will the ratelimits be hit ?
Like kicking100 accounts in a minute ?
Also this example here is based on when guildRemoveMember event happens, right ?
Banning should be a different event
sorry I meant kicks
You said you wanna try that out
Ban is easy
it has ratelimit logic built it
I can't test a raid đ
djs should queue your requests in case of a rate limit iirc
Ohh cool, so I won't have any issues of rate limit and nor the issue of missing something
usually not, no
Thanks
Btw anyone here used Railway for free hosting?
https://railway.app/
I actually use replit rn, but the code is public so I want to shift, and guild size is just 600 so I don't wanna buy a paid VPS/hosting also I'm learning so it's best to do on free ones
yeah but that free tier is probably even worse than replit lol
use a free tier like google or oracle
Well replit offers less, also isn't google free for 12 months only ?
A year is quite a long time
at least to grow and figure out new options later on
google has a free forever machine with 1gb ram
but it charges for network usage above 1gb per month
after the 12 months expire
plus some tax depending on the country you're from
ohh, is it same for oracle ?
for network charges ?
yes
And how big of a bot was that ?
at that time it was like 1500 servers
Damn !!
I will try google then, but ain't oracle offering looks better, may I know why you avoided it ?
iirc oracle has canceled others VPS's without notice, some have mentioned being charged unexpectedly
ohh so google is safe
how?
where ?
google's has 2 cpus now, oracle only has 1
also oracle wasnt a thing yet back then
and google's only had 500mb ram when i was using it
now they upgraded it to 1gb ram and 2 cpus
I've never had any problems with Oracle, they can't charge you unless you upgrade your account
no, i was talking about the image, they asked that in the verification process but idk
I wouldn't use oracle for anything other than free tier tbh
Many hosts charge for this 
yes
its a fractional cpu tho
you have 2 cpus, but they are shared with other machines, they are not dedicated cores
Well make sure to remove user information after 30d if a user isn't in your env anymore
still way better than many other things like glitch heroku
Hey noob question but can I have two client.on() ?
i have a lastUsed timestamp, i have to check if the user last used 30 days ago and is not in a server with the bot and delete his data. I need a structure
yes
but its not good practice to have the same ones multiple times
use them for different ones
Nah like I have one for message , another for guildMemberRemove and so on
yes
You can create routines in databases to remove rows older than 30 based on a timestamp for example
Also can you point me the link to that google one, homepage is looking confusing to međ
ÂŻ_(ă)_/ÂŻ
Not saying he's lying but seems a little bit suspicious that they would charge his card for no reason
They don't take payments through cards directly
They take payments through paypal
They only use your card to charge that $1 "verification" thing and refund it when you sign up
Google free tier also requires card info ?
this is the pricing page, scroll down to "e2-micro": https://cloud.google.com/compute/all-pricing
this is the free tier products page, that shows you get one e2-micro per month free: https://cloud.google.com/free
i don't know the part where i need to get the user and check if it's in a server because i have to check one by one all the lastUsed timestamps in the db and get only the 30d ones
Like I said I wouldn't use oracle's VPSs for anything other than free tier
Ohh you told 2 earlier, is that seperate plan ?
i said 2 cpus, not 2gb ram
you already said a lot of stuff today
i know there is a limit on how many times you can change the name of a channel but it there a limit on how many diferent channels you can rename in a sertain amount of time?
cus i have a list of channel that get renamed based on wether a server is online or not but idk how to slow down a for loop
youd likely want to test that yourself tbh, its very likely limited per guild
that type of ratelimit is dynamic, meaning some bots get higher ratelimits than others
lol
probably will want to use an interval not a for loop
but you cant continuasly loop through an array though can you? only iterate through the values once
wait are you on about setinterval? cuz i thought that was removed in newer versions of d.js
^^
coulda swarn i saw they removed something like that in the patch notes or somthing
that's a js thing
nah, they cannot do anything to that
Nothing to do with djs
fair enough
I wonder if its possible to remove js features with a library đ
no idea why you would do that, but still
ultimate troll library, super useful in every way but remove some random feature of js
and dont document it
ah
the first time i wrote reducers i had no idea what i was doing
its always good to study
that's what i learned
i could have saved so much time
mmm welp i looked through the docs and i cant see where it said they removed it
must have just read it wrong
but im sure it was there cuz it said setinteval and settimout where removed since the encouraged bad practice or something
they removed it from the client
discord.js used to have its own client.setTimout and client.setInterval
that was tied to the client instance, so if/when you did client.destroy() it would also stop all the timeouts and intervals created with it
aaah fair enough
Right
ah redid the whole thing with setinterval and it works alot better thx guys
how do i make my bot need some perms when its invited? (nodejs)
A small calculator that generates Discord OAuth invite links
thanks
err wut?
LIMIT supports an offset
SELECT * FROM database LIMIT 11,10
how would i get number 11-20
or SELECT * FROM database LIMIT 10 OFFSET 11 depending on db
How i can invite @pliant gorge bot to my server?
i added my bot it was offline now online how can i add my bot again
Hi want too know which software good for coding chrome or Microsoft
Like an IDE?
Meant Computer application
That's what an IDE is, but I'm not sure what you're asking
What is better IDE to do coding on
Depends on what language you want to use
depends on your preferences too
^
Am English
English

10/10 troll
I've never heard of the English programming language
Am new too this
we're speaking it rn wym
Like javascript, python, Java etc
If you don't have access to JetBrains IDEs, I'd recommend Visual Studio Community for C-style languages like C#, C++, C, etc, but for javascript/python I'd recommend Visual Studio Code
Visual studio code is pretty nice. No major complaints from me
But if you have access to JetBrains IDEs then those are usually the way to go (depending on preferences, I prefer visual studio code for javascript and that type of stuff)
Visual Studio Code can be annoying to set up for lower-level languages since it's basically a text editor with some extra features but overall I really like the simplicity
Idk why the would say that
?
Not quite sure what you are asking
Ah
Simple misunderstanding.
Typically most people know what programming languages are before looking for a code editor.
No big deal
Just new too this I have learning disability so processing take bit time for me
Notepad++ perfect since >10y
That's all good!
Dw about it
Just takes some time to learn
Am not going be removed am I
Nope
Thanks guys đ for help
đ gl!
why is heize putting her album names in rustdocs
@boreal iron the solution I came up with https://img.pyrocdn.com/85Kt4ODs.mp4
If you donât use a lib canât you just ACK the interaction (to not let fail) and respond with a simple message in the interaction used channel
I see you just send a message but I think you donât actually need the interaction response at all by just ACK it
For example instead of defer it with the loading state (bot is thinking) just acknowledging it and for example instead indicate a bot is typing action until the message is send
Might also be a smart solution
it just fails if you do that
yea i get err 400
lol
yea
Responding with a pong
Ah was typing didnât see your message
Defer it and delete it, yeah
Might also be a good idea
Might make sense even when deleting to keep it an ephemeral message in cases a rate limit takes in place
But I thought you can just ACK it
Hmm weirdâŠ
Maybe thatâs a feature for the future when Discord sends requests frequently to show your app as online
If it doesnât have the bot scope anymore
V
A
L
U
E

Yeah they never heard of nowrap I guess
Absolutely yeah
Still a shame you canât ping in the edit but yeah⊠thatâs how it is
i came up with an awesome D++ slogan lol

