#development
1 messages · Page 1825 of 1
You should limit that command only to you tho
Yeah
ok good 😄
Alright gn 🙂
does mongodb supports typescript?

Okay I can’t sleep so I’m back to ask some more questions
Does anyone know the bandwidth limit for the free tier of AWS EC2?
And/or any sort of hidden fees/charges I might run into while hosting a bot on it
var findTargetQuery = `SELECT mtg_user.mtg_userID, mtg_user.mtg_health, mtg_user.mtg_guilds, mtg_gamedata.mtg_currentBattlefield, mtg_gamedata.mtg_currentHand FROM mtg_user, mtg_gamedata WHERE mtg_user.mtg_userID NOT IN (${commandRequestsString}) AND mtg_user.mtg_userID <> '${callerId}' AND JSON_EXTRACT(mtg_user.mtg_guilds, '$.${Constants.guildPrefix}${guildID}.optedInToServer') > 0 AND mtg_user.mtg_health > 0 GROUP BY mtg_user.mtg_userID, mtg_gamedata.mtg_userID order by rand() LIMIT 30;`;
Does anyone know why this would be returning the same id, but different column data for all rows?
هذا ايش
should I use mongodb or mongoose?
I had very hard time with mongoose in working with ts
quick question what are version?
like the numbers? 1.2.3 what does it do/what does it means

