#development
1 messages ยท Page 907 of 1
yes but there's an object in the presence
Can't you just use
client.setActivity (`somewhatever`, { type: WATCHING })
presence:{status:"online",activity:{name:"bla",type:"bla"}}
yes that's easier but can disappear after time
Wait what? It can? I never knew
setActivity can be lost if the bot loses connection with discord
Hmmm...
if you set the activity in the client options, all new connections will be started with that activity, so even if it loses connection it will just reconnect and apply the presence again
Okay, Imma change this then, thanks
@quartz kindle i want is my bot send message, not the webhook
still, you need twitter webhooks
ok thx
const client = new Discord.Client({ presence: { activity: { name: 'help', type: 'PLAYING' } } });```
do you get my confusion? ๐
@quartz kindle would this work or not?
const client = new Discord.Client({fetchAllMembers: true}, { presence: { activity: { name: `Arc-Neko!! | )help | ${client.guilds.cache.size} guilds | ${client.users.cache.size} total users`, type: 'PLAYING' } }});
``` ~~@nocturne grove see what I'm talking about?~~
yes ๐
I'm happy I just use new Discord.Client() and have an interval for my status xd
@high bough there is only one options object
Am I even allowed to set status every 60 seconds?
{fetchAllMembers:true, presence: {}}
How would I do it so that only people that have voted get access to a command
{fetchAllMembers:true, presence: {}}
@quartz kindle Awight thanks
@earnest phoenix store votes in a database
How would I do it so that only people that have voted get access to a command
@earnest phoenix #topgg-api
@earnest phoenix you can use the votes endpoint or use top.gg webhooks
the voting enpoints are known to be slow and outdated tho
so a person that votes might take several minutes for the system to register their vote, which will reflect on your command
@quartz kindle , help me again ๐ญ ```js
const client = new Discord.Client({fetchAllMembers: true, presence: { activity: { name: Arc-Neko!! | )help | ${client.guilds.cache.size} guilds | ${client.users.cache.size} total users, type: 'PLAYING' } }});
^
ReferenceError: Cannot access 'client' before initialization
at Object.<anonymous> (/home/kayuimineko/index.js:4:113)
at Module._compile (internal/modules/cjs/loader.js:1123:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
at Module.load (internal/modules/cjs/loader.js:972:32)
at Function.Module._load (internal/modules/cjs/loader.js:872:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
[nodemon] app crashed - waiting for file changes before starting...
oh yes sorry that's an option too ofc
thats why using the webhooks and a database is the recommended way
I'm not to experienced with all that
@high bough yes thats the limitation of setting the presence in the client option
you cannot use the client there
Wait, so how do i do it?
you can make it show "loading" for example
@high bough you can better just set an interval as the amount changes
and then on ready you update the presence to show the member count
you can make it show "loading" for example
@quartz kindle Isn't that the same as before? Having the presence disappearing issue thingish
@high bough you can better just set an interval as the amount changes
@nocturne grove It actually deletes the Activity for me, Idk why
wut
yes pretty much
because thats how discord works
you can re-set the activity on shardResume for example
Muu~ ๐ญ
or make an interval
but the initial activity from the client options cannot access client data since the client did not load yet
or make an interval
@quartz kindle Yeah, about that, everytime the interval passes by, it deletes the activity, not resetting it
then you did something wrong? idk
//Startup System
var botmain = client.on("ready", async () => {
client.user.setAvatar(`${avatarURL}`);
var guildw = client.guilds.cache.get("700948321904099370");
guildw.setIcon(`${avatarURL}`);
var totalGuilds = client.guilds.cache.size
var totalMembers = client.users.cache.size
try {
setInterval(() => {
cient.user.setActivity(`Arc-Neko!! | )help | ${client.guilds.cache.size} guilds | ${client.users.cache.size} total users`)
}, 900000);
} catch (error) {
console.log(error.stack)
}
console.log(
`Logged in as ${client.user.tag}.\nThere are ${client.users.cache.size} users and/or bots online.\n${client.user.tag} connected to: \n ${client.guilds.cache
.map(g => g.name)
.join(", ")}`
);
var channelw = await client.channels.cache.get("700948323393077313");
channelw.send(`Webhook running at http://0.0.0.0:5000/arc-neko`).catch(err => console.log(err));
channelw.send(`Logged in as ${client.user.tag}.\nThere are ${client.users.cache.size} users and/or bots online.\n${client.user.tag} connected to: \n ${client.guilds.cache.map(g => g.name).join(", ")}`).catch(err => console.log(err));
});
//Locator and Link + Configuration
const fs = require("fs");
const Discord = require("discord.js");
const client = new Discord.Client({fetchAllMembers: true, presence: { activity: { name: `Arc-Neko!! | )help | System Initializing...`, type: 'PLAYING' } }});
const config = require("./config.json");
const fetch = require('node-fetch');
const DBL = require('dblapi.js');
const mongoose = require("mongoose");
mongoose.connect('mongodb+srv://<dbuser>:<password>@arc-neko-gl57b.gcp.mongodb.net/test?retryWrites=true&w=majority', { useUnifiedTopology: true, useNewUrlParser: true }).catch(err => console.log(err))
const Profile = require("./models/profile.js")
const Guild = require("./models/guild.js")
const Channel = require("./models/channel.js")
const neko = require("./models/neko.json")
const clientneko = require('nekos.life');
const sfw = new clientneko();
Umm, maybe, I mean
Also, how quickly can an avatar be changed?```js
(node:29407) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
avatar: You are changing your avatar too fast. Try again later.
at RequestHandler.execute (/home/kayuimineko/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:29407) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:29407) [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.
is client.channels an array ?
it loads commands and then it just stops at the logging in part
@high bough twice every 30 minutes
@earnest phoenix discord.js ?
Oh thanks @split hazel
hmm
v11 ?
or v12 ?
and send your code
it will be easier to help you with it ๐
there isn't an error
it just doesn't login
i have no idea what and where is wrong with my code
sendyour code
The piece that loggs it in would help
const {Client, Collection} = require('discord.js');
const fs = require("fs")
const client = new Client({
disableMentions: "everyone"
})
const Enmap = require('enmap')
client.commands = new Collection();
client.aliases = new Collection();
client.config = require('./config.js');
client.db = new Enmap({
name: "Main"
});
client.prefix = client.config.prefix;
client.color = "BLURPLE"
client.login(process.env.token)
fs.readdir("./events/", (err, files) => {
if (err) return console.error(err);
files.forEach(file => {
if (!file.endsWith(".js")) return;
const event = require(`./events/${file}`);
let eventName = file.split(".")[0];
client.on(eventName, event.bind(null, client));
delete require.cache[require.resolve(`./events/${file}`)];
});
});
fs.readdir("./commands/", (err, files) => {
if (err) return console.error(err);
files.forEach(file => {
if (!file.endsWith(".js")) return;
let props = require(`./commands/${file}`);
let commandName = props.name;
let aliases = props.aliases || [];
console.log(`Attempting to load command ${commandName}`);
aliases.forEach(m => {
client.aliases.set(m, props)
})
client.commands.set(commandName, props);
});
});
but i have no idea what part of the code is wrong cause there isnt an error
so i have no idea where is wrong with the code
does the process stops ?
yea
does it prints this line console.log(\Attempting to load command ${commandName}`);` ?
there is
sorry for that, but your bot didnt BANed?@earnest phoenix
add somewhere in your cde client.login("TOKEN")
there is
@earnest phoenix In the bottommost
at the fucking top
at the fucking top
@earnest phoenix ๐ค
In the bottom bruh
It has to load the commands before logging in @earnest phoenix
you're using glitch ?
LOL
who uses glitch these days
it is
or whatever ?
its token
hm ok
im not dumb
I mean, glitch can't compare to this ๐ค
You sure the token hasn't changed?
Can send me the code?
Kk wait a sec
๐ฉ
why
disableMentions: "everyone"``` ?
i could come back but in a few months lol
3rd line
just had to fix some bugs in my bot introduced by the new members intent
cause some prick might use the say command to ping everyone
anyone else had any issues with problems caused by the intents stuff?
maybe thats why my bot is so screwed up?
Actually, do you require dotenv to be installed for it?
mhm aight
i never used disablementions, you can nerf your mentions with a search and replace, put a unicode zero-width space in it
Try
maybe it got cucked or something
but normally wrong token put an api error
@green kestrel depends on what your bot does. without GUILD_MEMBERS intent you will not receive member join/update/remove, nor updates to guild.memberCount nor be able to use members.fetch() to fetch all members. without GUILD_PRESENCES you will not receive presence updates and will not be able to fetch members with presences. so depending on what your bot does, there might be some quirks with intents
yeah, what it was, was in the dashboard it looks in the bots db to see if any guilds exist which you have permission on, if they do it displays and if there arent any it displays a cute image saying "one last step, please invite sporks to your guild" and then presents you with the invite link, the idea being that by the time youve done the captcha or whatever and returned, its receiced the member list for most guilds, and can pick up that change and display the list
i forgot you dont use discord.js, but you probably know the endpoints and gateway commands the methods above refer to
with members intent and no presence intent, i have to request the list, because thats nerfed and sloooow due to rate limiting, for any larger guild it takes so long to get that list and pick up that the user is a member, they think its broken and come to my support guild
ive had to make some changes that it can pick up the owner id 'early' from the guild_create info
so the owner gets early priority to being able to see the dashboard on invite
yeah some things are kinda stupid
not having an initial list of members on guild_create payload without presences intent
and not being able to request all guild members without guild members intent
i kind of hope they fix that, i dont want to have to request or use presence intents, they cause massive extra bandwidth and some extra cpu
and technically i cant justify that im "using them for bot features", i "need them because your api sucks, discord"
yeah lmao
discord's approach to presences is basically all or nothing
if you want presences, here have them all. you dont want them? ok we'll block your access to them
Is 3.75 GB RAM big for a bot?
depends on what it does and its size
If it is too big, can I get an estimate of how many servers it can handle?
depends on what it does and its size
@quartz kindle Has 80 commands, sends approxserver amount * 2requests every around 5 mins?
i mean, how many guilds/members does it have
how do you accept a team thing in discord developer
Oh, what I mean is how many guilds can it handle
how do you accept a team thing in discord developer
@still merlin I think in Email
oh you mean 3.75 is the total ram of the vps?
Yes
i thought it was the bots' current usage
Oh, no way, lol, I'd be dead if that were to happen
well anyway it still depends on what the bot does, and how you approach caching issues
a default discord.js without any cache sweeping will use about 200-400mb per 1000 guilds
depending on how many members the guilds have
Oh, then it's really small, huh?
if your bot grows into 10k+ guilds, then it will be worth to look into caching optimizations
I see
which is basically deleting everything that your bot doesnt need to use
Cuz, I mean 
Right, thanks for the suggestion
i've done some extensive optimization for my bot
maybe way over the top tbh
but it uses about 150mb on 3000 guilds
Cool
but it depends on what your bot needs
Cuz like, I have people with 128 GB ram for a bot that uses 0.xxx% of its total memory and I was going like, wha?? 
I pay, hmm..... $0?
google's right? i have that one too for another project
but google's bandwidth is very limited for a discord bot, and their disks are slow af
Yeah, guess so, but still... Better than Glitch LMFAO
for sure
if you're gonna stay on google, you should use intents and install zlib-sync
150mb for 3000 that's insane
or you're gonna start paying a lot for bandwidth usage
if you're gonna stay on google, you should use intents and install zlib-sync
@quartz kindle Right, I'll check up on it
zlib-sync?
@high bough my dedicated server has 32gb ram, my bot uses a tiny portion of that, but i dont just host a bot on it
how much eris uses per 1k guilds @quartz kindle?
Wait, last time I tried to do that it crashed both my bot and my app.
I mean like, the commands got thrown all over the place
@green kestrel installing zlib-sync turns on zlib-stream in discord.js
@restive furnace no idea, havent used eris, but most likely similar amounts, maybe a bit less
@restive furnace i can give you my stats
currently im using 991668kb virtual and 214860kb rss, for 1850 guilds
the rss is the important one, but its always been around 215mb, all the way from 50 guilds up to 1800
@green kestrel This was what happened last time.
Welp, sry, wrong link, try this one V
https://discordapp.com/channels/264445053596991498/272764566411149314/701367005042835556
thanks for the information and for the stats
215mb on 1800 is already better than discord.js and most likely will scale much better in the future
since its not javascript
mysql will be my bottleneck before the language i use will be
ive already had to optimise my queries, as its a very database-heavy bot
Anyone knows if I can connect 2 bots to the same dbl key
Thank you
depends what you want to do
you cant post server count for two different bots using the same key
Check whenever someone votes and send it to a server
if you report two bots stats to the same key, the server counts etc will override each other
if you report two bots stats to the same key, the server counts etc will override each other
What if I don't do dbl.updateStats
ah that no, you need a different key for each bot
What if I don't do dbl.updateStats
@opaque seal You'd rather not, and shouldn't
the only thing you can use the same key for is getting information about bots on top.gg
wait maybe you can send too
but you need to manually send an api request with the bot's id
not using a dbl library
nvm most likely not
else you could go around changing other bots server counts lmao
I just want to receive whenever a user opvotes my bot and send a message to my support server with the user who votes
Is that possible
?
but why shouldn't I do it in another one?
Umm, coz they're different bots, it can be an issue
Also @opaque seal talk about this in #topgg-api
receiving votes doesnt need a key, so you can receive votes from different bots in the same process yes
you just need to configure them all to send webhooks to the same url
const Discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
const pingMessage = await message.channel.send("๐ Ping?");
const pembed = new Discord.RichEmbed()
.setTitle("**Ping!**")
.setDescription(`**Pingul meu este ! ${pingMessage.createdTimestamp}ms!**`)
.setFooter(bot.user.username.toUpperCase(), bot.user.displayAvatarURL);
message.channel.send(pembed);
message.delete(pingMessage);
}
module.exports.help = {
name: "ping"
}
Why when i use the command the ping is very high, like milions?
because youre using the messages timestamp
which is the date the message was created
message.createdTimestamp - pingMessage.createdTimestamp
``` @earnest phoenix
you just need to configure them all to send webhooks to the same url
kinda not getting what this means but I'll look it up
receiving votes doesnt need a key, so you can receive votes from different bots in the same process yes
thanks
Why the hard work tho?
I mean, there isn't much hard work to do there
How i can push in embed new embed line?
Example:
const embed = new Discord.MessageEmbed()
.setTitle('Command Help') .setDescription(`${prefix}${command.name}\n${command.description}`)
if (command.aliases) embed.push(.addField(`${command.aliases}`))
discord.js
don't push, just add the field
oh boy what the fuck are you even doing on that last line
embed.addField?
do you have any js experience
if (command.aliases)
embed.addField(`${command.aliases}`)```
why put it in a template literal
client.on("message", async message => {
const args = message.content.slice(prefix.length).split(" ");
const command = args.shift().toLowerCase();
if (command === `buy-role-1`) {
let cdata = db.get(`cdata_${message.author.id}`);
if (cdata === null) cdata = 8000;
if (8000 > cdata) {
return message.channel.send("You do not have enough money");
}
db.subtract(`cdata_${message.author.id}`, 8000);
await message.channel.send("Role purchased contact your server owner to get it");
}
});
});```
why it is spamming
???
is that even real paypal/credit card payment lol

It shouldn't spam that unless you have some other code, or someone is spamming cmd
I had a similar issue
I turned my bot on before and got like 50 messages and the way i did it was
just delete my files and created it again and pasted the code in with a new application
hmm
Or you just stop the other running applications
i am making a leveling system and i don't want my members spamming just to get xp.. so how do i add a 30s cooldown or so to the command so it doesn't give them xp unless the cooldown is finished?
(python)
DiscordAPIError
at /rbd/pnpm-volume/815574e8-2b97-4378-ab2d-e7bcab619144/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15
at /rbd/pnpm-volume/815574e8-2b97-4378-ab2d-e7bcab619144/node_modules/.registry.npmjs.org/snekfetch/3.6.4/node_modules/snekfetch/src/index.js:215:21
at processTicksAndRejections (internal/process/task_queues.js:88:5) {
name: 'DiscordAPIError',
message: '',
path: '/api/v7/gateway',
code: undefined,
method: 'GET'
}```
how can i resolve this error?
undefined
do message reaction events just not emit if the member isnt there?
i mean cause i have presences intent enabled, it seems that when the member isnt cached the event just wont emit
anyone could help me?
i am making a leveling system and i don't want my members spamming just to get xp.. so how do i add a 30s cooldown or so to the command so it doesn't give them xp unless the cooldown is finished? (python)
You just gotta wait for someone who knows python
@wise quartz are you storing all the users' data in a json
oof, then i can't help ya
buut, you can store the timestamp of their last message
i mean does it rly matter? cant i just like add a cooldown to the on_message event?
nope
if i was using json how would it work then?
aha
ooh i have a command similar to that
cause you can subtract timestamps from one another
i can read & write to the database dw
then yeah, that's how you do it
timestamp - current_timestamp
negative value lol
so ```python
previous = #timestamp from your database
current = datetime.timestamp.now()
difference = current - previous
yeah my bad
aa....
it's pretty neat
so like
do message reaction events just not emit if the member isnt there?
i mean cause i have presences intent enabled, it seems that when the member isnt cached the event just wont emit
if not, why?
huh?
@earnest phoenix so i'd use timestamp to get the the time the xp is added to the user then i add 30s to it then wait for the time to end to run the cmd again?
@fast briar
Hey just wondering if anyone could help me, when sending a request to get permissions of a role or user in a guild, it returns the permission as this, I understand each role has a value, but how would I go from this to the roles?
that's the permission bitmask
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
0|index | at Function.resolve (/root/bot/node_modules/discord.js/src/util/BitField.js:150:11)
0|index | at Permissions.has (/root/bot/node_modules/discord.js/src/util/BitField.js:45:28)
0|index | at Permissions.has (/root/bot/node_modules/discord.js/src/util/Permissions.js:45:85)
0|index | at /root/bot/node_modules/discord.js/src/structures/GuildMember.js:268:53
0|index | at Map.some (/root/bot/node_modules/@discordjs/collection/dist/index.js:234:17)
0|index | at GuildMember.hasPermission (/root/bot/node_modules/discord.js/src/structures/GuildMember.js:268:29)
0|index | at Object.run (/root/bot/commands/moderation/setprefix.js:13:26)
0|index | at /root/bot/events/guild/message.js:39:15
0|index | at /root/bot/node_modules/mongoose/lib/model.js:4886:16
0|index | at /root/bot/node_modules/mongoose/lib/model.js:4886:16
0|index | at /root/bot/node_modules/mongoose/lib/helpers/promiseOrCallback.js:24:16
0|index | at /root/bot/node_modules/mongoose/lib/model.js:4909:21
0|index | at /root/bot/node_modules/mongoose/lib/query.js:4378:11
0|index | at /root/bot/node_modules/kareem/index.js:135:16
0|index | at processTicksAndRejections (internal/process/task_queues.js:79:11) {
0|index | [Symbol(code)]: 'BITFIELD_INVALID'
0|index | }```
always when someone tries to set a new prefix it shows me this
it only works in my server
show code
there's a bunch of files for the code but ok
const mongoose = require("mongoose");
const config = require("../../models/prefix.js");
module.exports = {
name: "setprefix",
description: "Set a custom prefix for the guild. (prefix must not include spaces!)",
category: "moderation",
usage: "(NewPrefix)",
run: async(bot,message,args) => {
if(!message.member.hasPermission("MANAGE_SERVER")) return message.channel.send("You do not have `MANAGE_SERVER`")
config.findOne({ GuildID: message.guild.id }, async (err, prefix) => {
if(!args[0]) return message.channel.send("Please provide me with a new prefix!");
if(args[0] === prefix.Prefix) return message.channel.send("That prefix is already set!");
prefix.Prefix = args[0],
prefix.updated = true,
prefix.save();
let embed = new MessageEmbed()
.setTitle("Success!")
.setColor("RANDOM")
.setDescription(`New prefix set! Updated prefix is \`${prefix.Prefix}\``)
message.channel.send(embed);
if(err){
message.channel.send(err)
}
})
}
}
what are you trying to do
no

