#development
1 messages · Page 1231 of 1
So do you know what the wrong are?
Send your code in hastebin
remove the ;
Plus that will cause some salt
l2c
bot.on('ready', () =>{
console.log('This bot is online!');
})
bot.login(token)
No.
put your token there and run it
oK
@clear arrow Yes I have that badge.
How to save changes?
Control S?
Unless using vim or nano
chill mate
Or directly coding from terminal through node editor 
Vim: ESC + :wq
Nano: (control + x) + (control + s)
@quartz jewel we are all frustrated but; https://discordapp.com/channels/264445053596991498/272764566411149314/670727029540519937
Visual Studio code
Port 443 only accepts HTTPS requests right?
is there a way to see if a user is banned from a guild without the Ban Members permission?
You don't need ban members to check if someone is banned
Just fetch the bans and read the users banned
Since when?
audit logs? maybe
this is the first time i checked
@proven lantern why are you reading discord api docs read docs of your library
that is the audit logs, so no, ben
because he needed to find out the permissions? and library wack
try catch works?
@earnest phoenix the docs dont tell me the required permission
he's trying to find out if someone is banned w/o needing the ban members perm
@earnest phoenix the docs dont tell me the required permission
@proven lantern BAN_MEMBERS
in MICRO_CASE
that's the discord api docs. that's why i was reading those instead of the library @earnest phoenix
just ignore him ig
also starman showed me it
you can't ben, you probably can with oauth2 but thats overcomplicating it. and the bot will have to be in the server
what i mean with oauth2, u have their guilds- wait no, it still wont work
i dont think u cant without the permission then, unless someone else knows
i do have the guild. i want the bot to check if the user is banned before sending them an invite and marking them as invited from my bot
then theres no way without the required permissions
https://developer.mozilla.org/en-US/docs/Web/javascript @proven lantern
?
maybe i can try to do guild.addMember() and an error will be thrown that i can catch
only requires CREATE_INSTANT_INVITE permission and i already have that
probably then, idk what that method does so cant rly help with that, sorry
How do I set up a server webhook with the python library? Like how do I get a token and things
i.e. what do i put here https://files.solithcy.xyz/HgOAQV9sGC.png
dbl_token is at https://top.gg/api/docs#mybots
how does it work with server voting though
h u h
The client is just for DBL. DSL is unsupported as of currently
fair enough, thx shiv
There will probably be a "small" rework with the module overall and a possible rename/implementation of DSLClient
kk
if i want to call addMember do i need to go through the oauth flow and get the user to send in their accessToken or can i get the accessToken programmatically?
https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=addMember
how i can use is-inside.me ?
help meh
@earnest phoenix go to https://is-inside.me/
yes
but there are no docs
"how to post images"
what's a good place to store an array that has to be modified frequently without having to restart the bot
it says how to use sharex with it in the faq
what's a good place to store an array that has to be modified frequently without having to restart the bot
@opaque seal mysql table?
I wanted to be able to modify it myself tho
mysql table is good then
It's actually an object with a list of server IDs and expiration dates
im linux
wait
imma google
nah
then use kshare lmao
or magiccap
magiccap is better
you could write the array to file and parse the json..if you dont wanna db
Yeah that's what I was thinking because it would be easy to modify it
I think I'm just gonna use mongoDB tho
It's actually an object with a list of server IDs and expiration dates
@opaque seal legit sql is perfect for that
Because JSON files can get fucked up easely
yeah
I think I'm just gonna have a cache for the array of objects and some commands to modify it at this point
youll be happier setting up mongo...only takes a min
I already use mongo for eveything else
wjats special about the array you dont throw it in db then
I wanted it to be easily readable and modifiable but it's fine
is it possible to get ratelimited without receiving a DiscordAPIError?
how i can send image
is it possible to get ratelimited without receiving a
DiscordAPIError?
yeah
I think so
embed.setImage("local image")
You need embed.attachFiles
(node:13218) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
embed.image.url: Not a well formed URL.
wut
oh
and then embed.setImage('attachments:...');
Check the discord.js guide
it's explained well there
hey guys
how do i fix this undefined error i embeds
cities/countries ranked by: RAIN
California, Colombia 7.347, -72.946
undefined
California, El Salvador 13.441, -88.463
undefined
Liberty Park, IL 42.265, -89.117
undefined
National Mall, DC 38.89, -77.023
undefined
San Diego, Costa Rica 9.901, -84.001
undefined
Hiroshima, Japan 34.39, 132.441
undefined
Hiroshima 34.547, 132.792
undefined
Phoenix, MD 39.516, -76.617
undefined
Ho Chi Minh City 10.745, 106.695
undefined
i know that the embeds have a value and name
uhh
is there an event that is triggered when a user that is banned gets an invite to the guild and tries to join? maybe in the warn event?
console.log(`warn: ${info}`);
});```
nothing else looks right
https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584
i know that the embeds have a value and name
@eternal osprey the value is undefined
thats it
your code is putting an undefined variable
There's no such event, Ben
That's handled by the client internally
i knoq
@slender thistle thanks
const title = "**Cities/countries ranked by: ** " +`**${skytext}**`;
let embed = new Discord.MessageEmbed()
.setTitle(title);
locations_found.slice(0, 10).forEach(location =>
{
embed.addField(
`${location.current.observationpoint} ${location.location.lat}, ${location.location.long}`,
);
```
behid the ,
there was annother variable
but i removed it as it was not necessary

