#development
1 messages · Page 1297 of 1
good job
yea i know that and ive heard most people say 2k is where they started ish
i know?
i didnt ask if i could i asked if it was a good idea
When your company has infosec trying to phish you
confuzzled
@stuck scaffold the key point may be libtool is required, but wasn't found on this system
ty ❤️
Hey does anyone have any tips on how to get started with developing a music bot that won't get blocked from usage, via proxies? And any tips on which provider to use for this purpose?
What do they offer
lavalink just offers the capability to shuffle through proxies you provide
Ok, where is the best place to get proxies
For a reasonable price, and the kind you need for YouTube
i've seen people use rsocks
Probably need to use IPv6 due to the price being lower and Google supporting them right?
you might have more luck browsing some reddit threads
attack?
What is steamurl
but the image is appearing out of embed
steamurl is the name of image
its mainly the 64id of a stam user
steam*
How can I require a javascript file into visual studio code?
you open the file
no, require into the main file other javascript files
into the same folder
into visual studio code
require into the main file? what does that even mean?
to make something like ./require... I don't remember exackly
You want to require/import some local file.
no another javascript file
Which would be a local file.
I declared the const "ping" at the beginning of the code, but in the switch when I use it it says: "Cannot access 'ping' before initialization" what can i do? (the code: https://hasteb.in/likahari.php)
@grave smelt functions get hoisted, that ping function is declared first iirc
what exactly is that minecraft-server-util?
a module
Im trying to check if my bot can send a message in the channel where the command was said
bot.on("message", async message => {
if (!message.guild.me.hasPermission('SEND_MESSAGES')) {
return;
}
})
This didn't work
whats exported in it?
whats exported in it?
@opal plank
I don't understand what you mean, inside that module the const "ping" is created
@grave smelt is the module REQUIRED before you use the module
@solemn leaf use .permissionsFor: https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=permissionsFor
Well, someone who know python, whats the best way to make GUI in Python?
There's tkinter
@grave smelt is the module REQUIRED before you use the module
@earnest phoenix in fact the module there is
Though I didn't like it myself.
It's definitely usable though.
There are probably dozens of other GUI frameworks available for Python.
Well so tkinter?
I already used tkinter, is good but im looking for something more.
how do you "uninitialise" a firebase project in the current directory
do i just delete the files generated by firebase?
@grave smelt
what exactly you trying to do?
cuz the module exports lots of things
its not a function
what exactly you trying to do?
@opal plank show information about the typed server
then you are doing it wrong
look at the example
util.status()
not util()
also port is an object
not a number
also it doesnt look like it takes a callback from what im seeing
so you need to either await its response or chain it with a then
like i said, functions get hoisted
its trying to access ping even though function() gets declared before everything else
trying with the example it says "'response' is declared but its value is never read."
In browser based javascript we can do importScripts("url") to import scripts from other URLs but in node.js we only have require which only accepts file paths and the file protocol (which is pointless). Can we import scripts from other URLs in node.js?
@grave smelt show code
@earnest phoenix can you not ```js
fetch(url).then(r => {
const a = JSON.parse(r);
})```
you now have a as the whole script
lol forgot
I wonder why you'd need that however. whats the point 🤔
I wonder why you'd need that however. whats the point 🤔
@solemn latch how the fuck can you use D3.js without it
🤔
though very rarely
@opal plank why am i always in the 1% zone
@grave smelt show code
@opal plank
I changed the code to the one in the example and it always says "Cannot access 'ping' before initialization."
is ping being initialized after you use it
is ping being initialized after you use it
@solemn latch if by initialized you mean: "const ping = require ('minecraft-server-util')" yes
Hey, how are some of you guys and gals currently abstracting components of your bots such as commands and events to be able to effectively test them/make them easier to test?
then dont do that @grave smelt
initialize then use not use then initialize
Hey, how are some of you guys and gals currently abstracting components of your bots such as commands and events to be able to effectively test them/make them easier to test?
I just use another bot to test my commands. But that's becaude most of it interact with discord
What do you wanna test exactly?
Yeah, my buddy actually mentioned that once. For me to look into having another bot test various aspects of my bots
I just use another bot to test my commands. But that's because most of it interact with discord
most of it interact with discord
@opaque seal wutdafuk
Various command, configuration, stuff like that
Overall ability to mimic users and events
wutdafuk
?
Overall ability to mimic users and events
Oh ok, I don't know about that
Seems just too complicated compared to testing with an alt
bots can get pretty large for manual testing every time you modify something important
When I was reworking my bot it takes around 20 minutes to test main commands. in-depth testing can take another 30 minutes
hi
anyone know how to make my bot react to a message like without it being an operating system default?
like with regional indicators
🇱
use the unicode equivalent in your code: \🇱
Lmao wtf is this, my ram spiked to ten whole gigs temporarily
Then dropped back down to 830mb
Gonna edit that spike outta my graph, it makes it unreadable
that's a lotta data
Yeah
Scary thing is I dunno what caused it
Perhaps it joined a particularly large guild?
but 10 gb for such a large guild?
Yeah it's gotta be a bug
But the interesting thing is the bot freed the ram after
And didn't crash
Normally such huge ram use results in a crash and a restart
brain isnt stupid
it’s in the name
with?
oh
margin -?
I am having the classic problem for the positioning of a Footer on the bottom of the browser. I've tried methods including http://ryanfait.com/resources/footer-stick-to-bottom-of-page/ but to no good
read the stackoverflow link
css is fun
maybe uh you shouldn't use a template
just a suggestion
makes your site look generic as fuck
use flexbox
lol i just realised that the template has a vine button
Do I work for 1 month and make a site? lol

a what @earnest phoenix
a what indeed
We work 3 people and we have a lot of workload
Registration and login system, api service, database setting, advertising,
you don't have to build elements from scratch, there are css frameworks and if you're using something like react there are complete UI frameworks fledged out with js functionality
cough material-ui
I have a university exam, it seems ridiculous that I have to work for this site for 1 month.
as if we don't have exams either
you're not the only one who has a crammed timetable lol
and a month is an overestimation
you need a week with something like material-ui alone
I have a tight schedule so I use templates? If there is no other problem, thank you, have a nice day.
An inevitable cry for u.
🤔 developer wars
how so
i use bulma
i like the MD2 design
lmao i made https://musicboat.misly.dev in a couple min
but not md1
even if you don't want the MD2 design every component in material-ui is customizable with theme overrides and css-in-js
I use a template because I don't have time. I paid for it, I had a problem, I wrote to solve it.
"I would never have written if I knew it would open such an empty thread." @earnest phoenix
@toxic jolt botumu nasıl ekleyebilirim
@toxic jolt How can I add my bot
kanka
türk varmış ya
what
i paid for it
that template is from themeland LMFAO
@toxic jolt kanka botumu buraya nasıl eklete bilirim
like we all have time
that template is from themeland LMFAO
@earnest phoenix stupid this template is 17 dolar
i buyed.
okay?
any question?
hah. look your life :3
@toxic jolt kankam lütfen biri cevap verin botumu nasıl eklete bilirim
ps
you can't roast someone if you can't speak proper english lOL
@dapper kiln https://top.gg/bot/new
Tfw ask Lead App Dev what his preference on Performance Testing Tools is, and he replies: "Don't have one. Well actually, C#"
the sky
@faint prism LMFAO
i love it when new devs are more qualified than the lead devs
i love it when new devs are more qualified than the lead devs
@earnest phoenix No no, he is really really good.
He has a point though
oh
@earnest phoenix Writing your own Perf Tests would allow you to run them with the Unit Tests in a pipeline
That and complete control
i've seen people do something close to that with benchmark.net
i never bothered though
@slender thistle ^^
uhhh
is this a broken userbot
selbot
yes
borked
def selfbot
i've seen people do something close to that with benchmark.net
@earnest phoenix I'll have to look into that
https://github.com/dotnet/BenchmarkDotNet it's an amazing tool
does the amount of listeners a bot has increase ram usage
yes
Alright
pycharm + js?
It's a new python extention
I mean, JetBrains IDEs do have interchangeable plugins
I sometimes edit .js files in PyCharm when I cba to wait a whole year for WebStorm to load 😂
how do you code a discord bot?'
Shiv I don't even bother with WS
I used it for a while but it just feels lame
Probably because of JS' largely dynamic nature
I say WebStorm but I actually use PhpStorm for web dev rofl
at least the logo looks cool
God forbid if you get good intellisense with dynamic typing lol
PyCharm with Python was the only IDE where I got that but I still had to give explicit types for stuff like function parameters as expected
Meanwhile WS wasn't very helpful a lot
@slender thistle umm sorry again the thing u gave me dont work and i tried figuring out how to fix it all day
client.antispam = {}
@client.event
async def on_message(message):
member = message.author
data = client.antispam.get(message.author.id)
if data:
if (datetime.datetime.utcnow() - data["last_sent"]).seconds <= 5 and data["message"] == message.content:
if data["count"] < 5:
data["count"] += 1
else:
role = discord.utils.get(member.server.roles, name='Muted')
await client.add_roles(member, role)
await mmessage.send(f"{message.author} was muted for sending to much of the same message")
Aw
eh slap a print on each line and see where it stops working expectedly
oh
yee
well
add an else for the if data: and add data to bot.antispam for the message author's ID
okie
umm i dont wanna annoy u by being stoopid, how?
and save us time
@slender thistle
3 AM helping is painful
lol
🇸 🇱 🇪 📧 🇵
@slender thistle save us time and brain cells just please (by us i mean u)
(i cant lose brain cells if i dont have them)
bot.antispam[message.author.id] = your_data_stuff_here
not specifically empty value
you have to fill the crap in like the message, count, last_sent
github student plan op
ok
@slender thistle sorry for the brain cells
"message": "messages"
"count": 1
"last_sent": "time"
```this is what i put in the key?
and the count changed depends on amount of messages?
hello
how can i get spo presence
I listening spotify right now
but its look like custom status
?
I was looking for a z lmao
oh
i get it
there we go thx
still stuck in the same place
nvm
ill try fix rest my self to save u brain cells
and then i have - of mine
-1 rn
never mind i just relized im too stoopid
client.antispam = {}
@client.event
async def on_message(message):
print("start")
member = message.author
print("member set")
data = client.antispam.get(message.author.id)
print("data Set")
if data:
print("if data")
if (datetime.datetime.utcnow() - data["last_sent"]).seconds <= 5 and data["message"] == message.content:
print("if datetime")
if data["count"] < 5:
print("if data count more")
data["count"] += 1
print("data++")
else:
print("else")
role = discord.utils.get(member.server.roles, name='Muted')
print("role set")
await client.add_roles(member, role)
print("role adding")
await message.send(f"{message.author} was muted for sending to much of the same message")
print("message send")
else:
client.antispam[message.author.id] = {
"message": message.content
,"count": 1
,"last_sent": datetime.datetime.utcnow()
}
```it doesnt do the 2nd if
(it doesnt go to other line discord does that)
if (datetime.datetime.utcnow() - data["last_sent"]).seconds <= 5 and data["message"] == message.content:
client.add_roles isn't a thing
everything server must be guild
it's member.add_roles without providing the member in function params
okie thx
okie
if (datetime.datetime.utcnow() - data["last_sent"]).seconds <= 5 and data["message"] == message.content:
this line doesnt work
btw
i would apreatiate help
are you sending the same message within 5 seconds
are you sending the same message within 5 seconds
@slender thistle nerd
Shiv don't even try
being a nerd is a good thing
change my mind
Nerd
how i did my anti-spam
https://img.rovi.me/H6ZbvoEhMh.png dont even ask what but it works
does this mean i need to use the id of the role
@placid iron flex
@slender thistle
do i need to use id?
of the muted role
damn i wish we had error messages like that in js
lol
oh are you making it add muted, you need to get the role object from the role id then what shiv says
member.add_roles(role)
k
sorry for realy dumb question how do i send a message in an on_message function?
@slender thistle
no mad pls
has anyone here worked with child processes IPC and clustering before?
Thx
need some help figuring out how i can add event types to the processes
again, docs docs docs
isnt it just
message.channel.send 🤔
yes
it sends all the print but doesnt do message.channel.send(f"{message.author} was muted for sending to much of the same message") or member.add_roles("Muted")
f
How can I check if my bot can send messages in a channel
depends on the lib
js
javascript?
bruh
is a language
wdym
bot.on("message", async message => {
if (message.author.bot) return;
if (message.channel.type === "dm") return;
if (!message.guild.me.hasPermission('SEND_MESSAGES')) {
return;
}
let prefix = await db.get(`prefix_${message.guild.id}`)
if (!prefix) prefix = config.prefix
if (!message.content.toLowerCase().startsWith(prefix.toLowerCase())) return;
let messageArray = message.content.split(" ")
let cmd = messageArray[0]
let args = messageArray.slice(1);
let commandfile = bot.commands.get(cmd.slice(prefix.length));
if (commandfile) commandfile.run(bot, message, args);
})
you can just check member.permissionsIn() of the bot
I dont know how to use that
use the docs :p
it sends all the print but doesnt do
message.channel.send(f"{message.author} was muted for sending to much of the same message")ormember.add_roles("Muted")
@slender thistle pls
how do u find this stuff in the docs so fast
member.add_roles(role)
@slender thistle
do u change the link
oh are you making it add muted, you need to get the role object from the role id then what shiv says
member.add_roles(role)
no, i go to the docs and use them
just follow the chain of things you have
thats what i did
you have to add the muted role not a string called muted
okay, legit, this is bullshit
ohhhhh
you use it on member not channel @solemn leaf
docs
hopefully i tagged the right aki, theres like 40 of you
no it doesnt?
Cannot invoke object that is possibly undefined
its process
HOW THE FUCK DOES PROCESS CAN COME UNDEFINED?
oh
how can node return process as undefined?

Rovi, can you take over?
didnt see u were typing sorry for ping
I'm about to die with my calculus fuckfest and it's 4 AM
yeah you better do that
sleep
I've yet to shower also
lol
stinky mods
read what i am about to say carefully
message.guild.me.permissionsIn(message.channel)
didnt start their node
legit losing 40% of my hair rn doing clustering
@solemn latch what does this return message.guild.me.permissionsIn(message.channel)
@violet mesa so you want to mute someone. to do that you have to add a muted role to the member. So you have to get the role called "muted" first. This can be by an ID or you can use discord.py to search for it. role = discord.utils.get(ctx.guild.roles, name="Muted") this will get a role called "Muted" and return its object. Then you have to add that to the member with member.add_roles(role) memeber.add_roles is async so you have to await it
all the perms including overwrites the bot has in the channel @solemn leaf iirc
of course if that is in a on_message then you cant use ctx.guild but rather you have to use message.guild
I just wanna check sendmessages
role = discord.utils.get(ctx.guild.roles, name="Muted")
await member.add_roles(role)
```if i understood correctly this should work @placid iron ?
of course if that is in a
on_messagethen you cant use ctx.guild but rather you have to use message.guild
has just gives the bool, so you can directly if it
yes
message.guild
if (datetime.datetime.utcnow() - data["last_sent"]).seconds <= 5 and data["message"] == message.content: now it stops there again ;-;
@placid iron u know how fix?
whats the error
no error
so its false?
i put a print on everyline and it stops right before it
message.guild.me.permissionsIn(message.channel).has(["SEND_MESSAGES"])
no i was spamming and had the coldown message
ill do an else
1 sec
cannot access "variablename" before initialization
it works!!!!!!!!!!!!
tysm for smart human @placid iron and spicialy @slender thistle
which is prob asleep
and i cant spell
im gonna "re"learn python now
ok np 👌
now
No
i have a general question here, what is more viable performance wise, scaling on the same machine via docker-compose or scaling out somehow over more than just 2-3 vpses
what i have right now is 3 instances of the bot running on 3 different servers but i've been looking into k8s which supposedly could fit what im trying to do, do i learn this or is it overkill
this is more of a devops question not for a specific programming language
I would just use the same machine till it can't handle anymore and then get another machine and so on
Unless performance is paramount then you need extra overhead just in case
however i also notice that the majority of guilds that my bot is in have their location set to either korea or australia so it's across the planet
I mean, what does your bot do
connects with the api on quavergame.com
but most of the players come from asia
it's more of a concern of latency on discord's end
So maybe have a compromise where you have a US East and a SEA server?
I mean that is more a question of how much money you want to pay for the response time of the bot to the most people
all right so currently
it's $10 a month as of right now for 2 $5 vpses from digitalocean
formerly had 3 but discarded the one in europe
i am willing to pay up to $20 a month for it out of pocket but beyond that a patreon wouldnt be a bad idea
logically though the majority of the playerbase is either in sea or us so i dont need to spend any more
Tbh, it's up to you because if your bot isn't using much resources that it needs to be on more than 2 servers or something it's just finding where the best locations for them are for the end user experience and if you feel like spending more for lower ping else where then you can but if most people are SEA and US then it does make sense to have the 1 in each
yeah you are right
and to be fair it's definitely an eye opening experience when running on a budget since i suppose it sort of forces you to optimize code in a way
very f u n
why cant databases just be like 1 line of code, and REALLY simple to integrate into a command, my small brain can't handle it😭
they are 1 line mostly 🤔
which language are you using?
python
pickledb
is a great one
if you don't need large scale
not as fast as sql but super easy to integrate
i honestly can't even wrap my head around it, purely because idk where to start with it 😂 i have to break my whole Blacklist command down and put it back together differently
it was in a Json, but now i have to move it to a db
ahh I see
yh
I've never really done anything of decent scale in python that needed anything more than json
I've been looking at tinydb for whenever I need to; haven't used it yet though
looks simple enough
i'm trying to use sqlite, it's Simple ish, but my brain just cant make sense of it,
I have a book on databases
They are indeed complex topics
However, small projects can simply them down to the complexity of what is essentially is an Excel file
Error: (XID wumfys) Could not determine the nameserver IP addresses for “archbot.tech”. Please make sure that the domain is registered with a valid domain registrar.
i get this error when adding a domain in cpanel
like i pointed it to the name servers from get.tech
SELECT *
FROM balance_table
WHERE Balance = 10000;
@earnest phoenix
This will select all collumns(* means any matching, or all)
from the table named balance_table
where the users balance is 10,000.
if theres 5 users with 10,000, it gets all 5.
if its none, it gets none.
INSERT INTO balance_table (ID,NAME,AVATAR,Balance,IsCute)
VALUES (136583532972605440, 'Woo', 'AvatarURL', '10000', false );
Would insert me into balance table
i did it
Is this right then
message.guild.me.permissionsIn(message.channel).has(["SEND_MESSAGES"])

should be
So
Is it like a if
Or
message.guild.me.permissionsIn(message.channel).has(["SEND_MESSAGES"]) { return };
it gives a bool
if it has send messages it gives true
Ah
Ok
If!message.guild.me.permissionsIn(message.channel).has(["SEND_MESSAGES"]) {
Return }
That should work then
if (!message.guild.me.permissionsIn(message.channel).has(["SEND_MESSAGES"])) { return }
missing the () for the if
I never do that lol
I have the lock and unlock command for dbd.
@unique patio
K thanks I'll have to try it layer
spawning them as needed
if (!db.has(`${user.id}.modlog.totalInfracCount`)) {
db.set(`${user.id}.modlog.totalInfracCount`, 0)
console.log(db.get(`${user.id}.modlog.totalInfracCount`));
}
``` tihs is logging undefined
Hmm
@solemn latch how would one put someones ID into it?
like searching someones id?
SELECT *
FROM balance_table
WHERE ID = 136583532972605440;
^ would get my id from the collumn ID in the balance table
@solemn latch no, so the blacklist command Puts their ID into the DB so they can't use the bot,
yeah, i am just using example values.
adding new users to the db is called inserting
https://www.sqlitetutorial.net/sqlite-insert/
so if you wanted to add me to the db(again example of a balance bot)
INSERT INTO balance_table (ID,NAME,AVATAR,Balance,IsCute)
VALUES (136583532972605440, 'Woo', 'AvatarURL', '10000', false );
getting those values would be the one above.
***JAVASCRIPT ***
question, is there a way to check when a variable change? Without something like setInterval checking it every so often or something of the likes, kind of a listener. variable.on('update', () => {}) ?
i feel like making an event for something like that would be easy.
howcome?
so..... it'd be sql INSERT INTO Blacklisted_IDs( user_id ) ?
@opal plank https://stackoverflow.com/a/37403125 like this?
let counter = 0;
let interval;
message.channel.send(text[counter]).then(sent => interval = setInterval(() => {
if (!text[counter + 1]) return clearInterval(interval);
counter += 1;
sent.edit(sent.content + text[counter]);
}, (speed * 1000)));
``` wgere do i put async?
The question is, can I ask for help with html/ejs here?
If it is for my bot
@earnest phoenix that wouldnt actually insert anything
INSERT INTO Blacklisted_IDs( user_id )
VALUES( 136583532972605440 )
So moving a old taskbar over, filled in some blank data (gonna be a dashboard)
What it looks like^
Supposed to look like^
just the first () is the order of the variables your setting
<head>
<meta charset="UTF-8">
<title>Dashboard</title>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.1/css/bootstrap.css'>
<link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.0.13/css/all.css'><link rel="stylesheet" href="./style.css">
</head>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/esm/popper.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.1/js/bootstrap.js'></script><script src="./script.js"></script>
All files are required already
@solemn latch what would the Values be for trying to implement someone into it? I.E the bot getting someones ID and then putting it into the data base, ?
VALUES ( THEUSERSID )
UserToBlacklist = 136583532972605440
sqlQuery = f"INSERT INTO Blacklisted_IDs( user_id )
VALUES( {UserToBlacklist} )"
^^ the getting the query
import sqlite3
conn = sqlite3.connect('test.db')
conn.execute(sqlQuery)
conn.close()
Something like that?
im not a py user, doing my best :p
all good, i appreciate it😂 it's pissing me off not understanding it, but i'm trying to, So with this going into a command, would it be something like py "INSERT INTO Blacklisted_IDs( user_id ) VALUES( {member.id} )" because i'd be @'ing the person to blacklist them
yep, that would add that user to the list of ID's
or list is a bad word to use here because python calls arrays lists
but to the db
and then if you wanted to just check if a user is in that db youd use select
and if i wanted to remove them i'd just change insert into?
well... this has been Simpler than everyone else has made it out to be...
hello 😛
hi hi hi hi :D
@earnest phoenix can you cut it out
yeah, no one makes it easy
ok hi hi hi hi hi
wrong channel as well
many tutorials expect you to want complex queries
i knpw
hi hi hi hi
o bye bye bye bye
everyone who i've spoken too says its so easy and todo it myself, and every video i've tried watching take me through a Rollercoaster of random things,
hi again
this site is amazing for learning all the queries. https://www.sqlitetutorial.net/
your big ones are select insert update delete
then all the filters
Do I create an application, this is my first time
Yes
yeah
I came to ask
-id @whole magnet
@whole magnet
An ID is a unique number which is used to identify a user, bot, channel, or message. To obtain an ID, right click on it and click "Copy ID"; this can be done from mobile by holding down.
Should you not see the option to acquire an ID, you need to enable "Developer Mode" which can be done from your user settings, under "appearance".
so I use my id?
-bots
+help
This user has no bots
please dont do commands here
the dev portal will tell you your bots id after you make it
When I do an eval command (evaluates a JavaScript expression/code), how do I make the bot send an embed? Because When I do r!eval const embed = new MessageEmbed()
// Embed code here
It doesnt work, returning that MessageEmbed is not defined. How would I define MessageEmbed without doing const MessageEmbed = require('discord.js')
oh oke
I'm asking because I coded my bot in typescript
pong
ponged
wot?
typescript question 
typescript isnt related to that error
ah
its just not defining it
i only read typescript ;p
Eval evaluates it in JavaScript
@opaque hawk why you defining it that way?
yeah, eval is js
always
so writing eval in typscript is a waste of time
I don't know how to make an embed in JavaScript, only TypeScript with my tsconfig
you'd need to recompile it
but like i said, its the same in both ways
theres no difference whatsoever
const { MessageEmbed } = require('discord-js');
new MessageEmbed().set().title()... blah blah blah
also
stop using embed builder
TypeScript embed:
require { Message, MessageEmbed } from "discord.js";
const embed = new MessageEmbed()
.setColor("#000000")
// ...```
That looks ugly
import { Message, MessageEmbed } from "discord.js";
const embed = new MessageEmbed()
.setColor("#000000")
// ...```
There
I forgot, I actually haven
havent coded in a week
Ok thanks
lol
good

productivity stonks
doing the work for us both ;p
bruh this shit harder than i thought it would
did the thingy i link to work?
yeah, though i havent used it
i was going to use it to dynamically spawn more node processes
but i can do it another way which will probably work even better
ay
legit, the bot cannot handle that many streams
so im clustering it into different connections
scale that bitch up
might wanna look into something like kubernetes
creating slaves to connect and re-emit all events to the main
i have, but i decided to made my own
sounds good
im glad my bot never got any attention, dont have to bother with any of this
just for learning
this branch test wont go live for general use i dont think
also theres nothing to gain from it rather than just pure experience
that main bot IS already stable and good
added my own cache and a ton more of other fancy shit
Very nice
though the library clearly doesnt handle that big of a influx of messages
those gaps is the process itself(not even the lib) dying
did you make your own lib or are you using something else?
and becoming unresponsibe
both
using Twitch-js, but they only offer the connection to twitch's IRC
everything else is done on my side
so that handles the webscokets and connections for me
though ive already reported to them some quite bit flaws in their ratelimiting internally
which they havent even replied to yet

10 days ago, and neither of them joined the repo i invited them to test

gotta love when that happens
10 days ago and no response
Erwin got nitro back
yup, thanks to @drowsy sentinel 
but yeah, if they wont fix their library, i'll just fix it myself

by clustering
Haha mine should be ending any time soon
Discord should make an option where you can hide bots in audit log
ay @earnest phoenix
i think i have it atleast,
😂 i hope so,
now i need to redo this check and hope it works,
Discord should make an option where you can hide bots in audit log
@carmine summit they should also make an option where you won't emit typing events when you start typing anything
if ctx.author.id not in BlacklistedUser_IDs:
NameError: name 'BlacklistedUser_IDs' is not defined```
how tf can i define something in a database....
like creating a db?
no, thats the check function, i'm trying to run a command, and it says that isn't defined that, is the Table of the database.
so the column doesn't exist?
BlacklistedUser_IDs is the Table, and User_IDs is the PK
is this it?
https://stackoverflow.com/a/62098754
few answers around on stackoverflow
Ignoring exception in on_message
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 930, in on_message
await self.process_commands(message)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 927, in process_commands
await self.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 892, in invoke
await ctx.command.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 790, in invoke
await self.prepare(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 743, in prepare
if not await self.can_run(ctx):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 1011, in can_run
return await discord.utils.async_all(predicate(ctx) for predicate in predicates)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/utils.py", line 324, in async_all
for elem in gen:
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 1011, in <genexpr>
return await discord.utils.async_all(predicate(ctx) for predicate in predicates)
File "OwO.py", line 185, in not_allowed
if ctx.author.id not in BlacklistedUser_IDs:
NameError: name 'BlacklistedUser_IDs' is not defined```
@solemn latch i'm trying to get the bot to check the db for the User's ID but idk how i'd do it because it's bringing that up
nice file name ;p
yes
thank you lol
ok.... i've fixed that error by doing ```py
BlacklistedUser_IDs = ["blacklisted.sqlite"]
def not_allowed(ctx):
if ctx.author.id not in BlacklistedUser_IDs:
return True
else:
return False```
but now, it wont work 😂
i hate this soo much
did the two links i posted help at all?
no 😦
not sure, seems to be the way python handles it rather than SQLite itself.
someone who knows python better would know.
i think its something in my blacklist code - because all my other commands are working apart from them 2
I think you need to import the table.
hmm
@solemn latch You still on?
bot.on("message", async message => {
console.log("ne")
if (message.author.bot) return;
if (message.channel.type === "dm") return;
if (!message.guild.me.permissionsIn(message.channel).has(["SEND_MESSAGES"])) {
return;
}
let prefix = await db.get(`prefix_${message.guild.id}`)
if (!prefix) prefix = config.prefix
if (!message.content.toLowerCase().startsWith(prefix.toLowerCase())) return;
let messageArray = message.content.split(" ")
let cmd = messageArray[0]
let args = messageArray.slice(1);
let commandfile = bot.commands.get(cmd.slice(prefix.length));
if (commandfile) commandfile.run(bot, message, args);
})
This returns 'DiscordAPIError: Missing Permissions' And the ne logs twice
Does it happen when trying to run a command?
yes
Which command
its probably the command
Im testing if I can just check the bots permissions in the index not the command
Im trying it with the ping and eval
how do i make it so when someone pings someone it deletes the message
Im evalling hi
But some commands require other permissions than just send messages
how do i make it so when someone pings someone it deletes the message
what are the commands
It might be because the bot doesn't have permission to view the channel
It does
your not giving enough info @pseudo cobalt
how would it be able to see that I sent the message @earnest phoenix
Also include the VIEW_CHANNEL permission check
That makes no sense
is it trying to use images or reactions?
Ir shouldnt get the message event from that channel on the first place
It does if you didn't know
or is it &&
you can put them all in the []
Bots dont recieve events from channels they dont have access to
wait
Lemme test
Do it on a channel ir ACTUALLY isnt on
that sends a mesage to testing 1
Erwin
Sup
Are you talking about private channels?
I did this
if (!message.guild.me.permissionsIn(message.channel).has([["SEND_MESSAGES", "VIEW_CHANNEL"]])) {
return;
}
Any channel the bot cant access
So, his bot surely wouldn't give an error if it didn't have access to the channel
x!backup create
Something is off here
no don't run commands here
it can see the channel
wot
DiscordAPIError: Missing Permissions
-botcommands @earnest phoenix
@earnest phoenix
Hey! Bots aren't given permissions to send responses in this channel. Please use #commands or #265156322012561408 to run commands. In addition, bots with commonly used prefixes cannot read or send messages in any channel. This is done to prevent spam and bot abuse.
view_channel does not mean you can send
Otherwise bots would be able to access all channels here too
you just need to check for send
Indeed, 2 different things
If its RECIEVING a message, it can SEE the channel and message it belongs too, but that doesnt mean SEND_MESSAGES
view_channel does not mean you can send
@fluid basin If it can't view the channel it still would throw an error
Or other perms
yeah it isnt workin
yes you're trying to create a message voltrex
Unless you specifically targeting a channel id you dont have
its a post request
can you do the command in a channel with every perm
yes you're trying to create a message voltrex
@fluid basinThat's what this guy is also trying to do
wtf
@earnest phoenix
Im fairly certain you can request EVERY channel on the guild, regardless of permissions. However if you are getting channel id from MESSAGE, its not possible, because a message event wouldnt be fired from a channel you dont have acess to begin with
this is the terminal
ne
(node:4968) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
at RequestHandler.execute (C:\Users\Owner\Desktop\discordjs2\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:4968) 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:4968) [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.
ne
ne is what Im logging at the top of the message event
your bot is trying to send a response to the message
You either got a static id(not coming from message) or the error is from somewhere else
He says it's from the ping command that this error happens
Whats rhe actual command?
const Discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
let color = '#' + ("000000" + Math.random().toString(16).slice(2, 8).toUpperCase()).slice(-6)
const Embed1 = new Discord.MessageEmbed()
.setColor(color)
.setTitle('Ping?')
.setAuthor('Help Command')
.setDescription('Pinging...')
.setImage('')
message.channel.send(Embed1).then(m => {
var ping = m.createdTimestamp - message.createdTimestamp;
const Embed = new Discord.MessageEmbed()
.setColor(color)
.setTitle('Ping?')
.setAuthor('Help Command')
.setDescription('Pong!')
.setImage('')
.setFooter("Ping " + `${ping}` + " ms");
m.edit(Embed)
});
}
module.exports.help = {
name: "ping"
}
Seems correct to me
does the bot have perm to use images?
setImage('')
you can't send the first embed
ah yes
you need attach images too for that too correct?
SEND_EMBEDS is not a valid permission flag
SEND_MESSAGES, EMBED_LINKS
presuming there are images linked there
lol
U got the point
dont make me look
There's attachments and embeds perms too
EMBED_LINKS
Im on mobile and in the middle of a party, i can only five directions
Opening docs oj mobile not happening
my bot didnt message me the error
the other thing, you can figure out what perms each command needs and check that in your command handler dynamically
bruh
why
its better that way
why
No reason tbh
especially if you're not the only one working on the bot
^^
Unless you wanna give someone access
What if Im the only one working on the bot
Then it shouldnt matter
idk
I'd recommend proper logging, but its not necessary
If it logs ne twice then it means you're running 2 instances of the bot?
its not gonna send my token
I dont think I am
hold up
bot.on("ready", async () => {
});
bot.on("message", async message => {
})
bot.login(config.token)
No reason tbh
legit reason: no reason
but it seems more practical and organised that way
this is the only stuff involving the bot
@fluid basin agreed
do you have 2 message listeners
no
Again, check if you're running 2 instances of the bot
voltrex, even if aki has 2 instances it won't print in the same terminal bruh
want my whole index
Hastebin
idk how hastebin work
Try to regenerate your token and use the new one
next time upload to a code sharing service (except pastebin)
its hard to see on mobile
You must have been running the bot 2 times but we don't know how
Actually, when does the bot disconnect on token refresh? On next ACK?
Wot
BRO NO ONE DID A COMMAND AND IT RAN WHAT
Did u put the new token!
yes
is your bot public? 🤔
its in server Im in only
is it public tho
then someone coulda added it?
lol
or ran the command
ch-servers
lol erwin this is getting dumb
did you see the code yet
the logging is placed before any conditionals
so yeah ofc it will run
like duh
unless d.js or node is broken
Bad
also be careful when using process onunhandled/onexception
ne
ne
ne
ne
ne
ne
ne
ne
ne
ne
Thats against tos
self bot, reported 
Still

||







