#development
1 messages ¡ Page 633 of 1
cant tell, I dont see you are making an embed in ping command
its sending a blank embed for all commands
well I cant tell the root code, but probably due to the code being unorganized to a big degree
and something is getting executed even it shoudnt due to more than 4(?) message events
and mixed timeouts, mixed promises with hard to read indent
I would start from reorganizing and refactoring the code to one client.on message only
dont forget to indent properly
@frosty juniper Get a linter
its okay , i found the bug .
the anime search command was returning an empty embed

had the same issue once @earnest phoenix , removing node modules completely and installing it again fixed it for me
ty
Btw Alex, you should have your token in a json file
{
"token": "your token here"
}
then in your main file:
const token = require('../your destination')
and instead use
client.login(token.token);
Anyone here ever used the Wikidot API with c#? If so, was there a library available? Can't seem to find one đ (the API uses Xml-RPC)
Anyone know if the C# tweetinvi library has resolved the null exception error yet?
Did you try checking their github page or the release notes?
yeah but there's so much submissions there
just thought I'd ask here to see if anyone knows before I start combing all of that only to realize it's not fixed haha
Does anyone know expected waiting time for verification here?
Ah yeah, because it's been, that was I was wondering
Thanks for that information, I'll wait ! đ

Allright
      throw er; // Unhandled 'error' event
      ^
Error: socket hang up
    at connResetException (internal / errors.js: 559: 14)
    at TLSSocket.socketOnEnd (_http_client.js: 436: 23)
    at TLSSocket.emit (events.js: 205: 15)
    at endReadableNT (_stream_readable.js: 1154: 12)
    at processTicksAndRejections (internal / process / task_queues.js: 84: 9)
