message.delete();
const embed = new Discord.RichEmbed()
.setAuthor(`Support Module ${supportversion}`)
.setTitle("Ticket sent!")
.setDescription("Your ticket with an invitation link has been sent to our support server. Please wait patiently while we resolve the issue. Members may join to your server asking for ticket information.")
message.channel.send({embed});
message.client.guilds.get("686435271696187394").createChannel(message.author.id, "text").then(channel =>{
channel.setTopic("This embed's description is mapped by the user.")
channel.setParent('686446555447951403')
});
const embedtoserver = new Discord.RichEmbed()
.setAuthor("Support requested by "+message.author.id)
.setTitle("New ticket")
.setDescription(message.content+" ")
.setFooter("Note: Title and Description were chosen by user.")
await message.client.guilds.get("686435271696187394").channels.get(message.author.id);
message.client.guilds.get("686435271696187394").channels.get(message.author.id).send({embedtoserver})
#development
1 messages ยท Page 817 of 1
Not the best

yikesssss
stop mixing async-await and promises
pick one
and stop using await on methods that aren't async
What language is it?
you're also calling send on a user, not on a channel you created
wait
nevermind
lul
^^
Also I don't understand :p
look at your code
Okay
you're getting a channel with the id of the message author
anything seems off there?
No because I made it the name
YIKESS
@earnest phoenix
message.channel.send({embed})
You dont need {}
Ima get on my laptop cause on mobile ``` makes it look like a mess
^
@earnest phoenix so whats the error?
also remove the {} in message.client.guilds.get("686435271696187394").channels.get(message.author.id).send({embedtoserver})
I just did
I
I'm running it now.
There are 4.
(node:14) DeprecationWarning: Guild#createChannel: Create channels with an options object instead of separate parameters
(node:14) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined
at Object.execute (/home/container/commands/Support/remoteticket:24:99)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:14) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:14) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Also I changed id to username for the channelcreate
we do not exist here to give you idea for commands
i know
theres no point making a bot for the sake of making a bot with hundreds of commands
@earnest phoenix what are you trying to do?
but you can : )
Making a ticket command
find somthing youre passionate about and build that into features
hmmmmmmmmmm
instead of asking others to give you ideas
a cross server ticket?
you can use client.channels.get() instead of client.guilds.channels
are you trying to also send a dm?
Hi Tim
No. Just an embed inside of a created channel named with the message author username
ah so you are creating a channel
then you need to await it
creating a channel requires sending a request to discord, and waiting for it to be created
your code needs to wait for this
either by using await or by putting the code inside of .then()
await message.client.guilds.get("686435271696187394").channels.get(message.author.id);
``` is already implimented
thats not it
o-
await the channel creation
In that case my perception of await is totally wrong
.createChannel(message.author.id, "text")
if im correct it should be
.createChannel('name', "text")
the await keyword it used to wait for a promise to return a value
a promise is a request that cannot be resolved instantly, because it needs to wait for something
ie: anything that sends stuff to discord
but since javascript needs to have everything resolve instantly (or it would get stuck and block your entire program)
it HAS to continue one way or another
so a promise lets your code continue while it waits
so guild.createChannel returns a promise
you await this promise
to ensure the channel is properly created before continuing
The same error occurs D:
Tim now that you are here
let channel = message.mentions.channels.first()
What would be the code to make it so that mentioning the channel is optional
instead of .first
optional in what sense
module.exports = {
name: "rticket",
desc: "Make a new support ticket in the support server.",
usage: "",
cooldown: 5,
execute: async (message, args) => {
message.delete();
const embed = new Discord.RichEmbed()
.setAuthor(`Support Module ${supportversion}`)
.setTitle("Ticket sent!")
.setDescription("Your ticket with an invitation link has been sent to our support server. Please wait patiently while we resolve the issue. Members may join to your server asking for ticket information.")
message.channel.send(embed);
await message.client.guilds.get("686435271696187394").createChannel(message.author.username, "text").then(channel =>{
channel.setTopic("This embed's description is mapped by the user.")
channel.setParent('686446555447951403')
});
const embedtoserver = new Discord.RichEmbed()
.setAuthor("Support requested by "+message.author.id)
.setTitle("New ticket")
.setDescription(message.content+" ")
.setFooter("Note: Title and Description were chosen by user.")
await message.client.guilds.get("686435271696187394").channels.get(message.author.id);
message.client.guilds.get("686435271696187394").channels.get(message.author.username).send(embedtoserver)
}}
say command
you dont use await and then
you use either one or another
they are two different forms of awaiting a promise
.then uses a callback style
if you're on v11, createChannel should be correct, but the channel you're creating is not available
you're giving it into the .then only
Yes im on v11
if you want to use await then you dont need to use .then
let channel = await guild.createChannel()
then you also dont need to get it
you already have it
I was thinking about keeping await, removing then and putting the code insided of the current then() after it.
But that would require a var
yes, as i said above
also, you dont need to set topic and parent after
you can set them during channel creation
channel accepts an options object
that includes those
So Tim, about the mentioning channels. Its for a say command I have and I want mentioning a channel to be optional e.g.
(prefix)say <message> or (prefix)say #channel <message>
you have to do two things her, first check if a mention exists, then if it does, you need to remove the mention from the message and or check where in the message it is
using message.mentions will make it use that channel even if a random channel is mentioned somewhere randomly inside the message
ie, what would happen if you do (prefix)say some message # channel some more message
what do you want to happen?
or if there are multiple channel mentions
If there are multiple channel mentions I just want it to send to the first channel?
and the message?
should the message contain all channels?
should the message remove the first mentioned channel?
Just something simple like @limber sphinxs say command
im just saying the implications of using message.mentions
because it checks for mentions ANYWHERE in the message
if you want to make it simple, dont use message.mentions
use message.content.split(" ") then check if the first word is a channel mention
with regex or something
Oki
that will make it ONLY work if the channel mention is the FIRST word of the message
instead of ANYWHERE in the message
Depends on language
Python you can import system and psutils and get info from that
In js I'm not sure
For js I recommend systeminformation from npm
Use os
It's built in
Although, that's if you're using node.
Python can import os also I guess.
No wonder bot keeps getting 1hr ban, i added some code into d.js request handler to count request response codes and in total from each cluster theres about 1k 429's in about 5 minutes. tomorrow i'll add path logging to see which paths are being affected. isn't discordjs supposed to handle ratelimits and queue requests if it approaches one lmao
it is lol
I thought there was some bug with Sharding in Djs
you're using the shading manager right?
kurasuta
well idk about kurasuta
but i think another person who was getting 429s was using the sharding manager
yeah i'll log paths geting affected tomorrow, im suprised we arent banned by now lmao
its like 10k in one minute isnt it
idk whats the ban threshold
there are two issues about it on djs github
Sorry, js
If you're confident with js, use os. If not use systeminformation as it's easier to understand
is there anyone here who uses with eris?
ok
yea, i figured it out in the end. I used os
Nice
ty tho
Np
i'll send it in a bin
any ideas why my commands dont load or my bot turns on? https://hasteb.in/unoyelem.js
creates a new line in cmd
inneficient
also, you're defining it but not doing anything with it
im gonna increase resttimeoffset until i get a proper look so the bot doesnt go down every 5 seconds
what is line 12 and 16
it got banned just now ๐
what offset were you using?
im using 50ms lol
oh and, btw, that's not how classes work
i didnt realise what caused the problems until now
me?
i mean, the default offset is 550ms, which should be more than enough to not cause 429s
https://github.com/astrallyx/noire/blob/master/handlers/commandHandler.js i was trying to use this as an example
oh
and if you don't understand what's happening
a class is like a function, you dont execute it as is. you create it somewhere, then you import it and call it
and why exactly do you need eventEmitter?
bruh I didn't know js had static methods
i dont know. i thought that was the issue it wasn't working
c&p
you're trying to do a huge bunch of advanced and unneeded things for no reason
what do you want to do?
there are a trillion ways to make command handlers
you dont need to copy someone's exactly style or features
you're most likely copying/simulating features you will never actually use
which is a huge waste of time
code only what you actually need and actually gonna use
a command handler can be as simple as loading your files into an object
let commands = {}
fs.readdirSync(folder).forEach(file => {
commands[file.split(".")[0]] = require(folder+"/"+file)
})```
something simple like that would suffice for loading
then in your message event just check for prefixes and check if command exists
try to do something with the knowledge you already have
I would do a map so you have .get and .find
pls beg
hey guys
i want my bot to count members
like it should greet a message saying you are our 5th member or stuff like that
on member join get member count
We dont just give out a full block of code
https://srhpyqt94yxb.statuspage.io/api/v2/status.json How would I use this API in nodejs + discordjs? Just please say if you cant and dont say
thanks you
ok..
also
so my server greets members by mentioning them
client.on('guildMemberAdd', member => {
member.guild.channels.get('685958274725838920').send({embed: {
color: 3447003,
title: `Hi There ${member.username}! Welcome to the server!`
}})
})
why doesnt this work..
why does member name comes out undefined.
is there a way to make it mention a user?
${member}
Last time I checked, .toString converts it to a mention
future: <Task finished coro=<WebSocket.process_data() done, defined at C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\wavelink\websocket.py:124> exception=KeyError('threshold')>
Traceback (most recent call last):
File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\wavelink\websocket.py", line 139, in process_data
event = self._get_event(data['type'], data)
File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\wavelink\websocket.py", line 161, in _get_event
return TrackStuck(data['player'], data['track'], int(data['threshold']))
KeyError: 'threshold'```
Title field doesn't support mentions
**some text** in description
In field value yes
With command usage, how would I use split to remove the command from the args? Like .say Hello! would return "Hello!" instead of ".say Hello!"
^discordjs
Anybody have an idea with the error I posted above
code could help
me or culanndog?
async def do_stop(self, ctx):
player = self.bot.wavelink.get_player(ctx.guild.id)
await player.disconnect()
await ctx.send(f'Disconnecting from **`{channel.name}`**')```
```Task exception was never retrieved
future: <Task finished coro=<WebSocket.process_data() done, defined at C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\wavelink\websocket.py:124> exception=KeyError('threshold')>
Traceback (most recent call last):
File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\wavelink\websocket.py", line 139, in process_data
event = self._get_event(data['type'], data)
File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\wavelink\websocket.py", line 161, in _get_event
return TrackStuck(data['player'], data['track'], int(data['threshold']))
KeyError: 'threshold'```
Memory
@outer niche fucking learn to read
the error literally says it
Task exception was never retrieved
@warm marsh should've*
Thanks!
np
How would I add a command that sorta changes the guilds channel? I have a feature where my bot welcomes and goodbyes people, but how would I make a command that changes it and allows it to be a different channel compared to the one I set in my code?
Have commands that let people with the correct role/permission change the channel, welcome message and goodbye message. And save those values in a database
Hey anyone uses here glitch if yes pls help me
my glitch project is stuck here it does installation and stuck I tried refreshing it many times
and regenerated token
Isnt that just a warning for dependencies that aren't required
yeah
it was working properly yesterday
So what's the problem
I just install node-pre-gyp
You have shown a log that looks successful
for testing
Unless I missed something
it doesn't log anything my bot doesn't come online also
That seems more like a code issue rather than the screenshot you provided
no there's no issue I haven't edited anything in my project
from 5 days
Did you update discordjs
Because you want to make sure your code is even compatible with v12
it's node v12, discord.js master version
I don't think that's my bot issue
Like I said you should probably provide your code
As that log you sent
Looks fine
My code doesn't have any error
I haven't edited anything from 5 days
and yesterday it was fully working
Just because it doesnt have an error doesnt means something can't be wrong
Obviously something changed within that period
Iirc glitch has that weird timeline feature or something
Could always figure out if that helps
when I tried debugging its shows that in console https://prnt.sc/rej5le
what that means
my glitch console error
Taking 3 minutes to google the issue, try disabling glitch's debugger mode or whatever similar thing its called
done
now what next
You tell me
it didn't log anything in console still same
I just refreshed the project still same
Send a screenshot of your console
same
Create a new project that's all
tried that also
Did you actually turn the debugger off or just close the window
I turned off it my bot came online with an env file error
@earnest phoenix
yeah if add one it doesn't throws that error
but I want to add multiple any solution
anyone know how to make it so my bot says "Message sent!" when the dm gets sent
because my bot is basically like a dm thing
send dm message then send message in channel...
?
@earnest phoenix itโs suppose to be an array of iโm correct
i forget these things
oh i get it now
so chat command then make the bot say itโs kind
line*
sorry iโm on phone at the moment
send dm
once dm message sent then
send message in <message><guild> channel "message Sent!"
or just do client/bot.channels.find(ch => ch.name/ch.id === โid hereโ)
channel will be spammed with
"Message Sent!"
"Message Sent!"
...
dot post
const audioPlayer = client.getAudioPlayer(message.channel.guild.id); ```
```javascript
Error:
client.getAudioPlayer is not a function```
Discord Js V12
Anyone can help mention me
client don't have getAudioPlayer
ah ok
Yup, Thanks
Does anyone know how to do mass delete of channels? because im honestly stumped and im also doing automatic setup/disassembly
^^^Please ping me if you do
What language and library?
mass delete messages or channels?
java and javascript are two completely different things
thats what they want you to think
One message removed from a suspended account.
@forest junco u dont mean a lot of messages right?
I do not
is there any easy way to fix apt package misconfigurations
I have a load of shit thatโs configured multiple times and every time I do apt update it throws me like 10 warnings
Which is better for discord bot making: C# or Python (performance, response time, durability etc.)?
I know both good, so I think I'll use C#
can someone teach me to make bots?
-faq 3
Click that link^
Ok thanks for the help
Anyone know the possible reason that I canโt enter the password when I tried connecting to a Linux VPS bought from DigitalOcean?
Wdym
be a little more specific
The password field is invisible most likely
^^
its not the vps fault neither the provider, its the app fault
i recommend if you still on android, Lemon SSH
yes but its best for the nonexperienced ones.
Is good idea to use Kubernetes to host bot?
The password is hidden for security purposes and reasons
In newer linuxes, this show *s instead of nothing
it depends on the software
Ubuntu and other like this have it now
My LM show this
I thought the ssh cli did it
i am yet to use ssh with a terminal that does not blank the entire password
How can I check if any moderator is online from a server
I try with forEach and as we know it send message for every person
I want only one message
Put all the moderators in a list and use that list to generate a message
Which lib
Im trying to make a egg command
That hatches pets but uses percentages so its a little harder to get legendary pets
How do i make it so the bot chooses from a list but picks a random one depending on what the chances are of getting the pet? It doesn't have to be percentages it can also be a decimal
Math.random()
Hey! Are invite links allowed in an error embed? (as a hyperlink)
Like join our support server here
yes
V12 is gey
its not lul
nobody is telling you to change
well, then you should expect it, and not complain lmao
major versions always have major changes
I will make an back up and redo do it when I am free
Plus I want to try this sodium
Is it better than ffmpeg
sodium is a cryptography library
it doesnt replace ffmpeg
just helps with parts of it, like encoding/decoding
what error
you must give it an options object
.delete({option1: value1, option2: value2})
delete({timeout:5000}) in v12
split does not modify the original value, it creates a copy of it
interesting
a = "string"
b = a.split("")
a is still a string
b is an array
Well yea I can but wouldnt future discord updates not mess up with bots that stay in v12? @quartz kindle
V11*
v11 will not stop being updated
at least not for some time
like how windows xp didnt stop receiving updates after windows vista/7 appeared
and still worked for a long time
So im good with v11 then
yes
Nice
function-name()
e.g. function boi() { return false }
could use return
bruh im terrible at asking stuff
function boi() {
return false
}
boi() //how do i know results here
I'm rewriting my bot's rewrite lol (:
let shitthatmyfunctionreturned = boi()
console.log(thatvariableaboveimtoolazytotypeagain) // false```
@honest pebble in this code boi() returning as false
because there is return false
so can if boi() == false
yes
oh
Please I getting my bot to glitch becous my hosting is not good but I can't upload folder node_modules
Can someone help me ?
error?
files upload failed try again
Yep
I'm on glitch first 3 min.
End errors is found ๐
So why bot is not running ? ๐
glitch installs node_modules from package.json file
check everything again
Is it need package-lock.json ?
no
And npm-debug
So ja file of bot and config.json
.env ?
config.son
Ok
And that things what is on glitch I can delete ?
The files what is on project created automaticly
views folder can be deleted
public folder can be deleted
everything else is require
server.js have bot code or not?
first learn how to take screenshot pls
no
how it gonna start without code?
i know
also, don't use flash when taking a photo of something glass-y
u maybe created new node app in glitch
not added code yet? right? or changed any file
package-lock.json?
package-lock.json is a lockfile
em ๐ okey
on glitch it's a little different
is hard for me with json I dont do anzthing ๐
wdym
What
where have u hosted ur bot
I dont understand json files Idk how to create package.json is hard for meto understand
on a vps or glitch or ur computer
@sick apex there should be a json file in ur project
named package.json
my brain is too smol to think of how to do this,
in js, how could i fill a "default" object with the items of submitted things. in order to only for example; push database entries that have the right values and none that you don't want.
atm when i push database objects i just do things like this;
insert({
value1: submitted.value1,
value2: submitted.value2
etc etc, adding only the things that should be in there
})
i want to be able to look at the default server config object, and make sure that it has all the keys in that object, and no keys that aren't.
it would be as simple as using Object.keys etc etc if it was just one object, but in the submitted and in the default config, there's objects inside of it (like { ex: {...}}) and i can't brain my way a solution
the goal would be only having to change stuff in the default config and the database pushing would just work with it
to add a module u can click on add module
havenโt even created it yet, I just want to download the fucking node.js
.

I tried
what happens?
nothing succeeded
u have node.js installed before?
No
@slim heart you mean like a schema?
i believe so? never worked with schemas
neither have i, but several ORMs such as sequelize have them
tim
basically you want a default object with a bunch of default values, right?
in SQL is a new table made if the primary key is different?
you could define such an object somewhere, then import it as a deep copy/clone
i think i came up with something, just iterating through them, if it doesn't work i'll try and look at schemas
@finite bough wydm? tables are not created automatically
like
client.on(ready......
so doesnt it mean it makes a new table or searches for it whenever it is ready
please can somone who have hosted him/her bot on glitch send me packkage.json it dont started >D
the ready event has nothing to do with sql or tables? i dont understand what you're talking about
Anyone know about mongodb? If so does self-hosting get rid of the limit on how much you can store?
how can i tell if something is a {} object? things like arrays are also counted as typeof == 'object' and also sets off instanceof Object
the limit for self-hosting is how much ram/hdd your server/machine/computer has lol
@slim heart there is Array.isArray()
Yeah, But I mean there isn't a limit for like you can only store 1000 entries or some rubbish like that.
but for objects there is not, there are a few tricks tho
is there Object.isObject() lol
yeah things like null are counted as objects too
i could just see if they're any of whatever else is counted but seems dirty and there's gotta be a way to do it
You could use constructor.name?
for objects there are several ways, the most common implementation looks like this
function(a) {
return (!!a) && (a.constructor === Object);
}```
hm ok
please I want to host it but it not responging with any err and it bot is not online
// Check if the table "points" exists.
const table = sql
.prepare(
"SELECT count(*) FROM sqlite_master WHERE type='table' AND name = 'scores';"
)
.get();
if (!table["count(*)"]) {
// If the table isn't there, create it and setup the database correctly.
sql
.prepare(
"CREATE TABLE scores (id TEXT PRIMARY KEY, user TEXT, guild TEXT, points INTEGER, level INTEGER);"
)
.run();
// Ensure that the "id" row is always unique and indexed.
sql.prepare("CREATE UNIQUE INDEX idx_scores_id ON scores (id);").run();
sql.pragma("synchronous = 1");
sql.pragma("journal_mode = wal");
}
// And then we have two prepared statements to get and set the score data.
client.getScore = sql.prepare(
"SELECT * FROM scores WHERE user = ? AND guild = ?"
);
client.setScore = sql.prepare(
"INSERT OR REPLACE INTO scores (id, user, guild, points, level) VALUES (@id, @user, @guild, @points, @level);"
);
client.getrank = sql.prepare(
`SELECT * FROM scores WHERE guild =? ORDER BY points DESC`
);
});
like that^
which primary key are you talking about?
different primary key where?
SELECT and INSERT dont create tables
your code should work, but if you want to improve it, a more efficient way would be to use IF NOT EXISTS
yea
I was asking that
coz
when the bot is rebooted
it kinda adds up the load
and the ram kinda touches the roof xd
so I am trying to get a better code for some parts
i dont think that code would do that
how much ram are you talking about?
because discord.js alone uses a lot of ram by default
it's my test bot so it has almost everything
reading mags editing files and stuff takes ram
mags?
is eris significantly faster/uses less ram?
ik bad choice I am changing it to sql
that would still not use that much ram
i havent used eris, so i cant say, but i dont believe the difference is much
glitch has like 200 mb ram ๐ณ
isnt it 512mb?
anyway, in general commands, files, loading and database all together will not use a lot of ram
maybe 1-10mb
500MB
what uses ram how many users you have cached and saved in a database
and what if I edit 7 files per msg
using fs-extra
how many guilds bot have
it will cost ram if it has to build a huge queue while its waiting for thousands of pending reads/writes
๐
I goes with tutorial and it dont start xDDDD
are you editing 7 files on every message or only commands?
why?
why
ah
i mean, doing 7 i/o operations is not good, but if its not being done on every single message ever, then its not that bad, and not the reason for high ram usage
1 file is like action log
is that log a json file?
yes
json files are not good for logs
ik I said I am changing to sql
ewww
if you want to have log files, use a simple text file
well
because on a text file you can use fs.append to write only to the end of the file
while in a json file you have read the entire file then save the entire file, otherwise the json structure breaks
the bigger the file gets, the bigger the performance difference
even it's resets data
isnt json itself is a bad idea xd
json is never good for something dynamic
imagine loading 10mb of data, editing 1 byte then saving 10mb of data, when you can simply write 1 byte directly to the end of the file
json is bad for logging, you can't append data without rewriting the entire file
tim already said that lmao
json is bad for logging, you can't append data without rewriting the entire file
ok i've heard that three times now
XD
json is bad for logging, you can't append data without rewriting the entire file
that's bc json is bad for logging, you can't append data without rewriting the entire file
4
For logging isnโt it average to use txt files?
called it
๐คฆ
5
@crimson vapor yeah, you use log files
No?
yeah text files are better
linux uses text files for logging, and it does a stupid amount of logging
because you don't need to rewrite the whole file
what if I want to get a info from txt file
Text files aren't the best logging practice but eh, if you do it right why not
ยฉ someone who doesn't log anything
you get info by transversing the file using a stream
twitch?
yt?
log files are not meant to get info from with the bot, they are only meant to have a log of errors and maybe some information for a human to read
pornhub?
no lol
what is going on lol
well that escalated real quick
quick log: from ram usage to streaming on pornhub
but where do you save your quick log?
on the stream
anyway, depending on where your bot is hosted, it would probably be a better idea to log to console instead of files, but if you absolutely want to log things to files, use a text file and append data to it
then if you want to read this file, read it as a stream, you can even use node's built-in read-line module
that will enable you to process the file line by line without loading the entire file into memory
I have a question, anyone can answer:
If you know the bot Tupperbox (runs on js or node.js), you would know that it makes "dummy" bots with various properties, also displayed as (BOT).
Is such thing possible to do in discord.py?
you mean webhooks?
webhooks are a message that appears as if written by a bot
those are webhooks
And when you click the author of those written by Tupperbox, it shows a name and profile picture.
#0000
yes, it's webhooks
that would be the discriminator
I need to figure out how it works more...
So Tupperbox adds webhooks to every channel?
conclusion: logs can't be in the console
a webhook is a way to send a message to discord without an account, it sends a message directly to a specific discord URL, that if allowed, will repost that massage in the according guild/channel
damn phone keyboard
you can create a webhook in your guild settings
and then send data to the webhook url you created
So how does Tupperbox send a message with a name and profile picture without said account
a bot can do both, send data to this url, or create one if it has permissions and then send it
the data you send to the webhook includes ability to customize name and profile picture
@pale vessel I m ur god not webhooks
let me edit
console logs dont stay forever, but usually logs are never meant to stay forever
discord.py has methods to send webhook messages with different names and images
tim do u use css in astrobot
a tiny bit
my bot is spamming welcome message
client.on("guildMemberAdd", async (member) => {
const db = require("quick.db")
var welcomechannel = await db.fetch(`welcomechannel_${member.guild.id}`)
var Channel = member.guild.channels.find(c=> c.id === welcomechannel)
if(!Channel) return;
let embed = new Discord.RichEmbed()
.setColor(config.Green)
.setDescription(`Hello ${member.user.username}, and welcome to ${member.guild.name}!`)
Channel.send(embed)
})```
i didnt bother customizing the page much
why is it D:
and canvas edit?
ah you mean the image generation? it uses only canvas, js and fonts. no css
@earnest phoenix have u ever used const db = require("quick.db") outside a code
no I meant css and convas selerate
coz @earnest phoenix
either remove const inside the code
or use let in all the places instead
or var
ur wish
const is used when u r declaring a common term for the whole file
@earnest phoenix that is likely not the issue tho, show your message event
which should not be changed
or maybe nested event
How can I check if any moderator is online from a server
I try with forEach and as we know it send message for every person
I want only one message
??? @finite bough
@pallid zinc wdym? explain better
by their status ig
no
You can filter the people with the MANAGE_MESSAGES perms and choose the first one?
just loop through the members, if their online and have moderator role, then add them to a list of online peeps
then do whatever you want with the list
^
Trying to make a mod-mail bot it's done but I want it to send a message if non of the moderator are offline
like an emergency system
oH
Least one
yea so
Ok
So filter out the members that donโt have perms and check if there are more than 0
if you dont wanna check for a role then check for certain permissions instead
^
If all moderator are off it send wait for some time
wdym?
Umm its fixed
what lang is this?
i had one of the codes in the message event by accident @finite bough
idk why
@crimson vapor thanks I got it
oh. if all of the moderators are offline, it'll send a message telling to wait
ok
Yes flazepe
D.js or py? Or java?
Js
disgord
v11 or v12?
.presence.status
filter them to online and if it's empty, send the message
if I would make a cmd to do that I will check if any of the mods have their status have dnd || online || idle
else message.channel.send(wait for some time)
or !== offline
yes
no i meant type it slash pipe
thats a spoiler
if they would have done dnd \| online \| idle
endgame spoiler
he cba to do that
reee
i can do without escape that :)
well yea
but
i have the switch on to autoconvert
lets me do both โค๏ธ and <3
<3 and \<3
you gotta give more details than that man
details could help
Yeah i'm getting on it man
good man
the guildremove event gets fired everytime i restart the bot
no status
so i think
the ready event isnt firing
what that event for?
guildDelete
yeah
when the bot is remvoed from a server
I know
So i log it in my console
I mean what does it do? Remove something from the database?
show your guildDelete code
oh
can we see the code?
client.on("guildDelete", guild => {
console.log("Left a guild: " + guild.name);
});```
name is always undefined
Left a guild: undefined
cuz it already left
no
you cant get guild info if a guild you arent in tho?
:/
it gives the guild data
Yeah lmao
try logging guild and see what it returns
try logging guild and see what it returns
yeah doing it
@pale vessel Its back now
When i was asking for guild.name it was crashing
When i removed that and added just guild its working
I removed the full event
but it must return a collection
It didnt fire when i edited
that guild didnt fire again
it might have got resolved
glad it worked out for ya
Yeah thanks
Guys
what
no
Help me to downgrade discord.js
What
11.6.1
then the other one
What is a recommended version?
11.6.1
same
https://hasteb.in/jewenobi.js Any ideas why my bot is not turning on? cmd just creates a new line
with eris
node [file]
if you want node . to work make sure your package.json is configured properly
wait, i accidently done index.js which isn't my handler file
my handler file is bot.js
and same output
my bad
my index file is uh
copied again?
show your file
literally two things were copied from that but ok
easier, just show the directory tree
ok
that's the index file
yeah
i did post my bot.js but i was told to post my index.js