.addField(`${location.current.observationpoint} ${location.location.lat}`, `${location.location.long}`)
@eternal osprey ??
hey
huh ?
Yes
Can I get the ranking of someone’s level with mongo!
?
It could just be who has the most Xp
@quartz kindle is there any image cdn
you fucked my bot
without is-inside.me
The correct way is "name","value" but you did "name,value"
and i have made no backup
yes
you can use zrtl+z right?
@eternal osprey i told you how
.addField("title", "value")
that maybe from ur API
one is white and big
other is normal
so there is not any way to fix that.
`${location.current.observationpoint} ${location.location.lat}, ${location.location.long}`, true,```
so this
`${location.current.observationpoint} ${location.location.lat}`, `${location.location.long}`, true)
wait
no
California, Colombia 7.347, -72.946
true
California, El Salvador 13.441, -88.463
true
Liberty Park, IL 42.265, -89.117
true
Long Beach Island, NJ 39.774, -74.123
true
Minneapolis, NC 36.1, -81.987
true
San Diego, Costa Rica 9.901, -84.001
true
Hiroshima, Japan 34.39, 132.441
true
Hiroshima 34.547, 132.792
true
Alexandria, AL 33.771, -85.883
true
Warsaw, MO 38.245, -93.386
true```
embed.addField(
`${location.current.observationpoint} ${location.location.lat}, ${location.location.long}`, true
);
```
BRUH
`${location.current.observationpoint} ${location.location.lat}`, `${location.location.long}`, true
How many times
._.
Why dont you put the name in the title and both coordinates in the value?
also possible
._.
does anyone know of a way i could code with a friend
yes
github
or
i mean like
Cities/countries ranked by: RAIN
California, Colombia 7.347
-72.946
California, El Salvador 13.441
-88.463
Liberty Park, IL 42.265
-89.117
Long Beach Island, NJ 39.774
-74.123
Minneapolis, NC 36.1
-81.987
San Diego, Costa Rica 9.901
-84.001
Hiroshima, Japan 34.39
132.441
Hiroshima 34.547
132.792
Alexandria, AL 33.771
-85.883
Warsaw, MO 38.245
-93.386
Command hosted for Pokehub`s community!
live code
Yes
what text editor do you use?
but use , true
vsc
vsc\
use the liveshare ext
but i dont like the liveshare
sudo apt-get install git
bro
b r u h
he means live
sudo apt-get install git
windows machines dont have apt
and sudo
epic
what is c9?
cloud 9 realtime multi user ide
Cool
i made a version...but mine sucks
could never get editing at same time working right...had to lock other users out until other guy was done typing
who want help in discord.py?
mongo database?
Well it calls itself mongodb
i don't know in mongo database if you ask me in mysql i answer
can anyone suggest me a database without a daily access limit online for free?
thats not possible 🤔
yes i want ask why this server not make arabic room?
cuz firebase went down for me in like 6h because my bot got in 40 servers all of a sudden
Javascript object notation library, duh
indeed
@outer perch firebase should not go down with only 40 servers lol
You get 50k reads and 20k writes per day
@quartz kindle i require your services
Thats a lot, you can easily make a bot in tens of thousands of servers with those limits
can i set attributes of an already thrown error
I believe you can
The youre using it wrong
For example, make sure youre not making a query on every single message
i'm trying but i keep getting
TypeError: Cannot set property name of [nothings here i think the error is anonymous] which has only a getter
For example, make sure youre not making a query on every single message
@quartz kindle I got into that, fixed the code at those problems
but now I gotta wait til 12am
why do you need a new prop on already thrown error?
changing the error name
@trim saddle it should work, can you show your code?
you could make your own object with neq name and error as value?
try {
// ...
await cmd.exec.bind(this)(ctx).then(() => {
this.cmdsUsed++
this.emit("commandExecute", ctx, timer)
})
}
catch (e) {
e.name = "EXECUTIONERROR"
this.emit("commandError", ctx, e)
}
there's a try up there
I need help real fast now
I noticed my bot gets the server prefix everytime a message is sent
if the msg doesn't have the prefix, it returns
any idea how can i get mongoDB ping?
how do I do a custom prefix so?
set a string somewhere
I know people get DBs in a json file and run it there
any idea how can i get mongoDB ping?
@fluid orbit Get a Date object before and after a database call, and return the ms of the difference
but that means the file can get heavy
or just use a db
I am using the DB
json isn't a good way to store things
the problem is the number of accesses
hellp gays , any one know to let bot stable in room 24h !
@fluid orbit Get a Date object before and after a database call, and return the ms of the difference
@faint prism i was doing that but i though there's a better way, thank you :D
uh
imagine a request per msg
what is your DBMS?
pay for a service then
Mine does that
what's dbms
A database management system?
a droplet is $5 a month...you can use mongo as much as you want
I use mongodb Atlas
I can't afford anything
And I upsert db records on every new msg basically
It's free
Also, sqlite is free too
@trim saddle do something like this then ```js
} catch (err) {
if (err instanceof ValidationError) {
alert("Invalid data: " + err.message); // Invalid data: No field: name
} else if (err instanceof SyntaxError) {
// (*) alert("JSON Syntax Error: " + err.message);
} else {
throw err; // unknown error, rethrow it (**)
}
}
how do u shard in discord.py
but what about the request limit?
@outer perch you shouldnt be fetching the prefix on every message
Thats not only bad for rate limits but also extremely inneficient
You should always cache your prefixes
just define the prefix in a json file
how can i get an arg and put it in mongo?
like when the bot joins a server
I had that
but fr tho
how can i run a command when the bot joins the server?
how do u shard in discord.py 👀
"images": [
{
"height": null,
"url": "https://i.scdn.co/image/ab6775700000ee85a5c332287a6524252b50188c",
"width": null
}
],
"images": [], then fail. how can I do it
@outer perch create a variable for prefixes, or even use the guilds themselves
so if it is empty
wha-
For example, lets say you store your prefixes in guild.prefix
When you receive a message, check if message.guild.prefix exists
juat grab all guilds and there prefix on bot start...then use those values and update in memory and db when that command is run
If it does use it, if not, fetch it from the database and attach it to the guild, so it gets reused the next time
but don't the variables reset at the app update?
Yes, if it doesnt exist, you fetch it from the database
if bot restarts it fetches from db
I understood
I just need to get aquainted with caching
I didn't learn it at school
Once you get the hang of it its very easy
ikr
json libraries
I understood the theory
now it'll come to my mind everytime i think about something similar
Every time you get data from the db, ask yourself: do i need this data to be fresh every time? Or can i have a copy of it in a variable for fast access?
true
can anyone pleeeeeeeeease tell me how tf u shard in discord.py 1/2 my bot doesnt work now
never thought of having a copy to use later
how can i make like if prefix not found from mongo db, use this prefix
make a constant that has a default prefix
can anyone pleeeeeeeeease tell me how tf u shard in discord.py 1/2 my bot doesnt work now
@sudden tulip https://discordpy.readthedocs.io/en/latest/migrating.html#sharding
if the database returns nothing use the default prefix
@sudden tulip https://discordpy.readthedocs.io/en/latest/migrating.html#sharding
@faint prism 💀 r u fr
thats it
bruh
im actually stupid
l0l
"images": [{
"height": null,
"url": "https://i.scdn.co/image/ab6775700000ee85a5c332287a6524252b50188c",
"width": null
}],
with
"images": [],
how do i distinguish the two
"images": [], will give an error message.
yeah i said earlier that first you should check if your database has an entry for the guild's custom prefix, it it doesnt, use your default prefix instead
images.length > 0
let prefix = "!"
let query = database.find({ idk })
if query != null { prefix = query.guild_custom_prefix }
this is one approach
let prefix = "!" let query = database.find({ idk }) if query != null { prefix = query.guild_custom_prefix }
@valid frigate im using python
🥄

its the same concept
have a variable then replace that variable if there is an entry in the table/collection
also that isnt valid syntax in any language 
so is mine
😦
is it hard to shard a bot?
what kind of frankenbot you writing
welp
the js part i had forever
then i did a bunch of stuff in c# and was just lazy to rewrite the js
to shard a bot is simple because most libraries provide an easy interface for it
and the python bit is part of my school project
iirc djs has shardingmanager, eris has sharding options in the client config
were i learn a lang from scratch
so you run 3 seperate instances with same bot token?
i have a question tho
when i find motivation ill rewrite everthing in c#
forget it
you have been presented with an opportunity little have a chance to have
university?
my uncle runs a coperate data center
👍
and they were tossing them out

oh yeah i pay $7.50 a month for vpses in sf, france and australia 
not cost effective
thats a little better than my $5 droplet
yeah
well to be fair ive had some weird behavior on the vpses
but i dont store anything sensitive on them so if they yoink it im fine
i had the js and c# sharded
@sudden tulip wtf/ what kind of bot are you making
3 language ? ? ??
i already explaned
yea
they cant all be on the same sharded connections can they
that would be impossible unless
@quartz kindle I know I have to cache and all, but could you give me a js syntax example?
sometimes it gets hard to think
my mind got stuck 😂
anybody discord.py here?
this is the basics of caching
tru
one is sending data that one is going the right way but the other one ? ? ? ?
just think of the cache as the returned object from db
like how do i write stuff to mongo
you have it in memory use it instead of making calls everytime
how do I make a caching object
if the command is run to set prefix awt in db and refresh object with new values
just a random object?
forget about the word cache
damn
yea just store in memory
the object...if set prefix is used ...make db call and refresh your in mem object
that way youre only making requests when needed
I understood the theory
so on bot start grab the data and use it.....if set prefix is used update db and fetch new values
like how do i write stuff to mongo
@drifting wedge
I need the practice
or dont fetch new and keep object in mem up to date
I've never created an object
WARNING THERE IS A QT UP THERE^
ty, I guess
@outer perch what lang/lib?
js
yep
caching prefixes to stop fetching the DB so much
oh
But also you'd need an empty object
right
Or a map
I just don't know how to start
Basically
using a map, when the prefix is called for the first time then get it from the db and write it to the map under a guild ID
Then use an if statement or a ternary operator
right
and when the prefix is updated just update the map
I use objs
let prefix;
prefix ? map.get('guild ID') : //db query here
It's really useful
what does map do there, @pure lion?
ill fix it for $5 venmo
have fun
Okay $5
let prefix;
const ref = db.collection('servidores').doc(message.guild.id),
map = new Map();
prefix ? map.get(message.guild.id) : ref.get('prefix');
map.set(message.guild.id, prefix);```
Will this work? @earnest phoenix @pure lion
yo i need help
when i do print("No") it says no
ok i quit
im not stupid
no
maybe the last line is wrong
but prefix will be undefined
Prefix is undefined
it will flag on your ternary wrong
ah
check the code so
Try a small demo on that code example alone elsewhere
like jsfiddle
make sure you're using it right. 🙂
time to eat gl
I used that once
I'd also wouldn't, map; arrays are just as easy/efficient for this purpose.
with loops
I still think about the objects
JS is cool with arrays handling like "objects"
You can var Person = ["name":"jake", "age": 36];
console.log(Person.name);
Do lots and in regards to sorting/etc; slum through it with the tried and trued for/while loops.
For su pport EC6 is where I like to keep it.
Are you mistaking [] for {}
At first it looked like Swift but objects in JS are like dictionaries/keys & values
Nope
You can use arrays like that still
Otherwise {} to define objects but not necessary here
I got a syntax error when I tried it.
let prefix, custom = '+';
const map = new Map();
map.set('1234', custom);
prefix = map.get('1234');
console.log(prefix);
I tried this
it works fine
I just need to set at the right moment
Let me correct myself with a better example, yikes... lol
var CTS = {
Project: {
Name: "CTS",
Storage: "CTS_",
isTouchScreen: false
}
};
You can go deep with the objects... was tongue tied for a moment there
You just want to store guilds registered too?
does this seem fine?
prefix ? map.get(message.guild.id) : ref.get('prefix').then(() => { map.set(message.guild.id, prefix); });
You just want to store guilds registered too?
@unique patio I only want a prefix per guild
when changed
if it's the default, do nothing, if custom prefix, check for it
So each guild has their own prefix, and you want to manage accordingly?
same commands, just diff prefixes
yeah
but checks if guild
ohhh lmfao
You'd obtain the values they've set however you do that. Raw-file, DB
however you do that, so assuming you got the retrieval down-pat;
Initiating a check would be a matter of pulling all the guild settings to JSON format.
and setting the guild ID as your identifier in an object; you could have this essentially written like
Guilds.Settings[guildid].prefix
Then what you could do, is when you get message!!!!
Check the guild fast with a quick guild.id call and if it's a registered value !== undefined you see if the prefix values match.
Here's how I sort my code in a nut-shell fast.
//Server.js (main js)
client.on('message', (receivedMessage) => {
if (receivedMessage.author == client.user || receivedMessage.author.bot || !receivedMessage.content.startsWith(Config.COMMAND_PREFIX)) return;
Command.Check(receivedMessage);
});
//Command.js (confirm command and send them off)
function Check(receivedMessage) {
var splitCommand = receivedMessage.content.substr(1).split(/\s+/);
// Command Check
if (typeof PublicCommands[splitCommand[0]] == "function") {
PublicCommands[splitCommand[0]](splitCommand.slice(1), receivedMessage);
} else if (typeof Aliases[splitCommand[0]] == "function") {
Aliases[splitCommand[0]](splitCommand.slice(1), receivedMessage);
}
}
@client.command()
async def role(ctx):
for user in list(ctx.guild.members):
try:
for role in guild.roles:
if role.name == "everybody":
await ctx.guild.add_roles(role)
print (f"{user.name} roled in {ctx.guild.name}")
except:
print (f"{user.name} has failed to be riled in {ctx.guild.name}")
print ("Action Completed: mass role")```
Im trying to make a bot to mass role my server. It's not working. No errors, just fails.
hmm
Is that python?
Ye
Oh boy, too rusty
Lol
are you forgetting to log bot in ?
with token
looks like it
As im a bit rusty with the API .-.
Yeah NodeJS is a solid platform for web-developments/CLIs
all sorts, very powerful module
Im trying to learn it for web stuff
It'd be do-able if you comfy with the python
100%; Javascript is very nice to look at in comparison
lol
if you know c# use discord.ts its much nicer than js
and ts is similar to c#
why is it that when i do console.log(serverdefault[key]) it returns the correct value but when i do return or await it returns a object promise
async?
tried this and still returned object promis
async def role(ctx):
for user in list(ctx.guild.members):
try:
for role in guild.roles:
if role.name == "everybody":
await ctx.guild.add_roles(role)
print (f"{user.name} roled in {ctx.guild.name}")
except:
print (f"{user.name} has failed to be riled in {ctx.guild.name}")
print ("Action Completed: mass role")```
Im trying to make a bot to mass role my server. It's not working. No errors, just fails.
no newline at end of file?
import javax.swing.JOptionPane;
public class GUIStick {
public static void main(String[] args) {
int x = 0;
int y = 4;
while (x < y) {
JOptionPane.showConfirmDialog(null, "Do you want to close this box?","You can't close me",JOptionPane.YES_NO_OPTION);
}
}
}
Basically, what this program does is every time the integer "x" is of less value than "y", the script inside the unit of code will continue to run. It basically creates an un-closable text box that wont go away from your screen until you forcefully kill it in task manager. Right now, it only opens one box. I would like it to open around 5 of them at once. Do you know how to make it open 5 of these boxes?
this isn't mine
this is for a friend
sounds like a virus
It is, and I won't help; lmfao
const ref = db.collection('servidores').doc(message.guild.id);
let prefixes = new Object();
prefixes = { 'guildID': '+' };
if (!prefixes[message.guild.id]) prefixes[message.guild.id] = await ref.get('prefix');
const prefix = prefixes[message.guild.id];
I did this
now I gotta wait til 12am to check if this will work
exceeded quota
For what?
that wont work anyway
requesting the database too much
that wont work anyway
@earnest phoenix why?
I can't test it 😦
Do what I do, don't request it.
See it as it comes in
and filter from there, it's the only way on high scale
sounds like a virus
@earnest phoenix i mean i didnt read it lmaoo
yea 16252674884 will not == guildId
It could
ive got a ping.js which is a command and how to i link it to app.js? im a noob
import it
how do i do that
exports.StringDistance = StringDistance;
in this case stringdistance being your function and you'd in the file you'd wanna call it
say, main.js
mhm
const array = message.content.split(' '),
commandName = array[0].slice(prefix.length).toLowerCase(),
args = array.slice(1);
const command = bot.commands.get(commandName) || bot.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));
try {
command.execute(bot, message, command, args, db, prefix, prefixes);
}
catch (err) {
console.error(err);
}
const { GetPatternNumber, IDSearch, NameSearch, GetItemCustomizations, pad, GetDescription, isInt } = require("../Utilities/Search");
some like that you know?
The items inside the curly's are references to the objects imported in the "sidefile.js"
thanks
np
For dynamic commands I gave you it and it's low low complexity when put into full scale.
check this last one first
I'm talking thousands of commands in a blaring second
This is how commands look.
PublicCommands = {
help: function (args, receivedMessage) {
// Initiate Command
}
math: function (args, receivedMessage) {
// Initiate Command
}
kick: function (args, receivedMessage) {
// Initiate Command
}
};
This is what initialy input looks like, on message received!
client.on('message', (receivedMessage) => {
if (receivedMessage.author == client.user || receivedMessage.author.bot || !receivedMessage.content.startsWith(Config.COMMAND_PREFIX)) return;
Command.Check(receivedMessage);
});
This is how you sort if it's a command or not, and other parameters; depending on your use of the bot and pseudo classes.
function Check(receivedMessage) {
var splitCommand = receivedMessage.content.substr(1).split(/\s+/);
// Command Check
if (typeof PublicCommands[splitCommand[0]] == "function") {
PublicCommands[splitCommand[0]](splitCommand.slice(1), receivedMessage);
}
}
That's all you need, and don't split that way, it really don't help with new-lines/etc; when people make mistakes.
Think less; do more is what this should tell you and all.
Yo, I have a question about verifying as dev. Do they only want your ID document or also a selfie or something else?
Anybody use MySQL and could help me debug something?
😐 maybe
Well I'm not sure what went wrong but it is no longer reading results[0].<column_name>
let trackIMG = `https://i.scdn.co/image/${activity.assets.largeImage.slice(8)}`;
var colorThief = new ColorThief();
colorThief.getColor(trackIMG)
.then(color => { console.log(color) })
.catch(err => { console.log(err) })
internal/fs/utils.js:269
throw err;
^
Error: ENOENT: no such file or directory, open 'https://cdn.discordapp.com/avatars/257062280779268097/a_10d8776f2f0893cebe8f4c3995077824.gif?size=1024'
at Object.openSync (fs.js:462:3)
at Object.readFileSync (fs.js:364:35)
at new CanvasImage (C:\Users\axe12\Desktop\autimatic bot\node_modules\color-thief\js\color-thief.js:49:22)
at ColorThief.getPalette (C:\Users\axe12\Desktop\autimatic bot\node_modules\color-thief\js\color-thief.js:144:22)
at ColorThief.getColor (C:\Users\axe12\Desktop\autimatic bot\node_modules\color-thief\js\color-thief.js:111:30)
at Request._callback (C:\Users\axe12\Desktop\autimatic bot\commands\bilgi\spotify_bilgi.js:122:24)
at Request.self.callback (C:\Users\axe12\Desktop\autimatic bot\node_modules\request\request.js:185:22)
at Request.emit (events.js:315:20)
at Request.<anonymous> (C:\Users\axe12\Desktop\autimatic bot\node_modules\request\request.js:1154:10)
at Request.emit (events.js:315:20) {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: 'https://cdn.discordapp.com/avatars/257062280779268097/a_10d8776f2f0893cebe8f4c3995077824.gif?size=1024'
}
color-thief module
Hmmmm did you accidentally break your table?
If I do recall it's sensitive like that, might have a red-field somewhere making the search defective.
Been many years though can't say how it is now.
I didn't.
Are you making a proper selection for your results?
@earnest phoenix yeah your link is broken
I do
if (!results[0].userid) as my bot is meant for roleplay, I need it to search that coloumn where the userid is equal to a mentioned user.
I may not be defining it correctly in the selection.
in file fs.js (openSync) failed with that URL listed there.
"no such file means you tried to open a bad/faulty URL
A bit beyond me but can't you work with unions and do a cleaner-pull
but still not the answer you want; not entirely sure why the search isn't work assuming you got it all setup right and are making connection or doing the expressions right from program.
Not sure either. I might just rewrite the whole command.
Which never hurts as it might just fix it.
Which is weird.
it looks like youre trying to open a url and not a local file...does fs support that
why switch
i switched from js to ts...but if your bot works i cant see why switch python to js
that always works
can anyone see an obvious reason to why this command is not running
@bot.command(pass_context=True)
async def level(context):
print("leveling")
author1 = context.message.author.id
author = (author1,)
print(author)
sql = "SELECT xp FROM leveling WHERE userid=?"
cur.execute(sql,author)
result = cur.fetchall()
# Math sorta stuff
current_level = int(result/1350)
embeded_message = discord.Embed(name="Your Level", description="Leveling System Version 0.1", color=0xffffff)
embeded_message.add_field(name=f"Level for:", value=f"<@{author}>", inline=True)
embeded_message.add_field(name=f"Current XP:", value=f"{result}", inline=True)
embeded_message.add_field(name=f"Current Level:", value=f"{current_level}", inline=True)
await context.channel.send(embed=embeded_message)```
sorry not familiar enough with python to see offhand
does the comma after author need to be there
author1
Hi
@mental willow does your code print leveling as you did at the top.
no it does not @sudden geyser
Then the issue is the command is probably not being recognized.
Can you share more of your code (such as the cog if your command is part of one). Preferably on a site like https://hastebin.com in case it's long.
Any sites that I can host my bot for free?
heroku
Confused. Could you explain what you mean.
The bot will delete when users type a message on a channel whose id is entered.
will only allow pictures
What library are you using
discord.js
What you could do is listen to the message event and see if the message instance contains at least 1 attachment (<Message>.attachments). I don't know how to check if the message contains an image in particular, as it's just an attachment (image, file, video, etc.) You could check the size or the extension to combat it.
Mrb
oh no
It's ez to make a ML model in .NET fr
The only time I worked with ML was in Swift
let newEmbed = new Discord.MessageEmbed()
.setColor('#f4e542')
.setTitle("Current Prefix set to:")
.setDescription(args[1])
.addField("Forgot the prefix?", "Mention the bot `@Electric prefix`")
.setFooter(`Server: ${message.guild.name}`);
message.channel.send(newEmbed);
``` my embed isnt working
Love all the different algos it uses
@silver lintel how is it “not working”
its not sending
and it like stops the program
because stuff after it doesnt happen
Could you show more of the surrounding code? Any errors logged in the console?
Yes, logs are a valuable resource 
can anyone help with pillow and pasting in a users avatar?
profile_bytes = Image.open(profile_bytes)
profile_bytes = profile_bytes.resize((150, 150));
bigsize = (profile_bytes.size[0] * 3, profile_bytes.size[1] * 3)
mask = Image.new('L', bigsize, 0)
draw = ImageDraw.Draw(mask)
draw.ellipse((0, 0) + bigsize, fill=255)
mask = mask.resize(profile_bytes.size, Image.ANTIALIAS)
profile_bytes.putalpha(mask)
output = ImageOps.fit(profile_bytes, mask.size, centering=(0.5, 0.5))
output.putalpha(mask)
output.save('output.png')```
fundo.paste(output,(86, 66),output)```
ive imported bytesio from io
and giving me error:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: UnboundLocalError: local variable 'profile_bytes' referenced before assignment
in line profile_bytes = Image.open(profile_bytes)
by killed you mean reconnected?
How do u check if the bot has a permission?
hi so i use repl and im trying to download my project and it just says this any help?
by killed you mean reconnected?
@modest crane yep
@zenith knoll
if(!message.guild.me.hasPermission(["PERMISSION_HERE"])) return message.channel.send("❌ | I dont have permission to do this!")
please help
@modest crane yep
oh
it says Discord ASKED us to reconnect
that's normal
@zenith knoll
if(!message.guild.me.hasPermission(["PERMISSION_HERE"])) return message.channel.send("❌ | I dont have permission to do this!")
@restive shell k
ok
why does it say
(node:4720) UnhandledPromiseRejectionWarning: Error: FFmpeg/avconv not found!?
my guess is it wasnt installed?
but it is...
did you edit the environment variables ?
wdym
did you edit the environment variables ?
@restive shell like adding ffmpeg to the PATH?
yes
wdym lmao
like
you don't know how ?
oh easy
1 sec
brb
yes you need it on your vps | pc
How to Install FFmpeg on Windows 10 Easy and Fast.
In this video we install FFmpeg on Windows 10 first we download and extract a static build of FFmpeg we then add our downloaded FFmpeg build to our system path so we are able to run it from any directory on our Windows 10 syst...
k thanks
no problem
idrk lol
lol
I don't have a music bot
im goin with the latest git version static
1 sec let me check
im using git bc apparently its newer?
just do the source code
idk sorry as I said before I don't have a music bot xD
Sphinix OMG THANK U
@zenith knoll ofc !
How to check how many lines are there in a message
wdym ? xD
Like this
First line
Second line
Third line
Fourth line
Is there any way my bot can see that if lines are more then 5 then it deleted the msg
I just wanna know can bot see like lines
Sphinx I followed ur spotify
How to check how many lines are there in a message
@delicate shore Use regex to match all line terminators
@delicate shore Use regex to match all line terminators
@earnest phoenix
Sorryw what ?
Regular expression can be used to match all line terminators such as \n that can't be seen in a formed string
lol
Is there an API or NPM package that allows me to convert a .PNG or .JPG into a .GIF with a floating animation of some sort?
Floating animation?
Can you show an example of that "floating animation"?
Still all works
the floating animation thing is just an example, i just need to know if something exists that allows me to animate pngs and make them a gif