he wants to make a bot
ahh nvm, i thought it was a developer license feature
So how would I make a bot
ON PHONE
I know nothing about coding
then you won't be making the bot anytime soon
you need to know a programming language in order to give 'life' to a bot
My dad is helping me code he knows everything he builds computers he fixes and stuff
So yeah anytime soon
building and fixing computers !== programming
unless he's a programmer
then you're fine
Yes he codes programms builds
well
Everything he's a master
Well I'm not with him
to create it go into dev portal
wrong part of the site
Now it says to do this
I did everything else
you're also not allowed to be on discord if you're aged under 13, which i sincerely believe you are indeed underage
My dad knows the language
๐
What
@earnest phoenix how old are you btw, we give special roles to people under the age of 13
Wow that's cool
king how old r u?
I am underage so you can kick me and whatever
I don't really care
@delicate zephyr
@earnest phoenix what is your exact age
11
F
โฐ๏ธ
que african dancing
oops
welp
=f
do message reaction events just not emit if the member isnt there?
i mean cause i have presences intent enabled, it seems that when the member isnt cached the event just wont emit
if not, why?
might have to opt into the presence intent 
hey so cry was right
what did he say
webstorm better than vsc + kite
tell them to make a community version
oh nvm
thought it was something related to
eh
how do i completely change a class/file from a package
tbh the way he was talking, it was kinda obvious he was very young lol.
but hey at least he was honest with his age
you make a property/method for it?
nah nvm
falling in love with this desmos calculator
Replaces countless hours of tabling results'
wtf is kite
๐ช
how to stop bots from interacting with the on_message event? (python
)
i remember theres like a line of code u add that will keep the on_message event from tracking bot messages but i forgot what it is
lol
check if the sender is bot?
(node:25) UnhandledPromiseRejectionWarning: Error: SQLITE_ERROR: near "*": syntax error
(node:25) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 9)
Anyone know how to fix thisn
How do you guys make link button in embed? i'm using discord py re write
It keeps booting my bot off
Anyone know how to fix this
(node:25) UnhandledPromiseRejectionWarning: Error: SQLITE_ERROR: near "*": syntax error (node:25) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 9)
what's the query
It happens every time someone sets their description on my bump bot
please answer
I just said
it's an sqlite error
Anyway to fix it?
don't tell me you used a wrapper
No
you don't know what a query is?
Anyone know how to fix this
(node:25) UnhandledPromiseRejectionWarning: Error: SQLITE_ERROR: near "*": syntax error (node:25) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 9)
@earnest phoenix * = all check the line
I'm only telling you what I see on my control console
seems like you didn't code the bot
learn how to use sql
the issue is with the sql statement. unless we can see the statement theres practically no way we could help
ping low vps recommendation
how would I make this an embed?
put the image url in an embed
@silver cedar scroll down through the pins of this channel.


