#development
1 messages Β· Page 1009 of 1
and i dont understand
liek
embed pages
or
discord pagination embed
its been hard ;x
Emojis have "codes"
π this emoji has the code :banana:
U can see the codes here
you need a handler which keeps track of the page it is currently on
hey
i suggest while loop
let page = 1
while(page <max){
//logic
}```
inside reaction collector
how to overwrite permissions? v12 discord js
help
i have overwritePermissions
but itsa qrong apparently
@earnest phoenix Can you give me the secret to obtaining ram usage you would say tomorrow and it's tomorrow so pls 
bot.shards.ids
thanks
hi boeing
RIP I will never know the secret to ram usage π¦
https://sourceb.in/9a59ba25d7 my code it is not muting them π¦
like they can still talk
but they have role
π¦
Does someone know a tutorial for server whitelist
the problem is with the role
@finite bough tell me then of whats wrong
u have to remove the send messages perm on ur muted role
i have
smh read my code
in dbly, on_db_vote, the data is in json format right?
bruh
someone he;[
help me
@earnest phoenix regenerate you bot's token
You just posted it in a server with 111,000+ members
With...?
I don't even understand what you want
Errors?
But what is being logged on the console?
What does it say
for some reason this isnt working?
@earnest phoenix thescript is impossible to read
?
;uhh
idk what is sharding
Hey
did you have the internal shading Manger running?
well then
then remove it
Anyone knows python here
im using this for discord bot
just ask
just ask here mate
you cant use it when you dont have the internal Sharding Manager running
you dont need one. its only needed when you aproach 2500 guilds
i dont get what you want to point to?
nvm
In wwebsocket client
On_message I am getting str
I want to convert in json
Any one can help me
@pale vessel
make the ffmpeg found
import dbl
import discord
from discord.ext import commands
class TopGG(commands.Cog):
"""Handles interactions with the top.gg API"""
def __init__(self, bot):
self.bot = bot
self.token = '' # set this to your DBL token
self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True, webhook_path='http://bothook.herokuapp.com/webhook', webhook_auth="") # Autopost will post your guild count every 30 minutes
async def on_guild_post(self):
print("Server count posted successfully")
async def on_dbl_vote(self, data):
print(data)
user = data["user"]
mem = self.bot.get_user(user)
await mem.send("Test")
def setup(bot):
bot.add_cog(TopGG(bot))
print("Topgg loaded")
why its not sending
dm?
I get a TypeError: Cannot read property 'me' of null error with this line const bot_mentioned = message.mentions.has(message.guild.me); but most of time it has no issues when its pinged, but I've had this twice so far. i use discord.js
@pale vessel my entire code:
if (message.author.bot) return;
if (message.content.includes("@everyone")) return;
if (message.content.includes("@here")) return;
const bot_mentioned = message.mentions.has(message.guild.me);
if (bot_mentioned) {
const mention = new Discord.MessageEmbed()
.setColor("BLACK")
.setTitle('Roleplay Helper')
.setDescription('Roleplay Helper was mentioned')
.addField('Prefix:', 'RH-')
.addField('Help command:', 'RH-help')
message.channel.send(mention)
}
})```
Why do i get this error with MySQL: Error: connect ENETUNREACH and Error: connect ETIMEDOUT?
your network is unreachable
Okay so I know why its causing the issue, whenever you DM the bot it sends that error
that's not caching issue
DMs don't have the guild property
because, well, it's not in a guild
it only sends the error when its dmed though
Thanks
@pale vessel The thing is quite strange: the database is correctly accessible from my PC and from any service (for example Glitch). If I try to connect from a private host, where my bot is, I get these errors.
@earnest phoenix You forgot listener decorators
when I run the code it's say UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined and idk why ```java
const fs = require('fs');
const Discord = require('discord.js');
const client = new Discord.Client();
const {token} = require("./config.json");
client.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.name, command);
}
client.on("ready", async => {
console.log(${client.user.tag} is ready)
client.user.setStatus("dnd")
client.channels.cache.get("name", "chat-universel") .send("test..s")
});
client.login(token)```
@restive pebble Error: connect ENETUNREACH and Error: connect ETIMEDOUT
glitch?
No
heroku
what db
MySQL
restart it ur server
Bot host or database host?
oh u using ftp?
try both
ftp?
No
ok
I can't restart the db host, the bot host is already restarted
How can i do to my bot to send a message to the person that added the bot to a server
The problem with this error is that it appeared out of nowhere, the bot had been working with that host and that database for months now, but yesterday decided to start giving errors
How can i do to my bot to send a message to the person that added the bot to a server
@jovial nexus whats ur lib
Without changing any part of the code
discord.js
use guildCreate event
How can i do to my bot to send a message to the person that added the bot to a server
@jovial nexus i dont think there is way
u can send to guild tho
use guildCreate event
@restive pebble @earnest phoenix Any solution?
idk
guys
Yes
try contacting ur host then
But not on my private host
@restive pebble bruh what the fuck happes to youtube API
it's been 24 hour
my quota resteted
but

u can come for ytdl issues
this is error i get
Okay, then I'll contact the host to see if I can fix it
video url
const yts = require( 'yt-search' )
yts( songname, function ( err, r ) {
if(err) throw err;
let videos = r.videos
let url = videos[0].url
})
wait
what
@restive pebble this is start up right?
and after that same code will be there?
u can video link
pog
im coming for 75
try { var playingMessage = new MessageEmbed() .addField("**:emoji_1: Now Playing**", ${song.title}) .setThumbnail("https://cdn.discordapp.com/attachments/716372313141936280/727338064526966784/99f34b2b899f9f4275080a9e6ea56b9d.gif") .setFooter('Lark!|Developed By Atanu AD!#6566', 'https://cdn.discordapp.com/attachments/716226531868934194/726264086567845888/320d94e973b73de5f232c2cf5403d75d.webp') .setTimestamp(Date.now()); queue.textChannel.send({embed: playingMessage}).then(embedMessage => { embedMessage.react("β"); embedMessage.react("β―"); embedMessage.react("π"); embedMessage.react("βΉ"); }); } catch (error) { console.error(error); } const filter = (reaction, user) => user.id !== message.client.user.id; var collector = playingMessage.createReactionCollector(filter, { time: song.duration > 0 ? song.duration * 1000 : 600000 }); collector.on("collect", (reaction, user) => { if (!queue) return; const member = message.guild.member(user);
Help me
In this code
Showing playingMessage.createReaction is not a function
This is a reaction control music code
Help me
Library?
discord.js
itβs react, not create reaction
Thatβs fine
Sorry by mistake i tell you createReaction
Its createReactionCollecotr
`const filter = (reaction, user) => user.id !== message.client.user.id;
var collector = playingMessage.createReactionCollector(filter, {
time: song.duration > 0 ? song.duration * 1000 : 600000
});
collector.on("collect", (reaction, user) => {
if (!queue) return;
const member = message.guild.member(user);`
See here the whole formation
This is the error section
If anyone here plz help me
@slender thistle , ya have added event decorators, but now also its not dming
So when you make functions and use them without () it shows you [function] how can i make it show
[function: <function name>]```?
i am having problems with ubuntu postgresql setup
i am having problems with ubuntu postgresql setup
@plucky harness what's the issue
i followed this tutorial
and basically i am getting forbidden error. you dont hav perms to access this file
i did it using root? is that the problem
did you gave the file execution permissions? or the folder?
or choose easymode and start a docker container
Sa
execution perms?
had issues with 3 MongoDB installations. after a day i was just fuck it i use docker
docker?
just as a side note, pgAdmin 4 will give u a LOT of headache about "missing" CSRF token
oof
I gave up after 2 weeks trying to fix it
then what do i do with my psycopg2 database
@plucky harness did you set the permissions?
lul
you gotta give perms to postgres:postgres
sammy is an example
umm
hi, i have this: js app.get('/chat', async (req, res) => { res.render('chat'); }); but it says that I says in the console i went to the 404 page... but it shows the content of /chat's endpoint.. can anyone help? my code:
what os did you use @plucky harness
ubuntu
hmmm
20?
Digital Ocean?
gusy can you help me with this i have made this code if(message.author.id === "645592347475836949") return;
i want it to check if the id match
if not return it
what it does rn is if id match it will return it
try this tutorial https://www.digitalocean.com/community/tutorials/how-to-install-postgresql-on-ubuntu-20-04-quickstart the one you got was for vitual enviroments
(edited url)
if you are to lazy you can get a VPS that got already Postgres installed. Digitalocean as example offers it
anyone got any ideas?
is there a db that does reset to github state for heroku?
non-embedded dbs
?
like mysql, postgresql, etc
uhh
sqlite dbs if you got the sql file in the repo
pls help
whats wrong typical
you were using json as db, weren't u?
sqlite dbs if you got the sql file in the repo
@lusty quest ok but like doesnt it reset?
you were using json as db, weren't u?
@lyric mountain ye
you want one that reset?
i stated up but here
you want one that reset?
@lusty quest no not reset
?
json ain't a db, stop using it plz
@lyric mountain ok
if(message.author.id === "645592347475836949") return message.channel.send(you need to be the bot owner to use the cmd)
i want it to check if the id match
if not return it
what it does rn is if id match it will return it
then get a externally hosted one like Postgres, Mysql or MongoDB
mongodb i know you can get a free hosted DB
then get a externally hosted one like Postgres, Mysql or MongoDB
@lusty quest ok i have porstgres i just dont know how to use it
i guess google is your friend
ok
mysql also has "free" hosts, but....well.....I'd not trust "free" services
i guess google is your friend
@lusty quest oof
@lyric mountain same here
free has usually some downside
either its laggy AF or they delete it bcs you used more power than they expected
@spare mirage thanks soo much
np I had that problem too
if you know how to fetch things, you could periodically backup the sqlite database to some file hosting service like drive
then get the database back on boot up
i guess this is at the same level complex than learning sql
sqlite is sql, so.....
if you get it running it should be fine
yea but there is no reason to add a extra point of failure if you can make it proper
so how can i make a db? mongo
mongo, sqlite, mysql, postgres, json (DON'T), just choose one
In terms of performance, there technically is
well im storing server ids
tbh
and stuff
i might make a coin system and xp system soon
people say mee6 is the best
mongo is slower than sql-based dbs when it comes to heavy relationship
mee6 is garbage
Mee6 is not a database
mongo is slower than sql-based dbs when it comes to heavy relationship
@lyric mountain heavy relationship?
well what do you recommend? @slender thistle
no, I mean relationship between tables
the features are garbage
like i want to store user ids and server ids
for a xp/coin system and set prefix cmd
the features are garbage
its just overrated
I don't see how Mee6 is related to the current conversation
it ain't
Also this is a channel for... well, coding stuff
there ain't a "best" db
bruh
smh
Not in this context
omfg
Data Base
helloo
const Discord = require('discord.js')
module.exports = {
name: "dumb-o-meter",
description: "Checks your dumbness lol",
async execute(message, args) {
let d = Math.floor(Math.random() * 100 + 0.1)
message.channel.send("Alright, Let me check how dumb you are. Hmmmmm...").then((message)=>{
if (d <= 45){
const embed = new Discord.MessageEmbed()
.setColor("GREEN")
.setTitle("Your Dumbness Analysis, Provided by the One & Only **Dumb-O-Meter**")
.setDescription(`You are ${d}% Dumb`)
.setFooter(`Requested by ${message.author.username}`)
.setTimestamp()
message.edit(embed)
}
if (d > 45 && d < 70){
const embed = new Discord.MessageEmbed()
.setColor("YELLOW")
.setTitle("Your Dumbness Analysis, Provided by the One & Only **Dumb-O-Meter**")
.setDescription(`You are ${d}% Dumb`)
.setFooter(`Requested by ${message.author.username}`)
.setTimestamp()
message.edit(embed)
}
if (d > 75){
const embed = new Discord.MessageEmbed()
.setColor("RED")
.setTitle("Your Dumbness Analysis, Provided by the One & Only **Dumb-O-Meter**")
.setDescription(`You are ${d}% Dumb`)
.setFooter(`Requested by ${message.author.username}`)
.setTimestamp()
message.edit(embed)
}
})
}
}
this is my code
also almost no one uses that abbreviation in this server, Jesus Christ
how do i
.then(() => message.delete())
well what do you recommend?
like i want to store user ids and server ids
for a xp/coin system and set prefix cmd
@slender thistle
yes
For medium-sized bots, mongo is good, but it doesn't have a built-in caching system
caching like what?
and less database accesses
Where did you add the delete call?
show your changes
Saving stuff in memory
@slender thistle hmm im not sure well my bot is in 250 servers so would i need a better db?
const Discord = require('discord.js')
module.exports = {
name: "dumb-o-meter",
description: "Checks your dumbness lol",
async execute(message, args) {
let d = Math.floor(Math.random() * 100 + 0.1)
message.channel.send("Alright, Let me check how dumb you are. Hmmmmm...").then(() => message.delete()).then((message)=>{
if (d <= 45){
const embed = new Discord.MessageEmbed()
.setColor("GREEN")
.setTitle("Your Dumbness Analysis, Provided by the One & Only **Dumb-O-Meter**")
.setDescription(`You are ${d}% Dumb`)
.setFooter(`Requested by ${message.author.username}`)
.setTimestamp()
message.edit(embed)
}
if (d > 45 && d < 70){
const embed = new Discord.MessageEmbed()
.setColor("YELLOW")
.setTitle("Your Dumbness Analysis, Provided by the One & Only **Dumb-O-Meter**")
.setDescription(`You are ${d}% Dumb`)
.setFooter(`Requested by ${message.author.username}`)
.setTimestamp()
message.edit(embed)
}
if (d > 75){
const embed = new Discord.MessageEmbed()
.setColor("RED")
.setTitle("Your Dumbness Analysis, Provided by the One & Only **Dumb-O-Meter**")
.setDescription(`You are ${d}% Dumb`)
.setFooter(`Requested by ${message.author.username}`)
.setTimestamp()
message.edit(embed)
}
})
}
}
might look dumb
use a bin
omg
cuz i think its wrong
Can't edit a deleted message
umm help discord.py
It depends on the amount of resources your bot uses. However, I think it's safe to use mongo in your case
put the .then there
wait no
ok so how do i setup mongo?
@weary ridge did you read the explanation on the last line?
OR the documentation for praw?
then put it here
well, actually yes
What do i do from here?
"as a keyword argument to the Reddit class constructor"
that doesnt delete the embed?
@vale garden to delete the user's message all you need to do is use.delete()on the received message
not on the bot's message
why would you want to delete it
there's an example
k
@vale garden to delete the user's message all you need to do is use
.delete()on the received message
@lyric mountain wdym
#development message @slender thistle
Hang on, the documentation provides examples and helps you fix your own issues? Who would've thought /s
the issue is here
Is that Compass?
you're defining "message" twice
so you can't get the user's message object anymore inside the arrow function
is ytsr even a working module anymore
change the name of the former and use .delete() on it
oh ok
Is that Compass?
wdym
That's not Compass
heβs asking if thats mongodb compass
k it's not
Compass is the desktop viewer for MongoDB
Atlas is the online version
const Discord = require('discord.js')
module.exports = {
name: "dumb-o-meter",
description: "Checks your dumbness lol",
async execute(message, args) {
let d = Math.floor(Math.random() * 100 + 0.1)
message.channel.send("Alright, Let me check how dumb you are. Hmmmmm...").then((m)=>{
if (d <= 45){
const embed = new Discord.MessageEmbed()
.setColor("GREEN")
.setTitle("Your Dumbness Analysis, Provided by the One & Only **Dumb-O-Meter**")
.setDescription(`You are ${d}% Dumb`)
.setFooter(`Requested by ${message.author.username}`)
.setTimestamp()
m.edit(embed)
}
if (d > 45 && d < 70){
const embed = new Discord.MessageEmbed()
.setColor("YELLOW")
.setTitle("Your Dumbness Analysis, Provided by the One & Only **Dumb-O-Meter**")
.setDescription(`You are ${d}% Dumb`)
.setFooter(`Requested by ${message.author.username}`)
.setTimestamp()
m.edit(embed)
}
if (d > 75){
const embed = new Discord.MessageEmbed()
.setColor("RED")
.setTitle("Your Dumbness Analysis, Provided by the One & Only **Dumb-O-Meter**")
.setDescription(`You are ${d}% Dumb`)
.setFooter(`Requested by ${message.author.username}`)
.setTimestamp()
m.edit(embed)
}
}).then(() => message.delete())
}
}
Are you using MongoDB Atlas or are you hosting a MongoDB server locally?
Are you using MongoDB Atlas or are you hosting a MongoDB server locally?
@slender thistle wdym
dot dot dot
You deleted the wrong message again
its my first time using mongo
lol
Let's try again
How did you get go that page
@slender thistle if you want higher performance with mongo a replica set can archive higher speeds if you set it to prefer secondary nodes for read. or Shard it if the data is across the shards you read of mutiple shards at once
hmmm
i searched mongo db on google and clicked first link
So scalability, essentially
yes
which?
So scalability, essentially
@slender thistle what?
I was responding to the mention I got just above
which?
@lyric mountain second one i think
I was responding to the mention I got just above
@slender thistle k
@lyric mountain atlas for free mongodb instance
should i download this? @slender thistle
yes
its my first time using mongo
@earnest phoenix MongoDB hosting explained:
MongoDB can be hosted in local or with Atlas (Online hosting with clusters)
Compass is a GUI for the database both online or local
its for accesing the DB
Hmm, maybe define it?
@vale garden what happened here?
@earnest phoenix MongoDB hosting explained:
MongoDB can be hosted in local or with Atlas (Online hosting with clusters)
Compass is a GUI for the database both online or local
@ebon kelp ok so uhh should i do local im not sure what it is
:/
2 instances running
@earnest phoenix no, you can do both
wat
@earnest phoenix no, you can do both
@ebon kelp im confused how
like, what's the expected outcome?
@shivaco#0542 umm im confused on this part
Why did you put my mention in codeblock
@ebon kelp im confused how
@earnest phoenix What is the problem in the first place? Wasn't there since the beginning
@shivaco#0542umm im confused on this part
super ultra master plus stonks
@earnest phoenix What is the problem in the first place?
@ebon kelp i dont know how to use
except the first line
so it didn't @ u
needs to be deleted
I don't think your current approach will work, as you will always end up either deleting the user's message or the message with the embed
then what can i do
Just mention me properly next time if you want me to actually see your message
im installing compus
Either remove the message's text and only add the embed or remove the message and send a new one
compass
the first message was deleted
@ebon kelp i dont know how to use
@earnest phoenix A MongoDB atlas cluster can accessed with a link
the message.delete() did it
k ?
in my test command
const api = require('novelcovid');
const Discord = require('discord.js')
const client = new Discord.Client()
module.exports = {
name: "test",
description: "Checks a weather forecast",
async execute(message, args) {
message.channel.send("lolll ok okkirjwe;34eb2ve4revryvhrvrvloooooloolo ll l lo o o o o o lol").then((message)=>{
message.edit("Gone.. Reduced to Atoms.")
})
}
}
it worked normally
@earnest phoenix A MongoDB atlas cluster can accessed with a link
@ebon kelp uhhh.. im not sure how can we take to dms or smth
In embed.fields.0.value: Must be 1024 or fewer in length.```
Embeds value must be less than 1024?
yes
1024, yes
Oooh
it must be less than 1025 characters
So I need to check?
Yes
How's Possible to get a random number between specific numbers? Like get a random number between
50 to 10000
That's up to you
yea it is
if len(mystring) <= 1024: send my message
do
How's Possible to get a random number between specific numbers? Like get a random number between
50 to 10000
@earnest phoenix which language
Then do what?
@regal raven either truncate the string or show an error to the user
Js
@slender thistle thx for the help i fixed it π
I literally did nothing helpful but you are welcome
π
@earnest phoenix which language
@slender thistle50 + (Math.random() * 9950)
@earnest phoenix
oh rather an unnecessary one
oh
lul
Oh... So to make sense...
That adds 50 to a random number that's it got from Math.random()
yep
But what if the random number is 940 or something?
then it'll be 990
Yea
to get 940 you'd need to roll 890
Is there anyway to get it exact?
define "exact"
Like you can't get more than the specific number? <From number> + <random number to get from>
like the number can't be more than the random number to get from
whatβs a good recommended amount of ram for a lavaserver
whatβs a good recommended amount of ram for a lavaserver
@torn ravine all of it
Like you can't get more than the specific number? <From number> + <random number to get from>
like the number can't be more than the random number to get from
@earnest phoenix50 + (Math.random() * 9950)will max at 10000
just change the value after the *
Ik... But i mean like you can't get more than 9950
yep
Hmm lemme try
lol
9950 is the max for the rng in this case
while 50 is the padding
if you want the rng to max at 100, just use Math.random() * 100
if you want to max at 99999 just use Math.random() * 99999
hmm smart the server is always up if the bot is online
How do I add command specefic help commands manually in discord.py using discord.ext's command handler? Like help ping
or did you use a webhook?
Auto update after 1mins
@earnest phoenixsetInterval(() => stuff, 60000)
O
Ok
@lyric mountain i made this function for it, good enough?
if(!Number1){
throw new EvalError("No start number was provided");
}
if(!Number2){
throw new EvalError("No destination number was provided");
}
if(typeof(Number1) !== "number"){
throw new TypeError("Start number is not a number");
}
if(typeof(Number2) !== "number"){
throw new TypeError("Destination number is not a number");
}
let numberToReturn = Math.floor(Math.random() * parseInt(Number2)) + parseInt(Number1);
if(numberToReturn > parseInt(Number2)){
return parseInt(numberToReturn - parseInt(Number2)) - numberToReturn;
} else {
return parseInt(numberToReturn);
}
}```
yep I guess
but you should do parseInt(Number2) - parseInt(Number1)
let's say I set 50 as starting value and 100 as final value
your code would max at 150
instead of 100
the right equation would be Math.floor(Math.random() * (parseInt(Number2) - parseInt(Number1))) + parseInt(Number1)
generate a random value between X and Y
Getting a random number between specific provided numbers
Ooooh
Js is different lol
I know
how reload spesific folder or file?
Mongodb
js?
yes js
@slender thistle yes that's what I would use in python indeed
... you import numpy to use random module?
if you need to use other numpy things Β―\_(γ)_/Β―
I mean if you need the random module, why not import it instead of importing a larger module that utilizes it
I use random.sys_random() because it gives better random numbers tho
in both cases the module is fully loaded
Yes but if you are limited in resources, why not just import random itself
good idea
there ain't "better random" at all, all there is are pseudo random and true random
the latter being impossible to get without external measurement
Probably meaning a significant margin between numbers
that sounds like a biased rng
hi, does anyone know why ```js
const io = require('socket.io')(7000);
it doesn't redirect me to the 404 page, just says in the console i went to the 404 page
my express server is running on port 8000, and socket.io 7000 btw
Yeah I'm totally going to count the lines myself
which is the embed.add_field(name="{submission.subreddit}", value=f'ello', inline=True)
ah
I see
Well
Do you see where your if stuff is indented
That looks like 8 spaces
I won't even start questioning why you have a MyClient class that you're not using
Thx
@slender thistle also e.g. this link https://source.unsplash.com/random everytime you click it a random photo comes up. but every time i do <random the bot replys with: https://source.unsplash.com/random , but when i do the command again it shows the same image as if its not reloading everytime you use that command.
well what a surprise
Discord cache is a thing
That image is cached in your client so adding a random query parameter is a solution
ooohhh true, but it will always change the image right?
in browser without query params yes
on Discord without query params no
oh k so thats why everyone sticks to reddit hmm
what games should I add to my discord bot
slm
card games are quite popular
sIm?
might be something turk
does anyone know why this doesn't work (discord.js v11):
if(client.channels.get(`653285446738116608`)) {
console.log(`THIS IS THE CORRECT SHARD`);
}
tsc tsc, using v11
i know i know
-notr @brisk anvil
@brisk anvil
Δ°ngilizceden baΕka dillerde konuΕmak iΓ§in #memes-and-media kanalΔ±nΔ±, top.gg hakkΔ±nda destek almak iΓ§in #support kanalΔ±nΔ± kullanΔ±n.
BU KANALDA TΓRKΓE KONUΕMAYIN.
do you know why though
if(client.channel === ``) would work
how would it
Comparing an empty string against... a channel object.
- client.channel doesn't even exist, does it?
it's just a redirect tho @slender thistle
so you could just send the link after the redirect to fix the caching issue
Trying to transfer the database but contabo is showing forbidden access files denied
Is there anyway to fix this?
@slender thistle aga tΓΌrk mΓΌsΓΌn her Εeyime notr yazΔ±osn bi cevap ver
Alright hold it there
Are you turkish?
Do I look like I speak Turkish
yes
O zaman tΓΌrkΓ§e konuΕ
Lel
dellendirme
read Luca's message
for once
@topaz fjord are you referring to https://discordapp.com/channels/264445053596991498/272764566411149314/727891418198310953
-notr
staff only
does no one know the answer to my problem
update to v12, I don't even know if v11 still work properly
v11 will work till october
Why only October? Anything happening to Discord API that will make v11 obsolete?
j
i'm pretty sure it has to do with their whole new bot thing
didn't really look into it though
oof
Well unless some breaking change happens, v11 is fine
how do i move a postgresql database?
regardless, client.channels.get() works later in the code when sending a message, but not in the if statement
whats the error
none
update to v12 :P
that's cool but i don't need that right now
rule 4
@coarse hearth I think carl does
carl?
Okay
aight
@dense patio what are u trying to do?
@spare mirage you still using my bot
inside that if statement is all the dbl stuff, because it sends a message to a specific channel in the support server whenever someone votes
so i want the dbl events to run on that shard only
@eager citrus yes its in my test server
yes
@dense patio I think in v11 u would use this
if (client.channels.get('CHANNEL ID')) COMMAND HERE```
that's what it is
can I get more code
nothing logs in the console
try sending a message with it
Hello, I've been tryna get this guildCreate event to workg for some time now but it's not working any idea why?
https://hastebin.com/legerucige.js
nope
if(client.channels.get(`653285446738116608`)) {
console.log(`THIS IS THE CORRECT SHARD`);
}
this part is pretty much all that's important, being that it doesn't even get to that first log
the channel id is correct and the bot has permissions
@slender thistle
i guess with V11 you get issues with the intends
so it will be a breaking issue
intents you mean
yes
Does v11 not support intents?
is ur command correct @dense patio
im not sure
Oh I see where you're getting at
its possible that they changed something on the API that prevents V11 to work then
then how do u run it?
...it's in the index
Yeah if intents become required, v11 very well might stop working
u can still have commands in the index
who does that
ppl
how can i reboot spesific folder or command ._.
v11 will prob ddos itself without member_presence intent
wdym reload
reboot*
I guess u execute it again
Anyone knows why mine isn't getting triggered? I also tried to put it in index.js with a client.on but that doesn't trigger either https://hastebin.com/legerucige.js
would funny if this would happen. like a few people flooding the chat here that theyΒ΄re pcs are getting Super slow and laggy
lol you don't even need to flood the chat
just having ur bot join this server without that intent is a massive payload of presences
why did i get a 402 error
So how do I get a bot avatar from the dbl api?
yes
i actually have a command in my bot for cat pics and facts
I mostly use httpcat to figure out what the statuses mean
Anyone knows why mine isn't getting triggered? I also tried to put it in index.js with a client.on but that doesn't trigger either https://hastebin.com/legerucige.js
@tulip ledge does your bot actually join/emit a guild create event? Are you sureclientis referencing the client you used to connect your bot to Discord? It looks fine to me.
Http cat 401 is the best one.
but default channel is deprecated
Lynes what language
discordjs
So JavaScript/Node.js
yep
You'd need to use the fs module for folders and possibly commands (though require is what you're looking for). You'd need to unload the command(s) from whatever collection you keep it stored in and remove the require cache from the file (require.cache[require.resolve(filepath)]). Then load it like normal.
superbrain people hate it when they get riderected to this :{
better than just yelling read the docs
True
it literally explains everything
not really
there is stuff that is not explained
also some stuff is easyer to solved with the collective knowledge in here
exactly if it did explain everything why would people ask questions?
Justii that link explains exactly what you want.
what
it was someone else
oh
but it is easyer to link someone a page that explains stuff instead of trying to explain it
sometimes there is a language barrier and you can translate sites easyer
Docs aren't supposed to explain "everything"
don't copy it flat out
ok
e wassup peps?
@pure saddle lol glitch
um hello?



βοΈ


fucking kill me
this isn't the channel to do send random emotes
sorry
Why in the living hell did you think sending random emotes in a channel named "development" was anywhere near a good idea
can anyone help me with this
(node:59556) UnhandledPromiseRejectionWarning: Error: FFmpeg/avconv not found!
(node:59556) UnhandledPromiseRejectionWarning: Error: FFmpeg/avconv not found!
install ffmpeg
i did
it doesn't redirect me or anything,
it's not finding the path
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/derhuerst/http-basic.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! C:\Users\LXPC\AppData\Roaming\npm-cache\_logs\2020-07-01T14_59_51_030Z-debug.log
look :9
Install git
^
o
npm i --save git
so
@sudden geyser I already fixed it, I had 2 versions of the bot, Alpha and the normal one and I invited the normal one while the code was in the Alpha version, yikes thanks tho
@coarse hearth how did you install ffmpeg?
@pale vessel - https://discord.js.org/#/docs/main/stable/topics/voice
PS C:\Users\LXPC\Documents\GitHub\brutalbotgit> npm i ffmpeg-static
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/derhuerst/http-basic.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! C:\Users\LXPC\AppData\Roaming\npm-cache\_logs\2020-07-01T14_56_17_885Z-debug.log
PS C:\Users\LXPC\Documents\GitHub\brutalbotgit> npm install ffmpeg-static --save
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/derhuerst/http-basic.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! C:\Users\LXPC\AppData\Roaming\npm-cache\_logs\2020-07-01T14_59_51_030Z-debug.log
@pale vessel
install git
does ffmpeg-static installs ffmpeg like it downloads it so yesapt install ffmpeg or similar? not sure
Has anyone setup sharding using discord.js?
@median siren - Yessir. What's up
@pale vessel - https://discord.js.org/#/docs/main/stable/topics/voice
@paper phoenix i was asking someone
Oh gotcha. Just getting on. π
@paper phoenix so i followed this tutorial https://discordjs.guide/sharding/#how-does-sharding-work up to the bit where we retrieve the guild size for each shard
But each guild is returning null
it appears that the shards arnt starting correctly
(node:59556) UnhandledPromiseRejectionWarning: Error: FFmpeg/avconv not found!
why is it not found wtf?
yeah
it appears that the shards arnt starting correctly
@median siren - Use theshardCreateevent to log the following:
//Or whatever you named your manager...
shardingManager.on( 'shardCreate', shard => console.log( `Launched shard ${ shard.id }` ) );
What do you see?
Nothing at all
Have you called shardingManager.spawn( )?
How do I see how many guilds my bot is in, again? client.guilds.size is undefined
const { ShardingManager } = require('discord.js');
const manager = new ShardingManager('./app/bot.js', { token: process.env.BOT_TOKEN });
manager.spawn();
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
that is the entry point @paper phoenix
How do I see how many guilds my bot is in, again? client.guilds.size is undefined
@tulip ledge -client.guilds.cache.size
PS C:\Users\LXPC\Documents\GitHub\brutalbotgit> npm i --save ffmpeg-static
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/derhuerst/http-basic.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\LXPC\AppData\Roaming\npm-cache\_logs\2020-07-01T15_23_32_127Z-debug.log
@coarse hearth install git :P
@median siren - Does manager.spawn( ) ever resolve?
manager.spawn( ).then( console.log ).catch( console.error );
Also, do you mind showing where you create your client in ./app/bot.js?
@median siren - Does
manager.spawn( )ever resolve?manager.spawn( ).then( console.log ).catch( console.error );
@paper phoenix Yes i get a massive object log
@spare mirage already did
weird
zzz
kpal its messageEmbed
wdym
const { Client, MessageEmbed } = require( 'discord.js' );
Also, I doubt it matters, but you don't need to pass your token to client.login( ) when using external sharding
hmmm
Also doubt this matters, as I don't see it mentioned anywhere, but does ./app/bot.js export client?
then what is the context in client then?
no it doesnt
MessageEmbed
@median siren - Mine isn't far off from yours, and I create my shards with:
//~ Load configuration
import 'dotenv/config';
import Discord from 'discord.js';
const { ShardingManager } = Discord;
const shardingManager = new ShardingManager(
'./bot/index.mjs',
{
execArgv: [ '--es-module-specifier-resolution=node' ],
token: process.env.DISCORD_TOKEN
}
);
shardingManager.spawn( );
export default shardingManager
import Discord from 'discord.js';
//...
const bot = new Discord.Client( CLIENT_OPTIONS );
//...
process.nextTick( ( ) => bot.login( ) );
export default bot
i see
@spare mirage - He's already provided damn near identical showing that he's made an effort - relax
@median siren - How many servers are you in ATM? Can you get away with internal sharding, or does it do resource intensive stuff like image rendering etc?
around 2500 servers with image rendering yes
Ah, understandable why you'd want external then
@spare mirage because message.client
Most the discord collections call the object client
Its just more consistent
npm didnt update discord js ffs
@median siren - Did this fix it?
how do I make a command work like this
B!cOdE
b!code
b!Code
B!cOde
etc.
if LowercaseMessageContent startswith something
thanks!
@paper phoenix the shard id is being logged so i think so im just testing guild logging now
@median siren - Add me for a minute if you don't mind
my data when being exported comes out like this
help
which utf should i use
encoding
help
On create channel message?
The channelcreate event returns a channel
Not a message
^^^
ah
i'd recommend reading https://discordjs.guide/additional-info/changes-in-v12.html
let prefix; // define balnk variable with any name you want let prefixes = await client.db.fetch(`prefix_${message.guild.id}`); if (prefixes == null) { prefix = "d-"; // default prefix if no prefix set for this guild } else { prefix = prefixes; } if(message.content == "@void zenith") { message.channel.send(`My prefix is \`\`` + prefix + `\`\` for this guild!`) };i still need help with this thingy
how to make it work with my mongo db?
@cobalt spruce change
', message =>
to
', channel =>
@earnest phoenix use quick dB if you want help from me lma9
no files wont work