Emitted 'error' event at:
    at TLSSocket.socketOnEnd (_http_client.js: 436: 9)
    at TLSSocket.emit (events.js: 205: 15)
    at endReadableNT (_stream_readable.js: 1154: 12)
    at processTicksAndRejections (internal / process / task_queues.js: 84: 9) {
  code: 'ECONNRESET'
}
Then my bot restart. How can I do ?
and his is full of times
Who can I contact for my bot being denied for bot reviewing incompetency
Website mod who declined it
I clearly stated that the bot requires permissions in the submission
But it was given no permissions
therefore it fucked up
happened 2 times
dm the website mod
If a bot is required to have a certain permission in order to execute a certain command, that's understandable. I don't think making all commands require server permissions (even the fun ones) is a good idea.
thats the best shot you get right now
or better make your bot say the missing perms exactly
so the mod wont mess it up
Also never have Admin or Manager Server as your bot perms. It's way unsafe
I dm'd Oliy#0330.
I have it request administrator for utility commands in the future
Trust me, whatever you want to achieve can be done with so many perms other than Admin
I didn't know who verified bots
also they wont give your bot admin perms
no one will
ohhh
you need to specify exactly what perms it needs
and you need to make the bot say that perms it needs that is missing
How can I get one invite link usng the server id?
I'm using this but I'm getting not found unknown channel.
@client.command(pass_context=True)
async def teszt1(ctx, *, sid):
server = client.get_server(sid)
invite = await client.create_invite(server, max_uses=1)
await client.say(invite)
You have to create a invite to a channel if i am correct
Docs says this: destination â The Server or Channel to create the invite to.
Also I think sid is string not int
Try to convert it
Unless discord.py works with strings, but I doubt it
There is no problem with get_server the problem starting with create_invite
How do you create an invite without a channel
Then make sure your bot has permission to create an invite
I think it defaults to the default channel
AKA the first one returned by the api
It has permissions. And I don't know the channel I'm just know the server id and name.
Default channel... those don't exist anymore
But it says I can create an invite using the server. : destination â The Server or Channel to create the invite to.
You're using rewrite right?
I'm using discord.py 0.16.12
Oh
I keep forgetting lol
I know it, but the docs is for 0.16.12
Kef, not everything is a Client method on rewrite+
I'm not fully familiar with rewrite yet shiv
@lime fiber that's because you're reading 0.16 docs lol
And I'm using 0.16
Just a heads up
oof 0.16
Well.
Unknown channel
I wonder why you are getting such error when d.py tries to get a default channel
This honestly looks shady, though.
what does
Try making the destination a channel in the guild object then
Why do you want to create an invite to a server through your bot
like server.channels[0] or whatever is equivalent
ok, I'll try thanks
This code worked for me đ
@client.command(pass_context=True)
async def teszt1(ctx, *, sid):
server = client.get_server(sid)
csatlista = list(server.channels)
for x in range(len(csatlista)):
csati = csatlista[x-1]
invite = await client.create_invite(csati, max_uses=1)
await client.say(invite)
iteration through server channels
Though that loop is just pointless
It legit just looks like a reinvented wheel version of server.channels[-2]
Yeah was about to say that lol
d.js
How to get the number of arguments?
assuming args is an array, args.length
args.length?
how are you defining it
const Discord = require("discord.js");
const { Canvas } = require('canvas-constructor');
const { loadImage } = require("canvas")
const fsn = require('fs-nextra');
module.exports.run = async (bot, message, args) => {
if(!args[0]) return message.channel.send("Please provide some text")
const myimg = await loadImage('https://i.imgur.com/SSzjSEL.png')
if(args.lenght === '1'){
let profile = new Canvas(513, 513)
.addImage(myimg, 0, 0, 513, 513)
.setTextFont("20pt Discord")
.addText(args[0], 310, 53)
let attachment = new Discord.Attachment(profile.toBuffer(), 'retarded_dog.png')
message.channel.send(attachment)
} else if(args.lenght === '2'){
let profile = new Canvas(513, 513)
.addImage(myimg, 0, 0, 513, 513)
.setTextFont("20pt Discord")
.addText(`${args[0]} ${args[1]}`, 310, 53)
let attachment = new Discord.Attachment(profile.toBuffer(), 'retarded_dog.png')
message.channel.send(attachment)
} else if(args.lenght === '3'){
let profile = new Canvas(513, 513)
.addImage(myimg, 0, 0, 513, 513)
.setTextFont("20pt Discord")
.addText(`${args[0]} ${args[1]} ${args[3]}`, 310, 53)
let attachment = new Discord.Attachment(profile.toBuffer(), 'retarded_dog.png')
message.channel.send(attachment)
}
i assume you have an index/main file where you do something like const/let args = ...
send the line where args gets declared
wait pls
const args = message.content.slice(bot.config.prefix.length).trim().split(/ +/g);
lol
fixed by ading
message.content.split(" ").slice(1).join(" ");
it is better than check length of args
Do I have to re-apply for my bot? because I don't really understand the announcement.
Oh okay, thank you.
Essentially self promo
So for that you need to give money to put your bot on the front page?
Also, how come when you click on the PFP of those it shows Mewbot or something and yesterday it showed mee6?
Mkay.
Wdym
When I click on the bots thing it shows Mewbot.
I've got another problem đ
So here is my code which is getting me invite links.
It's working, but it creates link to voice channels. But I want text channels. How can I do it?
@client.command(pass_context=True)
async def teszt1(ctx, *, sid):
i = 1
server = client.get_server(sid)
csatlista = list(server.channels)
for x in range(len(csatlista)):
csati = csatlista[x-0]
invite = await client.create_invite(csati, max_uses=1)
await client.say(invite)
What you could do is access the api directly or use something in rewrite
if channel.type
In the loop itself check if the channel is text channel then break the loop
I just access it directly in case I need other stuff since async doesnt have is_nsfw()
Ima step away since I know nothin' about coding.
learn kthx
Nope kty.
i used this: ```py
@client.command(pass_context=True)
async def teszt1(ctx, *, sid):
i = 1
server = client.get_server(sid)
csatlista = list(server.channels)
for x in range(len(csatlista)):
csati = csatlista[x-i]
while True:
if not csati.type == 'Text':
for x in range(len(csatlista)):
print(i)
csati = csatlista[x-i]
i += 1
else:
break
invite = await client.create_invite(csati, max_uses=1)
await client.say(invite)
What's wrong with it? The terminal looks like this:
That server has got text channels!
3 for loops?
oof
Honestly
yeah that's incredibly inefficient
very funy
Async doesn't have text_channels does it
loop server.channels -> if is text -> use it -> break
i have a question do any of u know how to connect a discord bot with faceit
It still return error in the terminal ```py
@client.command(pass_context=True)
async def teszt1(ctx, *, sid):
i = 1
server = client.get_server(sid)
csatlista = list(server.channels)
for x in range(len(csatlista)):
csati = csatlista[x-i]
if not csati.type == discord.ChannelType.text:
for x in range(len(csatlista)):
print(i)
csati = csatlista[x-i]
i += 1
else:
print('Text channel talĂĄlva!')
invite = await client.create_invite(csati, max_uses=1)
await client.say(invite)
break
IndexError?
yep
add print statements to your code and debug it
print out i, print out csatlista, etc. to figure out why it's going out of the list
I'm pretty sure all of this can be done with one for loop
This is the terminal. It won't stop when it finds a text channel.
if you have a text channel, then break out of the loop
I've an else with a break in it.
you have a logic error then because I don't see the thing being printed out
I'm just printed the i
It is getting voice channels and thats I need this to get text channels.
I believe I provided a decent way to do that but apparently he didn't want to use it
Would need a separate list of text channels, then random.choice. How to get first and last text channels should be obvious
alternatives to change this?
client.guilds.forEach
In this code he sent in a difeerent msg the servers
and I want that he send all of servers in the same msg
Sending too many requests at once
Its against the ToS
It can also get your account terminated
holly fuck
sorry Discord
I delete it
Thank you @amber fractal @slender thistle @cursive dagger đ

đ
One message removed from a suspended account.
@sage bobcat what kind? what stuff u needa put in there
One message removed from a suspended account.
depends on the lua code
One message removed from a suspended account.
oh ok idk then wait for someone who knows
One message removed from a suspended account.
yeah but i assumed that you were getting something off of github and tryna just fill in the config and run it
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
ok lol im sorry
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Its an element on the periodic table
One message removed from a suspended account.
lol
One message removed from a suspended account.
Hi, I'm getting 'db update text is a not function' error in db.quick. Can you help me?
code please
ree
@real helm if your users are intrested in the development of your bot they will join your support server, otherwise they will most likely ignore the msg anyways
^ Si, ademĂĄs de que es muy probable que saquen a tu bot de sus servidores, asĂ que no recomendarĂa hacer eso @real helm
Please keep non-English to #memes-and-media. @copper cradle
That dude speaks spanish, so I gave him an answer in spanish
but sorry for breaking the rule
bit silly that we can't help people in other languages in a help channel imo
^
by speaking a non universal language you are excluding other people from the conversation and neutrailizing their ability to help, which im pretty sure is why the rule exists
you could say similar about off-topic; speaking a non universal language there excludes other people from the conversation also
but we cant help if we dont understand what he's saying because google translate is shit
please let's keep this on-topic and have the discussion elsewhere, like #general would be okay for this discussion
hey literally just translated the previous message for the guy who doesn't speak english, no need to argue about it more than that,
fair enough
how to make like 49 to 00:47 ?
and like if it is like 120 it makes it 02:00 ?
wdym?
For writing an API, do you recommend using Go or Rust?
Any language you want my dude
I'm concerned about performance, mainly
That is much more on your code than anything
Good python outperforms crappy rust code everytime
Do what you are most comfortable with
Alrighty
So I've been looking into sharding on discord.js, mostly out of curiosity, and I'm kinda confused . Reading this https://discordjs.guide/sharding/ it kinda sounds like shards all have to run on the same machine, as opposed to say, deploying multiple shards across a network of connected computers? If so that's a shame, cuz I was thinking it would be fun to just have shards spawn and despawn in some sort of container orchestration thing like swarm
A guide made by the community of discord.js for its users.
Well it's not worth it with most bot's scale but just as a thought experiment i'm wondering if it's possible, cause the discord.js code just seems like it'll try to spawn a number of processes equal to the # of shards you need and that's it
internal-sharding - 1 Process, d.js handels it all internally
sharding - 1 master process, each shard is a sub process ( no shared memory, aka you need broadcastEva l )
manual-sharding - you specify shard count and id can be split up over multiple Computers but good luck getting data from other shards
oh cool
But yeah then you can't communicate across shards right
cuz it's designed for inter-process communication there's no way for them to talk over the lan
on one pc you can use broadcastEval wich works trough IPC iirc
sendkng strings / JSON.stringified Stuff
Yeah that plain wouldn't work then you're gonna need some sort of messaging system for your bots to synchronize for any kind of big bot
omg what if you used a dedicated discord server
where shards can send each other messages using their shardId
ahaah that'd be glorious
If you are really bored you may procedd
wouldn't that be amazing, a single bot posting messages every few seconds to itself in an otherwise empty server
Sounds like ratelimit fun and also dont forget accsesing a guild from another shard is g onna be hard
smthng like new Discord.Client({shardId: 0, shardCount: 2}) should do it ( for starting manual shards in diffrent processes )
think i'll drop by the discord.js guys and ask them how their sharding would work out over a network
i expect to be ignored

Websockets or MQTT ( e.g https://emitter.io/ ) could be something
do your shards need any intercommunication?
It's a thought experiment, but yes they would absolutely need to communicate
also 1 sec lemme finish up this wot battle lol
okay, so
in what way would they need to communicate
Well let's see:
- Each node needs to ping every other node when it goes up/down, i suppose you could do a heartbeat thing
- Each node needs to know its id, and every other node's id, and they all need to be unique
If it can do that, that's already okay. Keep in mind my different instances can share a filesystem but i'm reluctant to use files for obvious reasons
Why do they need to be able to heartbeat each other?
@leaden gust
Shouldnt that be the responsibility of the container orchestration system?
I need the bot processes to heartbeat each other, not the containers. The bots aren't aware of the swarm's state
Uh, to make it short, right now i have a single bot that parses a config file, and if it's split across multiple instances, each instance needs to know which part of the file it's allowed to parse. Also if a new shard arrives or a shard leaves, everyone needs to recalculate that
That is incredibly vague
Couldnt you jsut use the shard ID to parse that fraction of the file or something like that
A ton more resilient and no communication needed
What if I come in as shard 3 but then shard 2 bails tho
It's kinda hard to say since youve been incredibly vague
Also if another shard spawns after me i need to know that somehow
Why tho?
Im confused why some shards use different configs yet share a singular config file
Does anyone know if you make the bots presence to be your spotify??
This sounds like a job for some k8s
I use k8s for my bot
Same
Works well enough for my 512 shards
I use it at work, so it was not a hassle to setup. Although I doubt my bot needs it at only 15 shards
It's convenient for scaling, really
If your bot already works well on k8s, you're pretty much good
all you have to do is add more machines lol
for sure, it is really nice if you have a micro service style architecture as well
My bot fetches realtime streams from twitter accounts. Those twitter accounts are described in a file. Two instances can't fetch tweets from the same account, so I need to make sure every single shard is aware of which part of the file it's in charge of, and if an instance drops out everyone needs to take care of part of that work.
This sounds like the wrong way to go about doing this
do you use a front end for your k8s? I have been trying out rancer and its... ok i guess
Which part of that
Having the tweets be pulled from the bot processes
Perhaps what you could do is register a stream for all the twitter accounts being listened to on that shard
anyway, i guess you could decouple it and have a separate process to do that work but then i still need to communicate with my shards
Right but how do i know which twitter accounts to listen to on each shard
Make a separate service that does this independant of the bot. Then have the bot just hit that
At least thats how id do it
But then I STILL need to communicate with my shards lol
I'm not too familiar with how you have it setup so its hard to say
If you dont want two to fetch from the same account.
- Any shard requests a random chunk of accounts
- Give them some and mark those accounts to the shard ID they were given to
- Only ever give them out to that shard.
It's kinda overcomplicated, really
You could add a system arround that assignment. Making the extra service the source of truth for who gets what
It is overcomplicated, that's the entire point, I'm wondering how it could be done
The shards are completely unaware.
Separation of concerns is a great thing to try to do when making something this complex
It also makes it ridiculously prone to failure
Let one entity control them rather than delegating it to many sources
And adds a single point of failure đ¤ˇ
So the solution to sharding across a network when you need them to communicate is "never, ever do it,just write external subroutines to manage them"
Not always
cuz it kinda sounds like that
but in this case I think it works
No, you're just approaching the problem from a perspective that makes it difficult under those circumstances
Well ok, how would you make shards communicate over a network normally then
Cuz my use case is pretty simple, I just need shards to be able to send like, a ping to each other
not text data or anything
No, your use case isn't pretty simple at all
Shard rebalancing is like, not simple at all
What I would suggest doing is having each shard run a realtime feed for the guilds its on
You could just query the followed twitter accounts at startup for the guilds that shard is on
Hmmmmmmmmm but then I have a problem where if 2 separate guilds want the same twitter feed twitter might tell me to go fuck myself
I think
How so?
I did think of that tho it is pleasant to think about
You could just listen to a unique set of twitter accounts
Idk I'm wondering, I think that's how their enterprise api works, kinda like sharding
it'd be like 2 shards posting to the same channel
Could you just make a twitter service that does all of the feed stuff. Shards are now completely agnostic to all feeds and just ask the service for the info they need.
Then this service is the singular point to twitter
no worrying about stepping on toes?
Tbh, the services dont even need to be connected to the shards
I'm assuming its just sending messages
By connected I mean an api facing the bot in general
Yeah I think tha's the best solution
Decouple the twitter part into a central process, write some handshake protocols for shards where they say "Hey here's a list of channels I can see, give me my tweets"
Do shards know when their scope grows/shrinks? Like when they lose or gain access to channels
cuz they still need to be able to poll it every so often
Depending on what lib you use. just check how many guilds/channels you are in.
yeah, that's real shoddy tho, especially if they're rebalanced often
aw man i guess sharding across a network is a mess for my bot
it's possible twitter's enterprise api solves those problems, i haven't looked into that extensively yet
It doesnt really look to be the case
words can't express how sad I am
well thanks for participating in my thought experiment, i guess if my bot grows i'll just get a bigger vps :3
the main issue is that i don't just do the usual "get a message -> process data -> respond to it" workflow, since most of my input is actually spontaneous and comes from an external source (twitter)
... i just realized this is still a problem even if it's not over a network tho it's less of a problem

So I want to have a feature in my bot that allows my users to store an array of numbers, but what would be the most intuitive way to add/remove numbers from that array?
- get array of numbers from the db or create an empty array
- append number
- save it to the db
@green nexus #memes-and-media
Why is there bot spammers in here
shit happens
if you have issues with a specific bot, find their support server (click the button named "Support Server" on their DBL page). this channel is for bot development messages. #memes-and-media or #general if you're not here for bot development
Not the programming logic
I wanna know what's the neatest most elegant way to get the user input..
like where to add and what to add, whether to replace the entire list with new values or append a value at the end, or add a value in the middle, etc
I don't want the command to be unbelievably long, but I also want users to edit the values quickly
@opaque eagle if u dont have plans to do special queries
u can save the entire array as numbers separated with commas
Or if u feel fancy
U make a table for arrays
arrays_tbl
arrayId | discordId
and then a table called arrays_val
arrayId | arrayVal
if u dont want the users to have multiple arrays
u can probs make a table like this
I have a feeling you guys still donât get what Iâm asking
discordId | arrayVal
Idc about the code/storage behind it
What would the âUIâ look like for a command that allows a user to edit an array of numbers on Discord
Whatever I give up trying to explain it lol
can u explain why a user would like to have an array of numbers
excuse me ...how to connect database of my bot? My bot is written in JAVASCRIPT...My database is MSSQL
https://www.npmjs.com/package/mssql @zealous talon
OK let me try @sinful lotus Thank you
I think my bot did not run to sample of website...and no error message...why?
probably you may need to run it a bit diff not sure
you can probably try
https://www.npmjs.com/package/sequelize
which supports a lot of dbs
discord.net does anyone know how to list the total amount of users in a certain role
example, I'm trying to list the amount of users in the "Verify" role
OK let me try it again
?
We have on our Discord Server the problem that someone is always joining with a new Bot all 5mins and he is posting scam websites,
his bots are always new on discord, so is ur bot having something against new discord users?
wat
is my english so bad
Those are known self-bots and has nothing to do with DBL nor this channel; you can use a bot to automatically have the links deleted. #general would be a better channel to use.
its not bad, just not explaining it very well.
i think hes asking if theres a way to do something about new discord users
I want my bot to connect to the database through my computer. but my computer is just a notebook computer.
now my bot give me a error message...it Looks like time out....but i don't know how to check connection
my English is not good as well
SQL 
@flat pelican ?
I hate SQL, thatâs why
@flat pelican why? hate SQL?
I code with python, js is too complicated for me sorry
I prefer using a nonSQL like Mongo
@flat pelican That's OK , but i don't understand python....i never not use it
@flat pelican what is Mongo?
A database
@flat pelican OK,but my computer just installed SQL SERVER and ORACLE ...
Welp someone familliar with it may help you, Iâm unfortunately bad with SQL stuff

mongo was a pain in the ass when our bot grew
its easy for small bots, even medium bots.
But when we started to scale it was no bueno
We switched to SQL from mongo and it runs much more efficiently, and it cut our speeds by 90 percent.
So its almost instant
sql is fine
It used to be a few seconds for each command on mongo
47k guilded bot with maria db, runs flawlessly
How big is your bot Jakey
oof
my cps is still inaccurate so 
I've used collections on mongo with over a million documents and didn't have any issues
but i don't connect my sql server database...
đ¤ˇ
and i don't know how to check connection
oof
I try to only save data where necessary

Imagine if I saved messages
đ
So....Sql Server Connect fail....Time out...how to check connect?...
how to cache users my bot has
How big is your bot / how many users
well, this server has 50k members
also what is your lib
I use redis, or just storing it in memory
.fetch()
yeet
on clientOptions there should be fetchAll
client.users.fetch() ?
master
https://discord.js.org/#/docs/main/stable/typedef/ClientOptions // fetchAllMembers
just set that to true
no need to do client.users.fetch()
@earnest phoenix loop over the server members and check if they have the role or not
any quicker way? The server has 12,000+ members
I don't think so. Run through the cached members though, don't request each member from the api
Unless discord.net's DiscordRole object has like a list object of members with that role
I dont think there is a quicky way but if you would do that make sure thats async
the bot does not respond to the command: calculator
calculator command: https://hastebin.com/azecumobef.js
pl.json: https://hastebin.com/biginibere.js
message event: https://hastebin.com/umoteyeluv.js
Error: https://hastebin.com/elozegufob.js
!serverinfo
How do I know the name of the emojis? (gif emoji with nodejs. I use reaction.emoji.name)
I will filter out the emojis reacted.
Does anyone know a guide or video so I can learn about sharding for djs?
A guide made by the community of discord.js for its users.
that guide is indeed very good
just post your question
client.on('message', async (message) => {
const db = require('megadb');
let prefijo = new db.crearDB('prefijos');
let prefix;
if (prefijo.tiene(message.guild.id, )){
prefix = await prefijo.obtener(message.guild.id)
}else{
prefix = 'jn!'
}
if (!message.guild) return;
if (message.member.bot) return message.channel.send("ÂĄLos bots no pueden ejecutar mis comandos!");
if (!message.content.startsWith(prefix)) return;
const args = message.content.slice(prefix.length).split(/ +/g);
const command = args.shift().toLowerCase();
if(message.content === '@cerulean pasture') {
message.channel.send(`Mi prefijo actual es ${prefix}`)
}
I want the bots not to be able to respond, so they can not use the bot command
Thanks @mossy vine
@earnest phoenix
message.author.bot // Use
message.member.bot // Don't use.
@earnest phoenix first of all, dont create a database every time the command runs
if (message.author.bot) return; I think it's with that but it makes me spam
@warm marsh ?
?
do you can help me
I don't know what your issue is.
Please don't randomly mention people for help, Just put your question here and be patient
@earnest phoenix
khe
(Wrong channel if you want to have a chat. Don't mention random people out of the blue.)
anyone knows dpy? I need to know how to detect spam messages
depends
I was about to ask like what kind of spam exactly
I know that it is inside the event (on_message) but IDK to detect it
like this
1
1
1
do you know how?
so duplicate messages
on_message is only a discord event, that's pretty much all you need if you know the basics of python
so how to make it? đ
additionally, I don't know if there's a way to access discord.py's internal message cache, otherwise you can just make your own cache and implement certain checks if it falls under "spam"
you don't know how to build a cache system?
do you at least know anything about variables?
yeah I know
Hello, I wonder how can i disable my button inside my iframe in discord bot list website ?
I tried $(function() { $(".button_back").on('click', function(event){ event.preventDefault(); }); }); inside the console but still clickable
@frigid juniper just move the other buttons
Move ?
Just retexture them and move them where you want
ah ok
This one is in the iframe đ
var cmds = "json text"
if(cmd === cmds[cmd])
I think
Idk what lib you are using but I understand json enough to understand it ig
Does anyone know of Discord sharding databases?( Good or pretty decent ones)
Like Redis
Or
define "discord sharding database"
Like a good database for shardingÂż
Cuz it really isnât much different than without sharding
Stuff like Enmap (for js), Quick.db and KeyV probably don't really work on multiple shards because its partially based on cache
I sharded with enmap by running it in a different file
But I dont use it anymore because it was shit
And not really a db
Enmap older verisons allowed to use postgres / mysql / redis
Anyone here use JSoup library before? Theres this weird issue where when compiled and run it throws NoClassFoundException
:c ÂŻ_(ă)_/ÂŻ
It means the class the error refers to doesn't exist
heyo
Commands are restricted to test channels.
ye i confused testing and development sorry
heyo, I'm currently using msgObject instead of message. How do I change this? I use TypeScript
One message removed from a suspended account.
One message removed from a suspended account.
Doesnt work
helo
I'm trying to change to message from msgObject
so for example,
instead of writing msgObject.channel.send it would be message.channel.send
How many Guilds per shard do you guys have?
I would recommend 1000
what is a shard?
How do I get data from this page to Visual Studio, https://api.torn.com/faction/8989?selections=basic&key=1vpH5bIwSDLfkwX7, I wanna make a bot but I do not know how does API work that well
since it's JSON, you just have to make a GET request with any http library that works with the language you chose for your bot, use a json library to parse it, and then use it within your code
I don't think he knew what you meant
i've never used javascript before, but it looks promising
put the website here and then you have the data
Alright thanks a lot for the information!
you need 2FA enabled on your account for certain bot actions iirc
The problem is that I clear all reaction on a message and that it works on a lot of server except one
the server probably has the 2FA requirement for moderation actions
UH OK
And i do verify the developpper account ?
enable 2FA for whichever user account owns the bot
so, if the bot is hosted on your discord account, enable 2FA for that one
Ok thx
Hi, i have a problem, with a command, i store a value in my db and when i would use after, i have this error:
Could not interpret "[u'logs']" as string.
Why i have this error ?
Whats the code?
When i use after, its:
guildConf = client.settings.ensure(msg.guild.id, client.defaultSettings)
msg.channels.find("name", guildConf.setlogs)
If u would like have more code, say me and i send all code that i use for this error
I need the part where you define the log channel I thini
think
const guildConf = client.settings.ensure(msg.guild.id, client.defaultSettings);
if (!msg.member.hasPermission('ADMINISTRATOR')) return msg.channel.send("Erreur `permissions manquante`: ADMINISTRATOR")
let args = msg.content.split(/\s+/g)
const [none, prop, ...value] = args;
if (!args[1]) {
let setconf_embed = new Discord.RichEmbed()
.setColor("#3377ff")
.setTitle("Config menu")
.setDescription("Ici sera toute les commande pour configurer votre serveur")
.addField('Commandes', `${guildConf.prefix}setconf prefix: Changer le prefix du serveur`)
.addField('Informations', `La commande **${guildConf.prefix}setconf prefix** peut prendre en compte qu'un seul caractĂŠre pour le prefix`)
.setThumbnail(client.user.avatarURL)
.setFooter("Š ZÊbra'Bot", client.user.avatarURL)
msg.channel.send(setconf_embed)
return
}
if(!client.settings.has(msg.guild.id, prop)) {
return msg.channel.send("Erreur `paramÊtre`: " + guildConf.prefix + "setconf <paramètre> <valeur/mention>\nparamÊtre disponible: `prefix` | `setlogs`");
}
if (args[3] && prop === "prefix" || args[3] && prop === "setlogs") return msg.channel.send("Erreur `valeur`: " + guildConf.prefix + "setconf <paramĂŠtre> <valeur/mention>\nLa valeur ne peut pas contenir plusieurs mots.")
if (!args[2]) return msg.channel.send("Erreur `valeur`: " + guildConf.prefix + "setconf <paramètre> <valeur>\nLa valeur ne peut pas être vide");
if (prop === "setlogs" && !args[2]) return msg.channel.send("Erreur `valeur`: " + guildConf.prefix + "setconf <paramètre> <valeur>\n")
if (args[2].length > 1 && prop === "prefix") return msg.channel.send("Erreur `valeur`: " + guildConf.prefix + "setconf <paramètre> <valeur>\nLa valeur ne peux pas contenir plus d'un caractÊre")
client.settings.set(msg.guild.id, value, prop);
msg.channel.send("Le `" + prop + "` du serveur a ĂŠtĂŠ changĂŠ en `" + value + "`");
This is the part where i define the log channel and also the prefix
Some reason it thought your message was a embed. Odd
For exemple, i tap this: -setconf setlogs logs and he put on my db the argument logs for the channel and when i would like find the channel "log" with msg.channels.find("name", guildConf.setlogs), i have this error:
Could not interpret "[u'logs']" as string.
So i don't think that my message was a embed
I use the same principle for the prefix and i have no problem with
any suggestions for converting emoji into a single ? rather than the 2 or more it automatically prints to console?
Find it, replace one of the ? with ""
Good day to all. I have a code that displays the top 10 level. How can I get the rank of each participant separately?
const top10 = DB.prepare("SELECT * FROM database WHERE guild = ? ORDER BY xp DESC LIMIT 10;").all(message.guild.id);
let top = ['đĽ', 'đĽ', 'đĽ', 'đ
', 'đ
', 'đ
', 'đ
', 'đ
', 'đ
', 'đ
']
let completeString = '';
let i = 0;
for (const data of top10) {
let rankString = `**${top[i++]} ${client.users.get(data.user)}**\nĐĐżŃŃ: ${data.xp} đ ĐŁŃОвонŃ: ${data.level} đ\n`;
completeString += rankString;
}
const embed = new Discord.RichEmbed()
.setAuthor("ТОп 10 ŃŃаŃникОв пО ОпŃŃŃ!", message.guild.iconURL)
.setColor(0x00AE86)
.setDescription(completeString);
return message.channel.send({ embed });
I use better-sqlite3 and d.js
Maybe there is a way to get the rank of the participant without saving it before getting
@west spoke the way I am implementing that is by using string.replace ("??","?"), the only down side is users who actually have two or more strings of ? will be changed as well
think im gonna stick with that, thanks 
@west spoke don't use requests as it's not async, so your bot would essentially pause while the request goes through. use aiohttp
it's not async though...
that's not requests
await~
that's aiohttp
yeah change that
Meh
(your entire bot would be unusable if someone uses the command -- if they spam it, your bot would eventually go offline)
Yeah
Hmmm, so
Something took too much to do is a connection error right?
That's what happened with the previous one used
Soooo... ty
Ok
Again how fking dumb am i
why do I mix the three up
urllib ffs
@ionic compass actually, I was rewriting one of my commands and I needed the same. Here.
This should work better than replacing it tbh
SQL, or file storage kbai
Ummm
How to post is still unknown to me
Iâm new to coding whatâs the difference
everything
Depends
A web dashboard is not something you should do as a beginner programmer @brave anvil
^
but you just said you're new to coding?
Yeah

Ik
Yes
XD
Css?
Yes
but yea, you need to know how to make a frontend website that connects securely to your bot's database
^
huh?
if you know what you're doing it's free
Probs newbie question but what do I change to CORS to allow upload from same-orgin.
I've tried using the Mozilla docs and all that and nothing works
And yeah
The reason why Most bots is hosting programs
money for 24/7 guaranteed uptime
Well

Depenes
24/7 is never guaranteed
Same
My specs

I dont believe this is the place to be chatting tho
If its right for your uses yea
ok I guess my question will never get answered
huh?
What
"Probs newbie question but what do I change to CORS to allow upload from same-orgin.
I've tried using the Mozilla docs and all that and nothing works"
?
I've read that one twice
Api gateway?
Oh kk
Oh
?
Nedko
@cunning snow pip install discord==0.16.12
Ik python
Async branch was discontinued
But
XD
XD
Ok
S3 = storage
Route 53= hoster
Ok
Complete uptime using around 7 different servers around the us
But no support for anything except html
cri
Oke
Certified
Ight I have to pay around $500 a year or sth ffffs
For a "secured" website application or whatever
I am perfectly fine with 11 a year for a un-secured website
s3 comes with that by default I believe
Hmm
Due to you know private stuff
Yeah
XD
Because logic
I donât know much about the aws and mozilla engine
I tried to look for you something about it Maybe
Hmmm
Does anyone?
switched off of AWS a while ago and used the funds saved for auction ads 
ok
I
Uhhhh
Ok
I hate heroku
â
Heroku

Me
I host on ovh
DigitalOcean
,selfhost
Yeah
XD
I host on a laptop
Discord broke oof
Its all in binary
Is
Its not a vps
Type
It would work as it tho
Yes
I mean AWS works as a vps if you know how
But it uses a cmd prompt

can you try combining your words so you don't send 1-2 words per message
You can install python through cmd I think
Me?
Ye
That's why I have it pay yearly
đ
@cunning snow you need a paid server to run your bot. stop asking people to host your bot for you... there are no other alternatives besides glitch/heroku
I said to combine your messages

I though he was talking about hosting bot himseld
one word per message is very spammy
^^
@cunning snow on Ebay you can get old vista laptops for under $100
Omg
or just get a raspberry pi for like $20
Yes
Depends on your internet
same thing as getting an older laptop, both are running from your home connection
I have really fast internet
doubt it. it's just linux vs windows at that point
And ram factor is a thing too. Pi zero is smallest, but doesnt have much ram
He wanted help in a dm justin
Same here
I would host another app if I was paid 
I would host another bot if it's node and if you are not a complete retard and need help with starting it 
#memes-and-media or #general cuz this past conversation wasn't related to bot development at all
ayy whats the best discord.py latest's docs
why do always js has gooder docs in there packages then python
subjective
How many times I can edit my message in js
as long as you can track the message and respect the rate limit
I have a dance command in my bot it again and again edit the message
But it very slow
Any way to increase the speed
message.channel.send("(~âžâżâž)~ ")
.then(msg => {
msg.edit("~(âžâżâž~) ")
})
}```
Code is something like this
Umm
@pallid zinc its all depending on the bots connection to discord