He could have pretty much found the same thing in the docs anyways
Dont forget to require discord.js as 'discord'
or not
I will be very happy if my discord bot has information about when it is approved.
when you get approved, you'll get pinged in logs and get a message from luca
Can you guess how many days this all takes in total? and I will be very happy if you share it with me. @earnest phoenix
it is around a week
it can be UP TO 2 weeks OR MORE ~ pengduane
Anyone using GalaxyGate as a host here? My server randomly died and I cannot get it to start, I'm failing over to Digital Ocean but why does it randomly die like this? It seems to only happen on KVM type systems.
@sinful belfry I threw it at 12 o'clock on Saturday
@sinful belfry Well. Can I add it as a friend? if that won't bother you, of course.
. .
\/
though if your think about it, if you host your bot on a samsung smart fridge, you could technically monitor it quite often
kk
nah, but i might consider changing to them
having enough of my current vps provider, like their support is great and all
but i had issues of the vps not even booting quite often
and invoice issues even though i paid the servers
contabo seems sketchy
thats just my opinion
well their page does look like straight made from scratch in like 2015 or so, but i heard good things about them
i like my current vps but i feel its really only one to be used for starting up
ok guys, here I am once again in my journey to find help with oAuth2
anyone here has experience using it?
maybe
ok, the issue I'm having is that I can't redeem the code returned by the "code grant" request (which IS being returned correctly, and I've also checked if my token request was being sent correctly with postman)
I've followed pretty much any doc/guide I've found online, but for some reason the "invalid_grant" error still pops up
the code: https://hastebin.com/xebufawuma.rb
the data sent is pretty much identical to the one present in the official Discord's oAuth2 docs
yet it doesn't work
Hey is there like a bot ToS?
This one guy suggested I make a cmd that can make like 30 roles at once for all the color roles, but idk seems like it'd be breaking a rule or something
@balmy lantern all bots have to comply with discords TOS
and if you want to keep it on the dbl you should read theirs as well
@balmy lantern https://canary.discordapp.com/channels/264445053596991498/280067058417401856/393849238636855297 these are the general bot rules
pretty sure colour roles bots arent allowed on dbl but idk
however if you are trying to make 30 roles at once, that is API abuse
nope, they are not
meh, looks like my issue will not be seeing the light of the day anytime soon
i guess oauth isnt what most people who read this chat know
so anyone used contabo before
yeah, I guess
just
because starman uses discord canary
someone uses canary, someone else uses ptb, and most of them uses stable (just discordapp.com)
@grizzled raven I recently got a contabo server to test it out. i also thought the seemed sketch af. As far as i can tell, they have given me all cores, ram, ethernet speed, and storage promised for their low fee. ping to discord has been stable between 50-80ms, response times not much more than that. its been going for a few days and havent had any issues (yet)
^contabo hosted (usa ssd vps) bot
Tbh contabo seems a bit high
4 core, 8gb rams, 200mb-p/s ethernet, and i think 200gb ssd for like 4.99 euro per month
there is a 5 euro one time setup fee too
it took maybe an hour ort two for me to get the email with login details
Oh I thought you meant dedicated
nah, shared vps i got ๐
This is what I used to have for 25 dollars (22pounds I think) a month
Dedicated
also, a huge thing for me, the ip address ccontabo gave me does NOT have any domains registered to id
anybody used contabo before?
@grizzled raven I have been using Contabo for roughly a year now. Happy customer, very good support, i get the performance promised... I don't know what seems sketchy about them lol
^thats the domains hosted on my current ip, and each of those except verylegit.pw forward spam traffic to various routes on my site
its been a huge pain
lol
huh
how do you know its spam traffic
did that site tell you along with that list?
i use nginx and see each request made to my server
i get 3 requests each minute
for the /ecig.php route
my site obviously has nothing to do with e cigs
so to me, its spam
lol
^ my other site hosted on heroku, which uses amazon aws
surprisingly i get no spam on that site ๐
@earnest phoenix that was a full dedicated rack you rented?
one question, do they email you the vps key or login or whatever
yea
umm the ip and password?
yea pretty much
i cant be bothered scrubbing my personal details from the email lol
apparently i also have access to like 65k ipv6 addresses
no idea who needs 65k ip addresses, but hey, its a thing apparently
nah cause my last vps emailed a bunch of random stuff too which i cant remember
but that question doesnt matter
i went for the cheapest ssd based on, i think its 4.99 ๐
probably gonna get the next one up which i think is 8.99? but yea, just went cheapo to try it ๐
also made sure to choose usa which costs 1 euro more per month
apparently cause usa electricity etc is more expensive
but better ping to discord in usa than germany ๐
lol yea it tells you when you go to 'customize and order'
i say go for the cheapest option till you know your happy with their service ๐
they do seem to give what they say though
i thought they woujlda somehow skimped on the resources
some other dude from here says the 'steal' is high sometimes, meaning your resources are stolen (cpu/ram) by other vm's running in the same rack sometimes
i think i've gotten many people's opinions on their service and most of them were good
except the whole steal situation
tbh, my current host: digital ocean, gives me only 1core and 1gb of ram for the same $5 per month
and only 20gb ssd
so even if half my resources are stolen, im still way better off now ๐
i guess their internet speeds might make up for it?
d/o? nah
my current one is like 2gb and 32gb hdd i think
ive had issues with them since i got the server

moostly with people who already rented the same ip from them
like, recycled ip addresses
forwarding traffic to my site
whats the difference between 18.04 ubuntu and 20.04
i went 18 cause i wrote a complete guide for how to get my bot reinstalled on a new host, and my current host had ubuntu 18, so thats what i went with to be sure it'd be an easy switch
Alot of security staff for ubuntu
i should do that
but 20.04 isnt fully supported by alot yet
my last host was ubuntu 18.04 so thats why im asking
(my bot is stored in docker containers alongside other containers for other things, like database, website, nxgin, others...)
nginx you mean?
contabo does offer a v20 ubuntu
or not
How can you hide letters or anything inside a codeblock
lol yea
so would anything go bad if i choose 20.04?
probably not, might run into an incompatibility with anything you might want to install, but probably not
oof ill just search it up somehow
that doesnt give you the text when you copy it
what
anyone play dank memer?
no shit it doesn't because you said "hidden"
you mean that image? ๐
i thought it's for bots to read or something
if I want to copy a phrase from a code block it would not end up the same if i manually typed it
oooohhh
thats the result I want
he might mean like
h
I asked in the Dank Official and they said they hid secret characters
Like the minigames that ask you to repeat the phrase:
I like making burgers
so you can't copy it
might have something to do with alternative version of a letter or different width space, idk
yea thats an interesting one
5Head devs tho
like this https://i.redd.it/g9ptxqprwtm21.jpg
wth
see, they would put a whitespace and if they detect a whitespace in your message, you copied it
it could be filled wwith zeroi width spaces
there you have it
nice mystery solved thanks
no problem
^
And I think we all learned something new today
you cant proove nuttin!
any reason to get any of the administrator panels?
nah, i took the free one but havent used it yet, likely wont, and am already thinking of removing it ๐
if you can do command line, your good
GL!
hopefully im not a contabo employee in disguises here to scam you from your hard earned 10 euro ๐
@slim heart still programming huh, do you ever sleep? ๐
no
wow that was a fast response

i feel that
are you bot?
lol
ok, im about to feel super dumb for asking this, but its something ive never done... Is it possible for my bot to use emoji's from my server in other servers he is in, or for my bot to have a number of unique emoji's he can use in any server?
i have a ittle battle screen thing that uses reactions to respond. it'd be awesome if i could make those custom icons
do it then, nothing is stopping you, you can use custom emojis in reactions too
but on other servers too? it would auto use those emojis?
its kinda like if the bot has some kind of nitro, it can use custom emotes everywhere
ooohhh awesome ๐
so my bot could use any emoji in any server he is in, as long as he ius in at least 1 server with those emojis?
hi im back
thats pretty neat tbh
how do you code your bot and how do you activate your bot if i have someone to help me with full money?
@pale peak
no idea what that means Clow. i use discord.js to code my bottie
a vps is more reliable
^
i currently use digital ocean, heroku, and contabo. contabo seems best but im new customer to them.
Contabo offers low-cost dedicated servers, virtual private servers and webspace. Professional hosting solutions for businesses of all sizes.
@pale peak a vps isn't like glitch, it's like a full computer
are these links?
I currently use GalaxyGate
@neat ingot @earnest phoenix so how do i transfer my commands in this glitch here
you just copy your code and reuse it on the vps
Hi,
Does anyone know how to make a Shuffle Command with a JSON styled array as ServerQueue?
but won't he make any mistake? @earnest phoenix
Hi,
Does anyone know how to make a Shuffle Command with a JSON styled array as ServerQueue?
@sterile minnow with some kind of RNG
@pale peak nope, if you do it correctly
to shuffle what?
Songs
so youw ant to take a random song from an array, and then remove it from the array, or keep it there?
One song is like that:
{ requester: 'Tayron#0001',
id: 'QYNF1YH9Ka8',
title: 'TIROW - ZWEITGEDANKE (prod. by LBL) #deutschrapnewcomer #deutschrapaktuell',
url: '',
thumbnail: ',
channel: 'TheTirow',
duration: '00:03:35' }
@earnest phoenix all of my codes are in glitch and I put it in the computer file so there is no problem
so youw ant to take a random song from an array, and then remove it from the array, or keep it there?
@neat ingot randomize the Whole array
@earnest phoenix do you think this will do my job
which code language?
Javascript
js
mmk, sec ๐
@sterile minnow yeah just use rng, save the ones that were played and check it on every next song
what ?? @neat ingot
@earnest phoenix what? I dont understand anything
I'm not a Native English speaker
random number generator
Yo can someone explain to me how to get the permissions from the permission thing. Its a bit field. But cant seem to work it out from the discord docs or wikipedia
Like i said before, that's the permission bitmask
read the responses before you repost
A small calculator that generates Discord OAuth invite links
Hello, does anyone know how to make the bot send a message when someone pings it? In discord.js
const songs = [{data:1}, {data:2}, {data:3}];
function getRandomSong() {
return Math.floor(Math.random() * songs.length);
}
function removeSongFromArray(song) {
const id = songs.indexOf(song);
songs.splice(id, 1);
}
// to use:
const chosen_song = getRandomSong();
removeSongFromArray(chosen_song);
@sterile minnow There are a few javascript functions to highlight what to do. probably not copy and paste, but it shows how to get a random element from the songs array, then if you pass that same song element to the remove song function, it should remove it from the array
#nottested
Hello, does anyone know how to make the bot send a message when someone pings it? In discord.js
@rocky lintel check forif (msg === "<@YOURBOTID>" || msg === "<@!YOURBOTID>")
Thanks!
@neat ingot okay i'll try it
edited it a little to show how to use ๐
ty
that check for a mention anywhere within the message
assuming you got guild from message.guild
in his case he wants to send message only if the whole message is the mention
ahh yea, i do that too, but elsewhere in code. like, it runs help if mentioned and no other message or command is used
@neat ingot and how do i randomize the whole thing?
the entire array?
yes
ouf
if you wanna randomize the array just...
function shuffle(array) {
var currentIndex = array.length, temporaryValue, randomIndex;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
// And swap it with the current element.
temporaryValue = array[currentIndex];
array[currentIndex] = array[randomIndex];
array[randomIndex] = temporaryValue;
}
return array;
}
// Used like so
var arr = [2, 11, 37, 42];
shuffle(arr);
console.log(arr);
I copied that from stackoverflow cuz im lazy
this is what i tried
function rebuildSongs(){
const newSongs = [];
const length = songs.length;
for (let index = 0; index < length; index++) {
const song = getRandomSong();
removeSongFromArray(song);
newSongs.push(song);
}
songs = newSongs;
}
lol
Is a problem if in the logs of my bot, every one min says ''reconnecting...'' ?
opcode reconnect stuff i reckon
okay it doesnt Randomize at all
i'm fucking confused
oohh, sec
let songs = [{data:1}, {data:2}, {data:3}];
function getRandomSongID() {
return Math.floor(Math.random() * songs.length);
}
function getRandomSong() {
return songs[getRandomSongID()];
}
function removeSongFromArray(song) {
const id = songs.indexOf(song);
songs.splice(id, 1);
}
function rebuildSongs(){
const newSongs = [];
const length = songs.length;
for (let index = 0; index < length; index++) {
const song = getRandomSong();
removeSongFromArray(song);
newSongs.push(song);
}
songs = newSongs;
}
// to use:
const chosen_song = getRandomSong();
removeSongFromArray(chosen_song);
the previous getRandomSong only returned id
cuz im dumb ๐
okay works
yup, i tested it that time ๐
some tips to make my music bot sounds better?
now it just Clears it
or leaves it normal
okay i'm dumb
Okay no
Its just reseting the Whole Queue
pls help
@neat ingot
Please wait patiently for someone to help you.
yeah i thoght Dekita will help me cuz he helped me tho
if they are willing to help you they will when they have time, they might be busy and pinging them wont help
so just be patient please :)
What permission does the bot need to fetch invites?
Hello I have a question. Why is this not working if I react to a random message?
client.on('messageReactionAdd', (reaction, user) => {
console.log("test")
})
because the bot hasnt cached the message
iirc you'll have to enable partials in order to have that work properly
uhhh why is this happing?
you showed us everything but the actual error
oh woops it got cut off
0|index | ReferenceError: Cannot access 'modThing' before initialization
0|index | at sendLog (C:\Users\Gideon\Code\Sir Foxy\logs.js:44:16)
0|index | at logs (C:\Users\Gideon\Code\Sir Foxy\logs.js:19:35)
0|index | at banFUNC (C:\Users\Gideon\Code\Sir Foxy\commands\mute.js:127:13)
0|index | at Object.execute (C:\Users\Gideon\Code\Sir Foxy\commands\mute.js:97:19)
0|index | at processTicksAndRejections (internal/process/task_queues.js:93:5)```
anyone know what the problem is here?
if (command === "help") {
if (!message.member.roles.cache.some(role => role.name === 'Server Administrator')) return;
if (message.channel.permissionsFor(message.guild.me).has(["SEND_MESSAGES"], true)) {
if(args[0] && args[0].toLowerCase() === "one") {
const embed = new Discord.MessageEmbed()
.setColor(16763812)
.setTitle("Help one")
.setDescription("help one")
message.channel.send(embed).catch(console.error);
}
}
}
if (command === "help") {
if (!message.member.roles.cache.some(role => role.name === 'Server Administrator')) return;
if (message.channel.permissionsFor(message.guild.me).has(["SEND_MESSAGES"], true)) {
if(args[1] && args[1].toLowerCase() === "two") {
const embed = new Discord.MessageEmbed()
.setColor(16763812)
.setTitle("Help two")
.setDescription("help two")
message.channel.send(embed).catch(console.error);
message.delete()
}
}
}
});
for some reason it wont delete the message
because the args
@glad jungle well... yeah, the code doesn't know when modThing is going to be a thing because sendLog is a function
but if I change the args to [0] then it will send help one and delete the message
pass modThing through the arguments
so i'm not sure how to make it so if i send help two it will send that but then delete the message using message.delete
anyone know whats the problem
that entire code is a dumpster fire from start to finish lol
well I just don't know how to fix the args problem
if i do args[1] then it will send the embed but wont delete the message
for help one and help two
no errors?
no errors
args[1] will send the embed but wont delete the message
args[0] will send the help one embed and help two embed and deletes my message
seriously though
wtf are you doing
two help commands
combine them
if (args[0] === "one") { ... } else if (args[0] === "two") { .. }
or switch(args[0])
i personally have the first argument to my help command be a command name, to give specific help for that command
like <prefix>help commandname
yea
hey guys im having trouble im getting this error
code: 'ER_PARSE_ERROR', errno: 1064, sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'desc = hi this is a test WHERE guildid = 703190260447969351' at line 1", sqlState: '42000', index: 0, sql: 'UPDATE settings SET desc = hi this is a test WHERE guildid = 703190260447969351'
this is the code im using for the query
} con.query(`UPDATE settings SET desc = '${desc}' WHERE guildid = ${msg.guild.id}`, (err) => { if (err) console.log(err) sendEmbed(msg, 'Description sucessfully updated.') })
You're missing a quote @earnest phoenix
where
And by the way you're vulnerable to SQL injection
SELECT * FROM data WHERE id = ? ๐
guildid = [missing quote]${msg.guild.id}
that's fine
May I ask if desc is direct user-input?
it's not missing
just noticed
What permission does the bot need to fetch invites?
Can someone explain how webhooks work i never used webhook
have you tried this?
basically, a webhook is a reminder/trigger to call an api endpoint when a thing happens
for example, when a user votes
Thanks i little understand how its work i never use. Webhooks because i never need it
its like, a thing happens, lets say a user upvotes your bot. then dbl sends an api call to your defined webhook api endpoint, lets say mysite.com/upvoted. your api endpoint is then responsible for handling that information, for example, to reward the user who voted in some way.
so you would have the api sitting waiting for calls to it, just like a normal api endpoint, and then you handle the data that comes in, make sure its legit, w.e
ฤฐ understand
lol
i've been upgrading my bot from v11->v12 for over a month now
tbf, ive been rewriting almost all of it
f
U need node 12 for v12
does someone know how to get a shard id in v12?
<never had a need for sharding ๐
can smeone help
Guild isn't a manager, it doesn't have a cache property
so how would i fix that
use a property of guild that actually is a manager
how do i do that tho
Look at the docs
That looks like a webhook token
@smoky spire i cant find it in the docs
how do i use it
The same as any other property?
i dont understand this website for docs
i pretty much only understand discordjs.org
That's what I sent
Yes
discordjs.guide isnt docs, it's a guide
yeah i dont understand the docs
Better learn to understand them then
Otherwise you won't be able to do anything on ur own
that is true
Hello
How long does it take to get the bot verified?
a week or 2
Okay thx
just make sure your bot is ready because the pulled some sneaky stuff on me
I was in the middle of tweaking my bot to not be such a little bi-
my discord bot isnt connecting for some reason
How can I shorten this you think?
msg.guild.channels.cache.get("channelID").send(`\`\`\`${logerr.inspect(e)}\`\`\``);```
Should I just make a function for it?
nah thats okay
?
oh ok
Guys when I use this code I can see the voice channel get's a user limit but then it instantly goes away:
guy.guild.channels.create(roomName, { type: 'voice' })
.then(async nChannel =>{
let limit = newState.channel.userLimit;
let br = newState.channel.bitrate;
guy.voice.setChannel(nChannel);
nChannel.overwritePermissions([
{
id: every,
deny: ['CONNECT'],
},
]);
if(limit !== 0){
nChannel.setUserLimit(limit)
}
nChannel.setBitrate(br);
```Do you know why?
no because you sent nothing
I have a problem, is there someone to help?