MAJOR 1 = big changes, most likely breaking changes
MINOR 2 = added features
PATCH 3 = bugfixes
oh nvm thats german 
the only thing i dont understand is the minor version
API-compatible new features
I'm not using/building an api
(or that's just a reference)
like you added the feature to search a user by name
r minor version is like a smol update?
which doesnt break anything
when it doesnt break older code, then yes
and its not only bugfixes
oh now i understand
so if i rewrite my whole code(ill never do) it will be a major version right
would say so yes
and the last one is just bug fixes 
yes
youre welcome
Yes
and for field values?
wait what do you mean?
ik, I could make a text for description and field values of an embed as a block text
what is guildMemberAvailable event. I didnt got the docs
Emitted whenever a member becomes available in a large guild.
well u just said what it does 
since in big servers (should be 1000+) offline members arent displayed and when a offline member comes online this event should trigger
@solemn latch you mind telling this guy to stop
he was posting these in #general a while back
@limpid herald #general-int
And it translates "Leave this server"
what's the trouble ?
moshi moshi
you there ?
because all users are not cached
do a loop and get memberCount of all servers
there is a users cache
all the server's users are working, the total one's aren't tho
that does not store all users
thats only the cache users
that just stores all cached users
Not all users are in cache
You need to add up the total .memberCount of each guild your bot is in (with reduce, for example)
oh ok, ty guys!
you really don't need parseInt
You don't need to parse the member count into an integer btw
Here fixed it
let totalMembers = 0
client.guilds.cache.forEach(g => totalMembers += g.memberCount)
or just
client.guilds.cache.reduce((total, guild) => total + guild.memberCount, 0);
Someone had to say it
reduce power 💪
😎
that sounds amazing, thanks you all
Nobody cares about that
forEach is nice
[1, 2, 3, 4, 5]
.map((num) => num * num)
.forEach((num) => console.log(num));
// vs.
for (const numbers of [1, 2, 3, 4, 5]) {
console.log(num * num);
}
Map 🩴
Or right click the role on desktop with developer mode on
yeah, but i don't want to ping all those users
i am certain that there was like a syntax for it
You can do \ @ Role but it will still ping
yeah but i aint spending money on a UPS
i'll just get a small 9v battery
oh lmao
with 500mA
how long will that last?
idk i'll have to test
just did some research
it's about 1 hour
so when lights on the battery will charge
when off it will spend it's energy
yep
x doubt
BATTERY ALKALINE 9V LONGLIFE POWER VARTA
found this one
gotta test it tho
i got like a few routers laying around
my ups had dual 12v 1.2ah batteries an hardly lasted 2 hours
😂
A standard 9V battery has about 400-600 mAh capacity. In the most basic terms, these batteries can supply about 500 milliamps for one hour before being "dead".
my router needs 500ma
i am unsureeee
xD
that's gonna total it
lol
the router will go pooof
nah you just need to regulate the voltage
get a voltage limiter
lmao
good question how long would a car battery last
yes
BRUHH
yes
is this wrong
is it tho? its pretty much development lel
yeahh
i was shocked when an UPS couldn't go longer than 2 hours
like even if u get a real big one, it can handle a few computers but still will go dead in a few hours
yeah
const canvas = require('discord-canvas'),
welcomeCanvas = new canvas.Welcome(),
leaveCanvas = new canvas.Goodbye()
const Discord = require('discord.js')
const client = require('../index')
client.on('guildMemberAdd', async member => {
const guildq = client.guilds.cache.member.guild.id
const Schema = require("../models/joinchannel")
Schema.findOne({ guild: guildq.id }, async (err, data) => {
if (!data) return;
if(!data.channel) return;
let image = await welcomeCanvas
.setUsername(member.user.username)
.setDiscriminator(member.user.discriminator)
.setMemberCount(member.guild.memberCount)
.setGuildName(member.guild.name)
.setAvatar(member.user.displayAvatarURL({
format: 'png'
}))
.setColor("border", 'BLUE')
.setColor("username-box", 'RED')
.setColor("discriminator-box", 'GREEN')
.setColor("message-box", 'BLACK')
.setColor("title", 'YELLOW')
.setColor("avatar", 'PINK')
.setBackground('https://media.discordapp.net/attachments/847794443180048394/863973336035885056/wallpaper.jpg?width=1178&height=662')
.toAttachment()
let attachment = new Discord.MessageAttachment(image.toBuffer(), "welcome-image.png");
guildq.channels.cache.get(data.channel).send(attachment)
})
})```
TypeError: Cannot read property 'guild' of undefined
no
ok no
cache.member is not athing
member.guild yes

so how to fix it?
member.guild
yes
ok
@quartz kindle
const canvas = require('discord-canvas'),
welcomeCanvas = new canvas.Welcome(),
leaveCanvas = new canvas.Goodbye()
const Discord = require('discord.js')
const client = require('../index')
client.on('guildMemberAdd', async member => {
const guildq = member.guild.id
const Schema = require("../models/joinchannel")
Schema.findOne({ guild: guildq.id }, async (err, data) => {
if (!data) return;
if(!data.channel) return;
let image = await welcomeCanvas
.setUsername(member.user.username)
.setDiscriminator(member.user.discriminator)
.setMemberCount(member.guild.memberCount)
.setGuildName(member.guild.name)
.setAvatar(member.user.displayAvatarURL({
format: 'png'
}))
.setColor("border", 'BLUE')
.setColor("username-box", 'RED')
.setColor("discriminator-box", 'GREEN')
.setColor("message-box", 'BLACK')
.setColor("title", 'YELLOW')
.setColor("avatar", 'PINK')
.setBackground('https://media.discordapp.net/attachments/847794443180048394/863973336035885056/wallpaper.jpg?width=1178&height=662')
.toAttachment()
let attachment = new Discord.MessageAttachment(image.toBuffer(), "welcome-image.png");
guildq.channels.cache.get(data.channel).send(attachment)
})
})```
it is not sending the attachement when member joins the guild
def addUpvoteRecord(userid):
with open("vote.json") as f:
vote_list = json.load(f)
if not userid in vote_list:
vote_list[userid] = []
with open("vote.json", "w+") as f:
json.dump(vote_list, f)
@client.event
async def on_message(message) :
if message.channel.id == 870147153706750022 :
data = message.content.split(" ")
user = re.sub("\D", "", data[5])
addUpvoteRecord(user)
await client.process_commands(message)
i am getting this error TypeError: list indices must be integers or slices, not str
can anyone help me??
guildq is a guild ID not a guild
ye so i want to send the attachment to the guild channel that they have set
so i need guild id to find guild then i did cache.get(data.channel).send
to send it
so i am not sure why is it not sending
You know what would be pog
A way to sort slashcommands
with like categories or something
sub-commands exist
You can only have 5 sub commands?
Why is my github webhook giving me {"message": "Cannot send an empty message", "code": 50006}
That's an error returned by Discord
How do I fix tho?
Send content in the message
did you add /github to the end of the webhook url
oh ye fuck I forgot to that

my bad
Common mistake. All good
{"_misc": ["Expected \"Content-Type\" header to be one of {'application/json'}."]} 
In github, set the send type as json
Hey! How would i get a random element from this array?
What language are you using
js
array[Math.floor(Math.random() * array.length)]
this is actually a site: https://www.randomlists.com/data/animals.json. i would have to use a get request right?
array.length - 1
really
no - 1 necessary
Math.random is from 0 - 0.9999999999999999
LAL ive been using -1 for years
inclusive?
oh
i legit did not know it was not 0 - 0.99
repeating
should i like use a get request?
That's the only way how to
there's bigger precision available
the precision doesn't matter here
regardless of the float value, it'll always be in bounds of the Array
alright, i've made the request and got what i needed using response.body. However, how would i know reach that items array?
respose.body.Items?
if you using firefox developer edition, sometime it show how the structure is, very good for making api wrapper kinda stuff
depending on how you made the request, you may need to parse it first
because by default you are getting pure text, not an object
if you use libraries like express it can format it when sending a response actually
but thats even more neat
i just use a json extension for chrome
but that firefox thing is very interesting
i would use an extension but, i already have alot of those
is it collapsible?
thank you
I can ask a question about rest api here?
that looks awesome
sure
is it worth using OOP for rest api?
sure
okey
nice, i just installed it
thanks
but depends if your gonna have like, a big api i suppose
something small could be functional programming if you use something like javascript
(express)
yes I use javascript
thank you
if its small its fine for functional programming
once it gets bigger, may i ask what library you use?
express
if you use express, routers are awesome
ok great
using routers and splitting your code base makes a huge difference
my eyes 
I have a doubt
it's ok if I make my own module to post the information on topgg (servers and shard quantity)
why the ones on npm don't work for me because my bot uses a CLUSTER system that I made
hey! how would i enter array items? I tried response.body.RandL[0].items, but it didn't really work.
idk, this reponse confuses me for some reason
better?
kekw, way better
can anyone find the JSON error at line 39 it says but i just cant fix it
https://srcb.in/XxL7I0kRAO
What's the error
when syncing threads from the thread list sync event, am i required to clear out ALL threads under the parent channel ids or only active threads?
anyone that has any clue?
I wouldn't see an issue either tbh, are you sure it's not vscode bugging out? Does it error when you require the file?
hey anyone knows how do I update a array inside a nested object in mongodb using mongodb official package for nodejs?
response.body.RandL.RandL.items
That is if you are sure response.body is the parsed json response body
why isn't message.guild.members.forEach() a function?
Because message.guild.members is a GuildMemberManager (assuming d.js v13). Did you mean message.guild.members.cache.forEach?
^ applies to djs v12 as well
i use V12 but right, that changed there thx
Is there any way I could modify djs caching like I don't want to cache everything like every voice state. Is there any way I could modify that?
why does this code: https://srcb.in/HAvTBZ3kWj
return this
use discord.js-light (npm package) allows to pass cache options to client, made by Tim
in v13 you can, in v12 you have to use extra packages, such as ^
yes I use v13
sorry replied to wrong message
then you can turn the caches off
but then how will I get voice states data?
There is <client>.sweepMessage() method too
const client = new Discord.Client({
intents: [ /* your intents here */ ],
// set to 0 to disable
makeCache: Discord.Options.cacheWithLimits({
ApplicationCommandManager: 0,
BaseGuildEmojiManager: 0,
ChannelManager: 0,
GuildBanManager: 0,
GuildChannelManager: 0,
GuildInviteManager: 0,
GuildManager: 0,
GuildMemberManager: 0,
GuildStickerManager: 0,
MessageManager: 0,
PermissionOverwriteManager: 0,
PresenceManager: 0,
ReactionManager: 0,
ReactionUserManager: 0,
RoleManager: 0,
StageInstanceManager: 0,
ThreadManager: 0,
ThreadMemberManager: 0,
UserManager: 0,
VoiceStateManager: 0
});
});
this is for djs v13
all the caches you can disable
you dont. djs does not fire events for disabled caches
only some of them if you enable partials
tim tim
but most will not
hhmm
big intellij update, they did it again
im woring on discord.js-light for v13 to make them still fire even if disabled
I want to do like I don't want voice states of bots, and fetch a voice state when a user uses join command
you cannot fetch voice states
hmm
? can someone help?
nice, although its not a new thing, i've seen this feature in other stuff and extensions
missing permissions
@quartz kindle do you know what causes this?
life
haha funny
My bot has admin....
admin doesnt magically fix all permissions
Oooo
it can still be overriden by channel permissions and by roles higher than your bots role
Someone here knows about Discord.py?
no idea
what is the purpose of the update function?
i dont see it being used anywhere
that's the smallest thing
it's got so many QoL features
anyonymous function at line 34
including screenshare during code with me
Ask your question
thats duplicated code
you dont need both
also, you're not passing any arguments to the anon function
wait user isnt defined
((user,xp) => { // function arguments
if (!leaderboard[0]) return leaderboard.push([user,xp])
if (xp >= leaderboard[0][1]) return leaderboard.splice(0,0,[user,xp]);
if (!leaderboard[1]) return leaderboard.push([user,xp])
if (xp >= leaderboard[1][1]) return leaderboard.splice(1,0,[user,xp]);
if (!leaderboard[2]) return leaderboard.push([user,xp])
if (xp >= leaderboard[2][1]) return leaderboard.splice(2,0,[user,xp]);
})() // <- missing function parameters
I'm trying to do something like this (picture is from another bot i saw in a server) but seems like i'm not that good at making that stuff
thats markdown
Oh those timestamps too
# 07:52 PM
i even noticed that the time shown there is accurate and is like a real time
but tbh i don't know how to do that
but i mean, those ones doesn't refresh to show actual time
<t:1627567995:R>
wait, let me share the code i had rn
they refresh if you go to another channel and come back
@bot.command(name = 'time')
async def _time(ctx):
embed=discord.Embed(title="Timers:", color=0x8fc4ca)
embed.add_field(name="EU", value=f"<t:{int(time.time()+1*60*60)}:t>\n<t:{int(time.time()+1*60*60)}:R>", inline=False)
await ctx.send(embed=embed)
await ctx.message.delete()
kinda want a format like the image i provided, but tbh i'm still not that good at discord.py
i dont think you can put that inside code blocks
for the blue time, you have to parse the time yourself
using pythons own time functions
and how should i add that into the code?
the blue color is code blocks with markdown as a language
the rule is "blue for lines starting with #"
yup, but how should i add that code block into the code i provided above?
i think py has functions for that, but you can literally type it into the value field
oh
Guys what permission does a Discord bot need normally to do the emoji reaction navigation thing?
Manage Messages?
Sooo... should be like this?
embed.add_field(name="EU", value=f"# <t:1627567995:R>", inline=False)
you dont need manage messages
no
Thats what I thought. Anything they do need?
reactions and external emojis
oh i see, let me test
but at this point, nobody uses emoji navigation anymore
use button navigation instead
buttons are so much better
i told you it wouldnt work
you can't have that inside of code blocks
oh
It's same as doing bold text inside code blocks, doesn't work:
# **BOLD**
then i'm lost on how to do that... lol
as i said, you have to use python's date time functions to turn your date into the text you want
ah
and then put the text inside the code blocks
have an example?
i see i see
Hey i actually tried this out:``const oldStream = oldPresence.activities.find((a) => a.type === "STREAMING");
^
TypeError: Cannot read property 'activities' of undefined``
Why is that?
is it because people already went live before the bot was in the server?
"discord.js": "^12.5.3",
I think that it is because i booted up the bot in a really crowded server where people already went live
so it couldn't detect their older presences
even so, discord.js creates a blank presence when it doesnt have an old one
strange!
client.on("presenceUpdate", (oldPresence, newPresence) => {
const guild = client.guilds.cache.get("814452880584474664");
const oldStream = oldPresence.activities.find((a) => a.type === "STREAMING");
const newStream = newPresence.activities.find((a) => a.type === "STREAMING");
if (oldStream && !newStream) {
// user stopped streaming
}
``` this is my code
i am.
hmm wait what?
?. is optional chaining
oldPresence?.activities.find((a) => a.type === "STREAMING"); Basically like this.
i will try it out and let you know
is it a good idea to work on a project for ecommerce with mern
tim you are the best man! It actually worked!
of course it worked, programming is science, not magic xD
Yup!
Or if hover over it
hey @quartz kindle how would i update my node on my vps to v14?
i use nvm (node version manager)
sudo apt update && sudo apt install nodejs npm this right??
alrighty, will use nvm then,
i gotta rebuild all my scripts that are running on node right?
after updating
With socket how could I make that when the server stops it doesn't stop the process but tryes to reconnect every 5 seconds until it reconnect
(python)
how do i only show the logs of 1 directory on my ubuntu vps
cuz now it;'s a cluster fuck of pm2 logs
but can someone show an example of how its used
why does this code try to delete the message twice and send the author a message twice while the censored word is only in censorList.autoModTrigger https://srcb.in/pvYt1ZcS3n edit: added all the code
if you know what || (or) does then ?? works pretty much the same way but with slightly different types
const test = someNullVariable
?? 0;
Is equivalent of
const test = (someNullVariable === null
|| typeof someNullVariable === 'undefined')
? 0
: someNullVariable;
With socket how could I make that when the server stops it doesn't stop the process but tryes to reconnect every 5 seconds until it reconnect
(python)
dont even try to remember it
It has the same left-right operand behavior as || but it checks if the value is either null or undefined
can someone help?
The name of the ?? operator is the nullish coalescing operator
i see
not gonna remember that anytime soon
is that actually a word
coalescing


"Rate limiting is currently set to 90 requests per minute". For discord bot, is this quite restricting?
could there possibly be more than one word that's blacklisted
by the way that code is very inefficient
nope, i only said one blacklisted word
what should i use then
could you try adding break at the end of each message.author.send and see if it happens again
i already fixed it, the word was twice in the censorlist, but how would you suggest me to do it more efficient?
the thing is
what you're doing right now is iterating over the whole censor list to check
if it's large it could get quite slow
so what should i use to make it faster than?
i'd advise you iterate over the words in the message instead
but it shouldn't matter that much with a small bot
its a private bot for one server so
yeah you shouldn't worry about that too much then
ok
especially if you're still learning
Any general idea on this
where did you get that from?
is that for the global rate limit?
for specific IP
i've rarely used ?? before ngl
?? Is pog
{
id: 131518,
title: {
userPreferred: 'Dr. STONE 3',
native: 'Dr.STONE 3',
english: null
},
coverImage: {
extraLarge: 'https://s4.anilist.co/file/anilistcdn/media/anime/cover/large/bx131518-GVBd1Eh5gC3p.png',
large: 'https://s4.anilist.co/file/anilistcdn/media/anime/cover/medium/bx131518-GVBd1Eh5gC3p.png'
},
startDate: { year: null, month: null, day: null },
endDate: { year: null, month: null, day: null },
bannerImage: null,
season: null,
description: 'The third season of <i>Dr. STONE</i>.',
type: 'ANIME',
format: 'TV',
status: 'NOT_YET_RELEASED',
episodes: null,
duration: null,
genres: [ 'Action', 'Adventure', 'Comedy', 'Sci-Fi' ],
isAdult: false,
averageScore: null,
popularity: 26415,
nextAiringEpisode: null,
studios: { edges: [] }
},``` Good for something like this
I mean the nullish
|| = "=="
?? = "==="
is that the anilist api
yeah, anilist api
make sure you learn how to use it properly cuz top.gg is gonna use the same graphql api 
that's cringe
Tfw you set the description html parameter to false but it still sends html
that's not how you spell gamer
is it just me or do i see graphql hyped everywhere but rarely see any apis actually use it
Idek what graphql is
apparently it lets you specify what data you want in the request to reduce the unnecessary data sent back from an api
And what's ungamer about it
it lets you build responses in a language called graphql
Sounds gamer to me
Firefox dev edition really help me with it
yeah it sound good but i dont see many apis use it
That's very true
Out of all APIs I worked with the only one I used that uses GraphQL was AniList
Lol use AniList.co/graphiql
It's useful
message.channel.send(`${message.author}, watch your language.`).setTimeout(() =>{m => m.delete}, 3000);``` why `TypeError: message.channel.send(...).setTimeout is not a function`
Go to the site so I can compare to what I receive vs my request on nodejs post
1 - setTimeout isn't a function on messages
2 - discord.js removed timed deletes
why this says setTimeout is not a function?
they have an example on their docs on how to delete messages based on time
no v12
o
but you should be using the new things anyways
IIRC they're removing the timeout option in v13 and force you to use setTimeout() directly
actually no they still have it
In v13?
idk
yeah just use
im on v12 master and i dont have it
maybe they added it back
i added it back by extending the message structure
well lets test this then .then(msg => {setTimeout(() => msg.delete(), 3000)});
should work
Yes
Huh
Aka read docs
like msg.guild.cache.channel or msg.guild.channels.cache
You tell me
ill just try second one
With socket how could I make that when the server stops it doesn't stop the process but tryes to reconnect every 5 seconds until it reconnect
(python)
You guessed right
i just forgot it for 1 sec
But read docs
Discord.js has such a wonderful docs
It's a shame that some people don't use them
You can even download it for offline use
it's even a pwa lmao
the old doc site is easier to navigate imo, but I get used to new one
I don't like the fact that the branch dropdown is hidden under another dropdown
Well whatever it's not like I use the lib
But I need it to help people
guys help pls
why is replit offloading installed packages after inactivity
im having to download tons of packages repeatedly
pls help
it's a trade off
what should i use then?
you either pay or use it for free
Repl.it/Glitch/Heroku isn't meant for hosting a Discord bot
use AWS
it gives 1 year (2 yrs with student) VPS for free
Use a VPS instead
2 years sign me up mate
can u pls guide me?
im on a year free tier credit card
umm i dont have credit card
yeah big hosting companies wont give you access to their infrastructure without a card
You have GitHub student ?
yes
well i cant use my mom's
Then sign up
what are you waiting for ?
idk what im waiting for tbh
My bot is restarting on its own what could be the reason of it
i'll give it a try
Unless you've used up free tier like me
yeah i did that
i can send code here right?
but i dont see them on the gh student page
yes
from flask import Flask
from threading import Thread
from discord.ext import commands,tasks
from itertools import cycle
from discoIPC import ipc
from discord import Client
from discord.ext import commands
from discord.ext.commands import Bot as BotBase
from discord.ext.commands import Cog
import discord
app = Flask('')
@app.route('/')
def home():
return "Hello. I am alive!"
def run():
app.run(host='0.0.0.0', port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
``` this is for the thing thats keeping it running
token= os.environ.get('Token')
keep_alive()
bot.run
``` this is the last part of my code
so can pycharm do these things?
like
after running im just closing the replit window
its keeping the code running but if i close pycharm it will terminate the process
you're running the code on pycharm
^
Caught in 4k
w a t
Do you know what a pycharm is
Well I sure don't
im asking for comparison
ive run this code on both
im asking what will give me a better result
pycharm is an ide, it doesn't affect how good the code will run
And obviously it stops working when you close the ide
but terminating the process will make the bot go offline
well, obviously
then buy a vps
If you have a potato pc pycharm will be shit
vise versa
its not happening with replit
yes
Well it's like a docker container
because replit isn't made for long-lasting processes (aka is made for websites)
that's why it goes off after inactivity period
Isn't replit supposed to be an ide ?
it "is"
replit, heroku
you need to keep pinging it to prevent inactivity shutdown
credit card
heroku asks for credit card doesnt it?
like uptime robot
no
well, it kinda does
oh
??
without credit card you won't be able to keep bot online 24/7
i dont have one
like, you'll be able to keep at most 20/7
my mom wont give me hers
which sucks ik
Free tires:
AWS 1 or 2 YEARS
GCP 1 year
Azure 1 year
Heroku Forever
DO a few months
Vultr 10 months
works but inefficient
Car tires
haha
my inlis no gowd
Whatever floats your boat 😎 👍 👍
when you're going free you don't use the word "efficiency"
gcp has a free tier?
Yes
why am i hearing about this just now
Micro F1 or whatever the fuck it's called
unless you're negating the term
300 credits for a year + some free forever
yeah i used up all my credits by accident so im guessing i have access to the free instances
That can't even load a bot with 1k servers (d.js)
my mother would spank me until there is no more skin left if i asked her that
tim is special everything works for him so he doesnt count
just remember that "free" means either "shitty performance", "heavy limitations" or "gotta rely on life hacks"
life hack: refresh your uptime page every 5 minutes
what was that old saying? "you don't judge a free horse by its teeth"?
A free horse tf
quirky
I'd love to have one
As long as it's free
you mean "chew it"
worse she told me to ask my father
Don't judge a quirky book by its teeth
i'll chew the grass then passively transfer it from my mouth to the horse
that sounds wrong
Glad you have one
got a bit deep
im so sorry bro
oh I have one too sleeping next to me
ok that was not cool
never
I get free food + free laundry + free internet
I'm never moving out
cant wait man
to get a good job and move out
a dream
same haha
i was trying to use stickers feature from "stable" version but idle thrown TypeError: 'use_external_stickers' is not a valid permission name.
•~•
(copied right from docs ofc)
you sure you're completely up to date?
i just imported discord
and tried to use "stable" instead of "latest"
•~•
and wat now? im banned on official server BTW
Speedy has stopped working
means? powered off?
Yeah
lmfao
Gotta wait until it responds back or close and open it again
means? how close and open?
Get the knife.
?
how do you get banned from their server
ping to admin where others were swearing in general
and i thought discord js admins thought highly of themselves
NOT JS, PYTHON U DUMB
:|
pls no namecalling
broh
you said you took the code from the documentation? can you show it
gimme a moment
the people in the discord.py server look a bit intimidating i think i'll stick with the js community
i know but what if i use pyton?
i never told you to use anything else
ik but smh i cant yet understand js 😂
not for my head 😂
anyways - i know - they didnt added stickers in both versions - ill rerun and check other perms =p
worked
sry for msgs
yeah i thought there was something wrong with your syntax
How much bandwidth would I be using if I were sending videos (of up to 8mb) on my bot fairly frequently? Would I need more than the AWS free tier bandwidth limit (1GB per month out)?
i mean you can do some math
Yeah I was just wondering if there’s anything weird with it
figure out your average bandwidth usage per hour or day or whatever
Because 1GB seems like nothing
actually good point
thats a little low
you'll probably run out quickly doing that + other things
I read it online, I haven’t looked at the actual AWS limit
So I’m not sure if 1GB per month is credible or not
Yeah, I’m gonna do that when I have access to my computer later today
what instance are you running
one sec i'll try check on the website if i manage to login
i dont actually see any bandwidth limit
i only see "low to moderate"
Yeah
in network performance
I guess they’ve changed it then?
I read this on a third party site
I’m just making sure I don’t get like a billion dollar surprise bill at the end of the month
on the official website i dont see anything
As a general guide, the smaller sizes of C5, M5, and R5 instance types can sustain up to 10-Gbps network performance. Larger instance sizes can sustain between 10–25 Gbps. Smaller sizes of C5N provide up to 25 Gbps with the largest C5n instances scaling up to 100 Gbps. Some examples of instance type, configuration, and associated limits are prov...
i only see gbps not per month
If that’s the case then that’s perfect
you should ask them though just in case
I’ll monitor the free tier limits carefully as well
make sure to set spending limits if you havent already
Having a 50 cent bill at the end of the month isn’t gonna be bad, but I just wanna make sure I’m not having like a 20 dollar bill etc
Yeah I’ll set those when I get home
I swapped to AWS from Heroku because Heroku was shitting itself in performance (to be expected)
Plus it was only like 550 dyno hours per month
yeah can't expect much with their free dynos
you're supposed to be hosting websites there anyways
Yeah
been waiting about 4 months and still counting for them to let me into their github student program
Lol
had to link a card and all to even apply
Might have to go back to Heroku free tier if this AWS thing turns out to have additional charges I didn’t know about
But we’ll see
they'll most likely refund any charges you weren't aware of either way if the bill is large enough
unless they treat free tier users differently
Amazon is a corporate conglomerate worth over a trillion dollars so I highly doubt that they wouldn’t give someone a refund on their first overage
if you're tranferring over 150TB per month I don't think money's an issue at all
yeah, if only they started changing at that much usage lol
I want to use json files as a database, for small project.
Which is the best package out there?
dont
problem solved 
if you want a small db for a small project use sqlite
👌 Glad i awnsered your question
your welcome
but still, 😢
I'll not use it that much, I promise
if you use it only once it's still too much
0.1% 👍 promise
too much
have this error (node:10224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'voice' of undefined and this code
Someone used it in a DM I assume
God that's expensive
Where did you get that screenshot from? AWS is really really vague on pricing specifics, I assume it's because they want to slam you with a hidden bill at the end of the month
errr its from a previous ss i took of aws stuff before they changed stuff around a couple months back
seems they have really tried to high the bandwidth usage costs now lol
Yeah
I literally can't find straightforward information on bandwidth limits on their site. It's like they're trying to hide it (which I don't doubt)
finally
All I know is that 1Gb per month seems like absolutely nothing
I think I'll just verify a payment method with Heroku to get more free hours per month. They have a 2tb soft bandwidth limit which is a vast amount that I will certainly not run out of.
the death of most bots without slash commands is upon us
I highly doubt they will give it to anyone
yes
any bot that's commands could be on slash commands instead of traditional methods, are gonna be told "use slash commands" i feel
you can't access content, attachments, embeds and components btw
ofc we'll have to wait and see
but you can access author etc
but that's what I think is gonna happen
im gonna have to migrate mine, the only reason i didnt yet is because slash commands are gay
same
just
It's gonna suck
if you think of some servers having like 50 bots
all using slash commands
and constantly having to scroll through etc..
i love slash commands because it does everthing for you: handling arguments, forcing to use required arguments, showing description of each parameter
wdym without npm
you have to install it some way
how does it not work?
so?
the npm website is not the only place where npm can install from
npm can install directly from github
npm i clashperk/quickchart
one of my bot's command is forcing the bot to restart sometimes it worked normally most time it restarts the bot anybody know what could be causing it (was working fine before today)
and command is a leaderboard command which gets data from db and make list
^
I guess the main issue of them is that they don't feel so smooth as just writing chelp or whatever
any error?
what are the last logs before it restarts?
show code
ok
Man just realised that all of my time spend working on command aliases is out the window now
its the fuk
i dont understand why
the fuk has come to discord
DUDE THEIR ASSES
are on fire
are they out of their mind???
i legit didnt finish the update
9 MONTHS?
TF IS 9 MONTHS,
i didnt understand what will happen in 9 months
In 9 months it'll require an application for content intents
you apply for the intent once applications open
if you are approved, you dont need to do anything
if you are denied, you get fucked
I guess moderation bots will be approved, at least some of them
but what do i do in this 9 months?
I mean moderation without message content is interesting though
do whatever u did before?
and wait for more details
they gave us 9 months to update our bots to slash commands, if they dont have any good reason for reading people messages
does your bot need to read peoples messages for some reason other than listening to commands? wait and apply
otherwise, start working on moving to slash commands
will it count messages like yes and no or only the ones starting from prefix ?
Idk
they are working on ways to accept followup messages
they said slash commands will improve a lot in the next 9 months
Wait.. basically I have a moderation bot that does absolutely nothing but listen to commands.. I have to switch to slash commands and apply for that message content thing?
to make more people interested in using them
yes
.. and what if I don't?
OH.
they will add something for taking user input
.. and if I get denied in the intent.. im fucked.
.. and to use slash commands.. do I need the intent?
no
no
-3 months
0.75 years
what discord api library do you all think is good for nodejs? (better than discord.js)
nothing
most people will say detritus
you can also try berry's lib: discord-rose
btw what happened to ourcord?
xD
🗑️
Nothing, discord.js is the best :D
and jeff bezos is an empathetic human who cares for his employees :D
two lies and no truth
Xd
they havent finished v13, meaning no slash commands or buttons
npm i discord.js@dev
here you go
.. I'll eventually rewrite to slash commands soon.. but I'm 70% confident I'll get approved since they approve moderation bots.
.. IF IM LUCKY ENOUGH.
Meanwhile.. doesn't hurt to create a new application about slash commands to gain knowledge. 🤷♂️
First rule: there is no such thing as luck.
Second rule: Imma get denied and eat shit in the end.
If I get denied in Fall.. well sh*t is sh*t.. I'm dead. 😂
😂 😦

I'm creating a level system in my bot and I'm trying to put a system in to add roles when a person reaches a certain level, but I don't know how to do it without "ifs" or if I can add "ifs" with base date. Can someone help me ?
what are your current ifs?
if(level === "1000") {
console.log(`the user: ${user} reached level 1000`)
}
How can I take the specified part of a json? For example I want to splice it 3 to 4.
const list = {
1: "test",
2: "test2",
3: "test3",
4: "test4",
5: "test5",
}
Expected Output:
{
"3": "test3",
"4": "test4"
}
you have an if for every single level?
objects are unordered structures, they are not guaranteed to be in the same order
so you cant really splice them by index numbers
you can convert it to an array of keys or array or values and splice that
but once again, order is not guaranteed
no, the user will add a specific level, for example if a user reaches level 1000 he will gain one role and if user reaches level 2000 he will gain another role and so on
add an entry to your database with level and role id
then on level up, check if the new level exists in the database
if it exists, get its role id and add it
ok
uhhh
communism didn't spread fast enough
hey, does anyone know how i would get the refresh and access tokens of my twitch client?
Their docs just confuse me even more
Huh message content will get a privileged intent… wow
completely fair imo
Hmm somehow yes and no, sure you actually dunno if a BOT listens or logs any of your messages which is a privacy concern BUT bots need to be invited, can’t join by themselves and they are marked as bot which means server owners are aware of the privacy "issues"
It’s just a lot of work to verify all the bots which aren’t transiting to slash commands/interactions but wanna get verified
Or to edit/recode the bots
To be fair tho it forces developers to use a standard command system therefore making it easier for users
Bots won’t have access to content if they don’t need it which is a plus
there also aren’t many issues with rewriting a bot or two, or at least the command handler to register them as slash commands
How do I check if a new line is added to a txt file?
( its a txt file full with names) from a website
And I want to know when a new name is being added basically
download the new one and compare both
Well yeah you’re right about that
Have never dealt with slash commands but rewriting the command handler is a one time job and somehow not really difficult
But regarding privacy concerns I wanna say I’m more concerned about discord than their bots, but that’s my opinion of course
Doesn’t mean it’s a bad step overall
some people have like 200 commands all in a single index file
(i did that with my first ever bot)
that may be quite difficult to rewrite
meh actually now that i think about it you can replace a few variables and do a couple regex searches
My / still working it seem even without the GUILD_MESSAGE was scared it will affect some of my command
your / ?