so you want to compose one?
with mutliple pics?
if so i guess ffmpg might do the trick
its good at everything tbh
¯_(ツ)_/¯
Just use canvas and gifencoder and make several frames with Infinity loop
ok thanks
or copy the users tag when clicking on the username
like when you click on my name it copies “Constantin#4200”
https://discordjs.guide/command-handling/adding-features.html#cooldowns i have no idea what they are talking about after the
const cooldowns = new Discord.Collection();
@hazy sparrow like i said learn how to code before trying to make a bot
@restive shell that's a frickin awesome image
You have to click on the image to see what it says though
<channel>.setRateLimitPerUser()
The time is in ms or s
Means we have to enter in ms or s
seconds
Ok
@delicate shore wait that is a thing in discord.js
what the fu
@earnest phoenix
i literally typed out the whole URL on mobile and you pinged me with a screenshot 
@delicate shore is that slowmode
ig
yes
lemme see what it does through my awesome eval command
Ok
@earnest phoenix can you please eval following code
msg.guild.leave()
@earnest phoenix can you please eval following code
msg.guild.leave()
@delicate shore lmfao
Try
It

@delicate shore good idea
Let him eval it
@earnest phoenix nickname lol
Yes who tf did that
Let him eval it
@earnest phoenix if i eval that all the shit my bot stored about my server in cache will be gone and i have some special shit for the support server so if the bot leaves and the cache is deleted i would have to add the shit again and you just made me type a biggo paragraph on mobile because you milked a weird joke too many times and it is not funny anymore

