#development
1 messages · Page 1308 of 1
literally every event on discord py stopped working for my bot since yesterday even though I never changed any code. also nothing appears on console
like a = 69
can someone help me?
@earnest phoenix intents?
oh maybe
is it possible that the shard 0 takin too long to get ready thing might be related to ratelimits due to fetching a lot of stuff from api 
or would we be getting another error 
@misty sigil enabled both and still doesn't work
look at the docs
my bot so many restarting in my vds
and discord generating new token
i how to disable restart in any error
pls helpp fast :c
i have not restart code's
wait are you hosting at glitch
@toxic jolt your bot is epicum
wait are you hosting at glitch
@earnest phoenix nope
o
your bot is epicum
epic
😳
Can I put this in my config file
cortex is havin seizure
"SEND_MESSAGES", "VIEW_CHANNEL", "EMBED_LINKS", "ATTACH_FILES", "USE_EXTERNAL_EMOJIS"
for checkign this
message.guild.me.permissionsIn(message.channel).has(
the name can't contain spaces
No I mean like
i fixed!
ok
{
"token": "TOKEN",
"prefix": "ch-",
"prems": ["SEND_MESSAGES", "VIEW_CHANNEL", "EMBED_LINKS", "ATTACH_FILES", "USE_EXTERNAL_EMOJIS"]
}
.has(config.perms)
now you made a double array lol
that?
ye
lmao
@earnest phoenix most likely what turtle said
No
what can i do
i have no name
u cant ping me
@earnest phoenix when you do npm init the program will ask you to answer a few questions, one of them is for you to chose a name for your application
if you add the -y, it means to just use all the defaults, instead of asking you
and since your folder contains a space, it will try to use your folder's name as your application name
but application names cannot have spaces
where does it say that
my bot so many error getting econnreset
i how to fix this error
@quartz kindle thx man
i use this
xd
well
whats the best way to make a web server?
in python or js?
and yes, hi
.-.
what is a rick astley -,-
there
lol
yes, but...
best way to make a web server
python or node.js
oh luck with the backend
@earnest phoenix that image
please tell me you at least understand whats going on
jesus christ
@earnest phoenix the program is asking you questions, one at a time
first question: package name, you answered: bot-stuff
second question: package version.
now its waiting for you to give it a version
like 1.0.0
or whatever you want
it shows the default value in parenthesis
yes
Logda ne yazıyor
undefined = not defined
-notr
İngilizceden başka dillerde sohbet etmek için #general-int kanalını, top.gg hakkında (Türkçe olarak da) destek almak için #support kanalını kullanın.
Bu kanalda Türkçe konuşmayın.
there are so many things wrong with that code
Im trying to install mongoose, but I get this error:
npm ERR! Unexpected token in JSON at position 0 while parsing near ' ...'
node index.js
How do I get the mentioned users ID? I basically did this below:
let user = message.mentioned.users.first()
message.channel.send(user.id);
and it doesnt work, Discord.js v12
const user = message.mentions.users.first();
I tried that as well and it didnt work.
const member = message.guild.member(user);
correct @quartz kindle ?
pls tell me yes
@earnest phoenix its asking you to define an entry point file from where to start your program. the default is a file named index.js
Ohhh, Thanks. I’m used to discord.js v11 so it’s hard.
message.mentions gives you all mentions in a message
then .users gives you their user forms, while .members gives you their member forms
Ohh I had .users
both users and members have .id tho
how do I add images to my bots page?
so both will work
I’ll try .members
@earnest phoenix upload them to somewhere and then put the link in the page
or convert them to base64
@earnest phoenix https://www.w3schools.com/tags/tag_img.asp
Doesnt work and no error in the console
show code
The entire code?
yes
Okay
const token = process.env.token
const discord = require('discord.js')
const {MessageEmbed} = require('discord.js')
const db = require('quick.db')
const Client = new discord.Client()
let prefix = "!"
Client.on('message', message => {
const user = message.mentions.members.first() || message.author
if(message.author.bot) return;
let Messages = db.fetch(`MessagesSent_${message.guild.id}_${user.id}`)
db.add(`MessagesSent_${message.guild.id}_${message.author.id}`, 1)
if(message.content == '!messages') {
const messagesEmbed = new MessageEmbed()
.setTitle("Command: Messages")
.setColor("FFFFFF")
.addField(`**Messages!**`, `${user.username} has \`${Messages}\` messages.`)
.setFooter("Credit to Quatenus for this.")
message.channel.send(messagesEmbed)
}
if(message.content == '!commandsused') {
let cmdused = db.fetch(`COMMANDSUSED_${user.id}`)
let SENDER = MessageEmbed()
.setTitle("*Commands Used\\*")
.addField("**Commands Used By: " + user.username+"!", `${user.username} used \`${cmdused + 1}\` `)
.setFooter("Credit to Quatenus for this.")
message.channel.send(SENDER)
}
if(message.content.startsWith(prefix)) {
db.add(`COMMANDSUSED_${message.author.id}`, 1)
}
})
Client.login(token) ```
still not a code block
Do I put js at the top?
Np.
```js
/code
```
can someonehelp me do this- likeinserting the img like i am confuesed how this works
I tried .users and it didnt work either
which checks if they have a nickname first
@earnest phoenix https://www.w3schools.com/tags/tag_img.asp
But let me test if theres a error with .users
Here is developer support?
yes
Ok
it does not help me that much-
.users still doesnt work and no error
like how do i turn that image to into a code-
@agile lance what does "not work" mean here?
no answer at all?
or a wrong answer?
No answer
I have a bot and i don't know how invite it in my server
if i did !messages myself it works but when I mention somebody, Nothing happens
thats beacuse you're using a string comparison
"a" == "a" works, but "a someone" == "a" does not work
you have message.content == '!messages'
the moment you write !messages someone the message content is no longer !messages
can someone help me turn the image that i sent into a img code, im very confused... ;-;
I have a bot and i don't know how invite it in my server
Khm khm
@ebon topaz you can generate an invite link for your bot here https://discordapi.com/permissions.html
@earnest phoenix you want to upload it somewhere or you want to convert it to base64?
basicsally..
How do i set channel permissions? My code is: js channel_Def.overwritePermissions([ { id: message.guild.id, deny: "VIEW_CHANNEL" }, { id: message.author, allow: ["VIEW_CHANNEL", "READ_MESSAGE_HISTORY", "SEND_MESSAGES"] } ], `Ticket for ${message.author.tag}`)
This doesn't work and no errors are given. (This is D.js v12)
like insert the image than it turns into a code
@earnest phoenix do you know what uploading means?
Like inserting the image... im very confused and i just woke up im sorry-
uploading means storing the image somewhere, like in a server, or in a service like imgur
once you have the image stored, you can then gain access to a direct link for the image
how can i get all the channels the bot is in?
like this??
<blockquote class="imgur-embed-pub" lang="en" data-id="a/wO2RLdH" data-context="false" ><a href="//imgur.com/a/wO2RLdH"></a></blockquote><script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>
is this correct?
How do i set channel permissions? My code is:
js channel_Def.overwritePermissions([ { id: message.guild.id, deny: "VIEW_CHANNEL" }, { id: message.author, allow: ["VIEW_CHANNEL", "READ_MESSAGE_HISTORY", "SEND_MESSAGES"] } ], `Ticket for ${message.author.tag}`)
This doesn't work and no errors are given. (This is D.js v12)
message.author isn’t a id
does it have to be a id?
message.author.id will return a string with the id
what is this error (discord.js v12)
UnhandledPromiseRejectionWarning: AbortError: The user aborted a request.
When I type something specific to the bot it fails and restarts
Show code
@earnest phoenix check line 211 of your bot.js file. Send us the code.
Oh
It’s because guild is undefined
Null*
Meaning it is a dm channel
@earnest phoenix
if(!db.has(`reklam_${msg.guild.id}`)) return;
const reklam = [".com", ".net", ".xyz", ".tk", ".pw", ".io", ".me", ".gg", "www.", "https", "http", ".gl", ".org", ".com.tr", ".biz", "net", ".rf.gd", ".az", ".party", "discord.gg",];
if (reklam.some(word => msg.content.includes(word))) {
try {
if (!msg.member.hasPermission("ADMINISTRATOR")) {
msg.delete();
return msg.reply('**Bu Sunucuda** `Link Engelleme`** Aktif Link Atmana Izin Veremem !**').then(msg => msg.delete(3000));
msg.delete(3000);
}
} catch(err) {
console.log(err);
}
}
});```
Can’t get guild id in a dm channel
do msg.guild?.id
👆
then it will only try to get the guild id if the message guild is defined
thank you so much 🙂
does anyone know why i'm getting this error:
UnhandledPromiseRejectionWarning: AbortError: The user aborted a request.
never seen it before
no idea what's causing it
No clue I am curious too
how do i get total channel count? dpy? cant find in docs
i don't see why that would happen
i've restarted my bot multiple times and it works for a bit, then errors, stopping it all together, then it stops erring but is very laggy
@blissful coral This is my code now: js channel.overwritePermissions([ { id: message.guild.id, deny: "VIEW_CHANNEL" }, { id: message.author.id, allow: ["VIEW_CHANNEL", "READ_MESSAGE_HISTORY", "SEND_MESSAGES"] } ], `Ticket for ${message.author.tag}`) still doesn't work and not give a err
Is it that the deny: isnt a array?
it isnt
put it in a try catch block
Nothing returned @dense patio
didnt we just say its likely a DM and guild doesnt exist?
how would i like ```html
#middle {
background: #96bceb;
width: 100%;
height: 68%;
margin: 0px;
}
#bottom {
background: black;
height: 38%;
margin: 0px;
}``` fade these into each other

@surreal sage is the bot accepting commands in dms? like @Not Erwin said?
wdym
if you dmd the bot a command, would it respond in that dm
y
because dm messages don't have the "guild" property
ik
you could really just replace message.guild.id with message.guild?.id
or put the whole thing in an if statement that checks if it is a guild
if(message.guild) {
...
}
try removing that last line
what
, `Ticket for ${message.author.tag}`
the string?
yeah
do you have to get an SSL with a .dev domain
im new to this type of thing and have no idea what im doing
yea
it will not allow to show a webpage if you don't have ssl
but if you have a mc server behind a .dev domain, it will allow to connect to that
but that's probably because it directly connects to it's ip and only pings the dns
how do you get one
didnt work @dense patio
google.com is invented
let's encrypt ftw
I use Cloudflare so I get it from there, but when no cloudflare, let's encrypt is my friend
How to delete glitch project
you could really just replace
message.guild.idwithmessage.guild?.id
@dense patio wtf is the ternary operator doing there
How to delete glitch project
@earnest phoenix it’s literally in the project options
thats not a ternary operator, thats the new optional chaining feature
from node 14+
ok so what now
I'm deprecated :(
how to switch ECMAScript versions in node
I need to update my bot to support intents
ES version depends on the underlying V8 engine that powers javascript
node.js updates their built-in V8 every few node versions
@earnest phoenix I seen that
last update was node.js v14.6, which updated V8 to v8.4.371.19
node v15 soon
so if you head over to the V8 website, and see all the features that were added in 8.4.371.19, then node.js 14.6+ has all of those features
node v69 when
Lol
Approximately 2030

node node-more-like-nose.js.js
can you have trailing whitespace in a file name
Skulbite is typing...
always will be
@quartz kindle hey, if i created a class could i modify it's variables, like uhh
class yee {
constructor(two) {
this.haw = two
}
}
const cowboy = new yee("hee")
cowboy.haw = 'haw'
console.log(cowboy.haw) // haw
I need help making a logo for my bot, I made one but i dislike mine-
@trim saddle yup
Well i mean its okay-
hm.
also what do you know about jsdoc tim
very little
i've been trying to document this module i made, but i don't understand index.d.ts
can someone help me make a better one? ^^
also what do you know about jsdoc tim
very little
@quartz kindlejsdoc.very_littleis undefined
Hi. My code is very basic but it is not working. Please DM me if you can help me fix my code.
I can send the repl
Bot Website is down Above ↖️
i mean
Hi. My code is very basic but it is not working. Please DM me if you can help me fix my code.
@earnest phoenix wow man we can perfectly help even if you sent zero information about the code and/or error
index.d.ts is ts not jsdoc
Help
Is it that the deny: isnt a array?
@surreal sage has to be in a array yes
when my bot will be approved ? ??
I just need a free software no downloading to make one-
its just a client=commands.bot(command_prefix=';') and then @ client.event
it says:
thats steam?
Traceback (most recent call last):
File "main.py", line 31, in <module>
@client.event
AttributeError: 'Client' object has no attribute 'event'
when my bot will be approved ? ??
@earnest phoenix READ THE BLASTED RED MESSAGE
please dont ask, read pins
in support
@earnest phoenix copyrighted image btw
@earnest phoenix commands.Bot
yep-
Capitals matter
could you please just send the code in a code block
import discord
from discord.ext import commands
client = commands.Bot(';')
@client.event
async def on_ready():
print('ready')
@client.command()
async def ping(ctx):
await ctx.send('pong')
client.run('token')
@earnest phoenix puttint a hyphen at the end of each message is not good emphasis
Oh
isn't it command_prefix=';'?
oop
^
commands.Bot(command_prefix="prefix")
@earnest phoenix puttint a hyphen at the end of each message is not good
emphasis
@earnest phoenix what do you mean?
still not working
@earnest phoenix READ THE BLASTED RED MESSAGE
@earnest phoenix what is blasted red
no same
event cant be found
Traceback (most recent call last):
File "main.py", line 30, in <module>
@client.event
AttributeError: 'Client' object has no attribute 'event'
Can you send new code?
My glitch hosting so lagging

k
import discord
from discord.ext import commands
client = commands.Bot(command_prefix=';')
@client.event
async def on_ready():
print('ready')
@client.command()
async def ping(ctx):
await ctx.send('pong')
client.run('token')
Py?
yea
What issue
Error*
Are you sure you’re running that code and not the old code?
Traceback (most recent call last):
File "main.py", line 30, in <module>
@client.event
AttributeError: 'Client' object has no attribute 'event'
yea i am
Oh it is working
thanks
how did you fix it?
o
wait
the problem is not that
@earnest phoenix gev me link server add frends
i have some side code
and when i un tag it
it stops working
Sorry
?
Can we see that code too?
k
how do i make a request to a certain url to give me info
one sec
hey
i just ran your code and it worked just fine for me
@earnest phoenix READ THE BLASTED REDESSAGE
@earnest phoenix what is blasted red
@earnest phoenix the big block of text on your bot page which is just top.gg begging you to have patience and not be a dick screaming APROVUM MY BOTUM
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import pprint
import json
import discord
from discord.ext import commands
client = commands.Bot(command_prefix= ';')
@client.event
async def on_ready():
print('ready')
@client.command()
async def ping(ctx):
await ctx.send('pong')
#Authorize the API
scope = [
'https://www.googleapis.com/auth/drive',
'https://www.googleapis.com/auth/drive.file'
]
file_name = 'client_key.json'
creds = ServiceAccountCredentials.from_json_keyfile_name(file_name,scope)
client = gspread.authorize(creds)
#Fetch the sheet
sheet = client.open('POTD Scores').sheet1
python_sheet = sheet.get_all_records()
print(python_sheet)
#Insert Row
row = ['1020','1010','200']
index = 7
sheet.insert_row(row,index)
client.run('i didnt forget token this time :P')
hw can i use vsc without internet?
yeah i do
hw can i use vsc without internet?
@lost stone you just use it normally
it works when i take away the rest of the code
turn off your internet and use it
done
all the code after the API doesnt work
like now the error message is the run

@earnest phoenix please hastebin your code instead of pasting everything in a code block
wdym hastebin
mee6 developer?
not the fucking phone screenshot
Ew
lmao face reveal kind of
@earnest phoenix is that a google sheet database
yeah
@lost stone you can't install packages without internet

it works when i either take out the discord.py completely or the API compltely
uh
@lost stone bruh you're trying to use npm on a computer with no internet that's not VSC's fault
im using repl
Best free hosting websites know anyone
Pay for hosting
maybe buy a host

help
buy me internet
@lost stone how da fuk are you chatting on discord then

does anyone see a fix for my code
@lost stone how da fuk are you chatting on discord then
@earnest phoenix by a code
selfbot
selfbot
@misty sigil no
Nice
Anyone have glitch monitor trick 
omg it works now
@earnest phoenix Congrats, you just advanced to the next stage of life. Welcome to common sense.
Anyone have glitch monitor trick :GWcorbinTopKek:
@earnest phoenix spoonfeeding and also WHY GLITCH
Is my new bot pic better?
@earnest phoenix I like it
i used adobe-
I like it
pretty cool
God stop putting a dash at the end of every message
and good color shceme
Anyone have glitch monitor trick 
lol
discord.ext.commands.errors.MissingRequiredArgument: ctx is a required argument that is missing.
Fucked with this shit
but maybe make the hat dark gray
:((
Anyone have glitch monitor trick :GWcorbinTopKek:
@earnest phoenix
like almost black but not black
I made an avatar command but it ain't working
provide details
Should I send the code?
K
who can forkfeed me
i dont want spoonfeed
Fucked with this shit
@earnest phoenix Or are you just refusing to accept that you're trying to do something single-handedly without learning how to do it first?
wait one sec

Nah @earnest phoenix
Yes
Yes you are
I made one avatar command. I want it to show like when we mention others. It should show that mentioned user avatar
so grey?
-_-
Get the avatarURL of the mentioned user?
Yeah
That's what I mean
so grey?
@earnest phoenix yup
@earnest phoenix see that's why
Wha-
Do you know how discord.ext handles User avatarURL stuff
not experienced with Python but I'm sure you're fetching a GuildMember object instead of a User object
wait that's discord.js
Yeah
discordjs is just...
please send the code
discordjs is just...
@compact oriole not meant for advanced people it's only for beginners
like I use js and I hate it
@compact oriole but you used javascript for the website trivia.wtf?
@earnest phoenix if you send me the code I can help you 🥺👉👈
i just made a halloween one...
Op
@earnest phoenix if you send me the code I can help you 🥺👉👈
@tame kestrel 🥺 👉 👈
@client.command()
async def avatar(self, ctx, member : discord.Member = None):
if member is None:
embed=discord.Embed(title="This command is used like this ,avatar <member mention>")
await ctx.send(embed=embed)
return
else:
embed2 = discord.Embed(title = f"{member}'s Avatar!" , colour = discord.Colour.orange())
embed.set_image(url=member.avatar_url)
await ctx.send(embed=embed2)
Add
Try editing them in code tags around the code so it makes it look better
?
Nope
how do you get a custom discord bot page...
that looks wayyy diffrent from top.gg
Redirect
?
Redirect page
Web
oh so a website.
channel.overwritePermissions([
{
id: message.guild.id,
deny: ["VIEW_CHANNEL"]
},
{
id: message.author.id,
allow: ["VIEW_CHANNEL", "READ_MESSAGE_HISTORY", "SEND_MESSAGES"]
}
])
// Discord.js v12```
I'm trying to overwrite permissions but this doesn't change anything nor error anything.
How can i fix?
Ping me if you can help me.
Try editing them in code tags around the code so it makes it look better
@tame kestrel Will it make it work then?
@earnest phoenix Nope, I meant for discord.
Anyways um I haven't used discord.py like ever. So here are my two cents.
for your avatar props, you may want to change the first property to have the first input as ctx.
Here's a stackoverflow with a similar problem.
Here's some documentation stating that this is the case.
Thankssssss❤️
i want to put my other codes into another file as a second main file i puted
require = ("index.js") is that correct?
no
@lost stone nope,
the require method looks more like this:
var myModule = require("resource://path/to/my/module.js");```
If you want to learn more look up CommonJS modules 🙂
so
var main2 = require("index.js")
o
Other people can steal it and abuse it
It takes two clicks
k i did
@clever thunder are you on windows or
Okay well I think in windows if you want to set an environment variable you can use
SET KEY=VALUE
yesh thank you
SET TOKEN=ANYTHING
you should use the dotenv module, it's much more convenient
put that in a bat file and you can use that, or you can use https://www.npmjs.com/package/dotenv
I didn't know that existed, thank you flaze
should i get a .com or .dev domain
extension
dotenv is better since it doesn't actually modify the system's environment variables
it just adds properties to process.env
Flaze, whyu copy chip's logo?
long story short, i had to
channel.overwritePermissions([
{
id: message.guild.id,
deny: ["VIEW_CHANNEL"]
},
{
id: message.author.id,
allow: ["VIEW_CHANNEL", "READ_MESSAGE_HISTORY", "SEND_MESSAGES"]
}
])
// Discord.js v12```
I'm trying to overwrite permissions but this doesn't change anything nor error anything.
How can i fix?
if i put my bot codes into visual studio code he will be online 24/7?
lmao
i think its DEBUG CONSOLE
@surreal sage try specifying type: { id, deny, type: "member/role" }
@surreal sage the Id for everyone isn't the guild id. You need to add everyone's id
I think the best way to get it would probably be through <guild>.roles['everyone']
@surreal sage try specifying type:
{ id, deny, type: "member/role" }
@pale vessel il try
the id for @everyone is the guild id
y y
???!!
is it?
yes, try<@&264445053596991498>
if i put my bot codes into visual studio code he will be online 24/7?
@lost stone
264445053596991498 is this guild's id
Hi guys,
I need help, I want to make prefix like as a variable for each server.
and the moderators at the same server could use a command to change the prefix.
Any help will be useful thx 😄
@lost stone No. You need a hosting provider.
It will only be online as long as your computer is.
so the first type should be "role" and the second one would be "member"
@balmy anchor Make a database and put for each guild its prefix
yea i saw
Did not work
channel.overwritePermissions([
{
id: message.guild.id,
deny: ["VIEW_CHANNEL"],
type: "role"
},
{
id: message.author.id,
allow: ["VIEW_CHANNEL", "READ_MESSAGE_HISTORY", "SEND_MESSAGES"],
type: "member"
}
])```
no errors?
@earnest phoenix how can i do it?
my debug console says Uncaught Error: Cannot find 'express'
o9
@clever thunder
@balmy anchor Make a database and put for each guild its prefix
@surreal sage You mean like a .json file and I'll put there like:
Guild Settings: {
Blabla Server: {
prefix: '!'
}
}
so nothing changed in the permission overwrites for the channel
nop
@earnest phoenix how can i do it?
@lost stone google "hosting"?
@balmy anchor json = ew
.txt? lol
json is nice but not for dynamic values
oh ok
thx ill try something like this 😄
thx
my full code is: ```js
if (command === "ticket" && botConfigs["Offical Plugins"].ticketsystem.enabled) {
if (message.channel.type === "dm") return;
if (message.guild.channels.cache.find(ch => ch.name === message.author.id)) return message.channel.send(new Discord.MessageEmbed().setTitle("You already have a ticket!").setColor("RED").setTimestamp())
const Category = message.guild.channels.cache.find(ch => ch.name === botConfigs["Offical Plugins"].ticketsystem.categoryName); if (!Category) { console.log(${chalk.red('✘')} + 'No Category Channel Set!'); process.exit(0) }
message.guild.channels.create(message.author.id).then(channel => {
channel.overwritePermissions([
{
id: message.guild.id,
deny: ["VIEW_CHANNEL"],
type: "role"
},
{
id: message.author.id,
allow: ["VIEW_CHANNEL", "READ_MESSAGE_HISTORY", "SEND_MESSAGES"],
type: "member"
}
])
channel.setParent(Category).then(() => {
channel.send("<@!" + message.author.id + ">").then(() => {
channel.send(new Discord.MessageEmbed().setTitle("Ticket").setColor("GREEN").setDescription(`Inquiry: \`${a = message.content.split(" ").splice(1), delete a[0], a = a.join(" "), a.slice(1) || "None"}\``).setTimestamp())
})
})
})
}```
nop
did it at least create the channel?
Yea
with the author id as name
${a = message.content.split(" ").splice(1), delete a[0], a = a.join(" "), a.slice(1) || "None"}``` excuse me what
then ur code is wrong @clever thunder
@tight plinth it removes the first 2 arguments then there will be random spaces left the .join.split fixes that
replace , by ; plz
replace , by ; plz
@tight plinth no
You want to use set token when you're running it from your console. If you're using dotenv package, you want to use whatever you had before
@clever thunder
o ok
i had the mikestead
ok so i did discord.js, express, and dotenv
and theres still errors :/
(node:5268) UnhandledPromiseRejectionWarning: Error [TOKEN_INVALID]: An invalid token was provided
uhh
uh hello?
is this sql?
skullbite, wheres your cute furry pfp
waiting for my comissions to be done
what library are you using?

that's not a library...
.js
thats a language
i suggest using a json instead of .env
oki\
{
"token": "botumtoken"
}
then require the token in your main file
k thx
so?
so?
Guys I just started working with discord youtube api does anyone knows what's the prob here?
- you dont log with console.log("element","element2")
- idk whats wrong with ytapi
you can log doing [video1,video2,video3,videoArray1,videoArray2].forEach(console.log). which is probably the shortest way to do it in this scenario
I saw it on this page lul
selfbot?
console.log(1, 2) is fine.
is it?
yes
oh, learned something new today
console.log can take Infinite amount of parameters i think
probs ...args
also forEach()

@earnest phoenix
i should make a tag for how poor forEach() is as a loop
...args
Performance testing framework is coming along. Got it scaffolded and working with GET requests. Async Tasks hit it for a specified duration.
Next up is metrics, then reports, then implement the rest of REST 😛
Can't share it since it's proprietary IP though 😉 (for my company)
i just need to fix some small issues with my sharding(which isnt even my fault, its the lib swallowing errors)
const Discord = require('discord.js');
const client = new Discord.Client();
client.once('ready', () => {
console.log('Ready!');
});
client.login('your-token-goes-here');
this work
looks like a stripped down example of the one of d.js lmao
idk lol
const Discord = require('discord.js');
const client = new Discord.Client();
client.once('ready', () => {
console.log('Ready!');
});
client.login('your-token-goes-here');
@clever thunder make sure client is always after commands
Wot
will this work guyz
@clever thunder make sure client is always after commands
@umbral zephyr wrong
javascript (with exception of hoisting) is always run in sequence
will this work guyz
@faint prism yes
bot.on("ready", () => {
console.log(Bot is online as ${bot.user.tag});
});
@opal plank ngl, i can't stand the eris/d.js command handler
Look, I know it'll work. It was a joke... lmao
Imagine opening useless braces on that event
the d.js handler is way too easy for users
im good with code
which is good, its dynamic and it works fine
and the eris one is kinda under developed
im good with code
@umbral zephyr Oh yeah?
i dont have too many complaints tbh
<client>.on("ready", () => console.log(`Bot is online as ${<client>.user.tag}`));```
for a starter as i started a weekago
Easy as that, no {} needed for that
though i did modify mine quite a bit
but my bot is good
for a starter as i started a weekago
@umbral zephyr Oh, so you can't help me do a bitwise XOR? 😦
thats what everyone thinks, then they learn more and see how abd the bot is @umbral zephyr
i use discord.js
you dont purposefuly make bad code, you simply learn as you go and improve on it
unless you already know what you doing
i mean
true
there's purposely bad code
@earnest phoenix <client>.user.tag :p
Yes
Is that a no, Dogo?
check out my nifty command handler @ everyone
<Bruh>
@faint prism wdym
@umbral zephyr https://discordapp.com/channels/264445053596991498/272764566411149314/764174815950798919
i cant help with that
gates are a bit annoying ngl, minecraft has taugh me a lot
check out my nifty command handler @ everyone
@opal plank Anger

check out my nifty command handler @ everyone
@opal plank my eyes 😦
its so easy to trigger people here lmao
i'll fix it later, still busy sharding the fuck out of this
telegram is ass
i cant help with that
You mean you can't help me XOR00000101and00001111?
i want to do this but put everything in one string
no
Guys does anyone knows why its doesnt works?
i use discord.js
Imagine saying "HTML is a programming language" here, you'll regret it for your life lmao
look at
message.channel.send(`${food}: ${result[0][food]}`);
(im pretty new to youtube api)
It's still possible in Javascript
did you actually run the function
i want to put this in one string
HTML is a programming language, no?
No

Yes
It's markup you memelord
lmao
i want to put this in one string
@gentle lynx it's already one string
i use css as backend
My command handler best handler
ok api abuse
i tried defining a string and doing += 'sentence here';
optimize your sql statement
@gentle lynx no shit it sends each, you doing a for loop with message.send in each
but it wont work
Push them into an array and join them
use foodItems.map()
why it sends each?
console.log can take Infinite amount of parameters i think
@earnest phoenix fun fact, the maximum number of arguments you can pass is actually 65536
and then out side the loop, message,send
ima stop scripting for now
The XOR joke was just a^b
** 😎
or that
Guys there's anyone who knows how to use discord youtube api that can help me?
discord youtube api
idk

im new to all of this
I only know how to use wikigoognetflitwitter's api
thx
ew ytdl
ew music bots
ew money
ew general-purpose bots
good luck buying ipv6's blocks
good luck buying ipv6's blocks
@opal plank i mean if you can balance everything
its not bad
see ya in 5 days once you realise music is a bad idea if you dont want to put in money for music bots @balmy anchor
funnily enough i havent cycled a single ip
its all about usage, that shit will get your quota done in 3 seconds
but with ytdl will get you banned after 2 songs
@gentle lynx All that was possible with this
let items = message.client.items.filter(i => i.category === "Food");
let foods = await Promise.all(items.map(it => message.client.con.query(<sql query with 'it'>)));
message.channel.send(Object.entries(foods).map(f => `${f[0]}: ${f[1]}`).join("\n"));```
I think


imagine not using a single .txt file as your database, scrubs
0:

i need


i will kink shame you if you dont use postgres or cassandra, end of story
cassandra do be hot
i used to use json
@gentle lynx 0.0, happy u don't use it anymore lool
yes
I am doing an on message event that only works when the message is in the DMs. That works perfectly. ALl my other commands are not working now. How do I fix this?
There is no error message or anything
this is when i try install quick.db
iirc, quickdb has a troubleshooting page on their page
also, i think its a pretty descriptive error.
"not working" does not help
obviously there's a reason why it didn't work; you need to tell us that
were there any errors?
don't just say "it no work!!1"
no
just didnt work
i stated stuff here:
I am doing an on message event that only works when the message is in the DMs. That works perfectly. ALl my other commands are not working now. How do I fix this?
Do they work inside the dmsm
no
only the part in the on_message event works
nothing else
let me skim over the docs
oh i see the problem in FAQ
I didnt put this line
await bot.process_commands(message)
it works now
function SetRedditPost(table){
try{
const subreddit = table[Math.floor(Math.random() * table.lenght)];
const { body } = request
.get(`https://www.reddit.com/r/${subreddit}/hot.json`)
.query({ limit: 100 });
const posts = body.data.children.filter(post => {
if (!post.data)
return false;
return types.includes(post.data.post_hint) && post.data.url && post.data.title && !post.data.over_18;
});
if (!posts.lenght)
return;
const post = posts[Math.floor(Math.random() * posts.lenght)].data;
request
.post(`https://disocrdapp.com/api/webhooks/${POSTER_ID}/${POSTER_TOKEN}`)
.send({ content: `${post.title}(<https://www.reddit.com${post.permalink}>)\n${post.url}` });
logger.info(`Posted "${post.title}" from r/${subreddit}.`);
} catch(err){
logger.error(err);
}
} ``` Cannot read property "data" of null.
Huh
Maybe I need to implement a delay function?
why are you using a deprecated lib
Explain?
Maybe I need to implement a delay function?
@livid lichen if you mean adding a hard-coded sleep, don't do that outside of debugging.
@livid lichen if you mean adding a hard-coded sleep, don't do that outside of debugging.
@faint prism Alright.
Thanks for the help.
Explain?
https://www.npmjs.com/package/request read the red box
libraries are maintained by their creators. once they are no longer maintained they become "deprecated"
generally you should stop using deprecated libaries
they will stop working, or even worse become a security risk.
node-fetch
you're using request
I changed request to node-fetch.
change your request structure too
I Made A Discord Music Bot. It's Working 24/7. I Made A .bat File In The Code Folder To Start The Program. When I Close The .bat File The Bot Stays 24/7 Online But It's Not Replying To My Commands. When I Start The .bat File It Start To Reply To Commands. I Want Some Help For This. Because When I Release My Bot To The Discord Page It's Gonna Be A Problem, Cause I Can't Keep My Local Machine Powerup For Forever.
well... yeah
You need to run the bot constantly
why do you think it would magically stay on if you close it
No, Cause I 'm New To This.
it’s kinda easy to assume
doesn't matter if you're new to programming or not, it's common sense lol
can your pc be on if it has no power?
no
When I Close The .bat File The Bot Stays 24/7 Online
Sounds like a token leak
that's the same case here
turns off PC -> "Why PC no work?"
yeah but how i'll get the power for my bot
that was just terminology
if you close the thing that's running the bot, it obviously won't stay on
yes
or an android phone 
With the batch file
i have an computer which is not use to me
its the users pfp
i will use that, thank you for the advice
how did you create op1? what does op1.save do?
fp = io.BytesIO(raw_image_data)
im = Image.open(fp)
im = im.resize((150, 150));
bigsize = (im.size[0] * 3, im.size[1] * 3)
mask = Image.new('L', bigsize, 0)
draw = ImageDraw.Draw(mask)
draw.ellipse((0, 0) + bigsize, fill=255)
mask = mask.resize(im.size, Image.ANTIALIAS)
im.putalpha(mask)
op1 = ImageOps.fit(im, mask.size, centering=(0.5, 0.5))
op1.putalpha(mask)
op1.save('op1.png')```
what version
newest?
im checking the docs for 7.2.0 idk if thats the right now
do im = Image.open(fp).convert("RGB")
you're adding alpha later
I need help on how to do something. Every day at 12:00 AM PST, i want to do a command. My bot runs all the time so it will be able to do it. I know how to do it once, but i want it to do it every day.
then run a command at 12:000 PM PST
how
Be on your computer, type the command, click enter.
not helpful