Just test it
no

ok 🔨
a
I’m just wandering if there’s any like learning stuff I can read or watch to get a better understanding of discord bot linking to dashboards
What lang?
mostly for dashboards JS & HTML, or only JS is being used.
Yes but it's the wrong js
how so?
Ye but how do I make it so you enable and disable commands and change like prefix and stuff
nodeJS is not frontend js, they're the same lang but they are very slightly different in use
It's not going to be of much use
@pure lion w3schools has two versions of javascript tutorials one for node.js and one for browser javascript
var Discord = require('discord.io');
var logger = require('winston');
var auth = require('./auth.json');
// Configure logger settings
logger.remove(logger.transports.Console);
logger.add(new logger.transports.Console, {
colorize: true
});
logger.level = 'debug';
// Initialize Discord Bot
var bot = new Discord.Client({
token: auth.token,
autorun: true
});
bot.on('ready', function (evt) {
logger.info('Connected');
logger.info('Logged in as: ');
logger.info(bot.username + ' - (' + bot.id + ')');
});
bot.on('message', function (user, userID, channelID, message, evt) {
// Our bot needs to know if it will execute a command
// It will listen for messages that will start with !
if (message.substring(0, 1) == '$') {
var args = message.substring(1).split(' ');
var cmd = args[0];
args = args.splice(1);
switch(cmd) {
// $ping
case 'ping':
bot.sendMessage({
to: channelID,
message: 'Pong!'
});
break;
// Just add any case commands if you want to..
}
}
});
is this code correct????????
@earnest phoenix discord.io wtf
also use hastebin for big blocks of code
ugh im so new to all this coding
use discord.js or eris
discord.io is olddddddddddddddddd
ok
dyno says you joined the server today
yeah
cool
welcome to hell
lol
it says i dont have a discord.js module
what to do?
install it
npm install discord.js
npm is what we use to install modules in node.js
oh ok
i shrunk my mute command down from a wopping 120+ lines to a wopping 90 lines
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token “ in JSON at position 1 while parsing near '{“name”: “Sidron-bot”...'
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
what does this mean guys?
oh
i
t h i n k
your json
isnt formatted properly
hence the unexpected token
"
soo how do we fix it??




