#development
1 messages · Page 1097 of 1
Then yeah, I see zero issue with a global filter
i just want to keel over and die
I feel that
but also finish my dashboard ;)
covers a small avenue of words, very simple ones
i want to d r oopooow wwwn inj my shitty code
i might get a dashboard for my bot but tbh i can give 2 shits about it rn
its simple take a break. take a walk, and look at the issue again, this is how i fixed some of my stuff
too small and too little configurable settings for me to bother, not to mention i'd have to add so much more code to make it more in-depth
Why do i see this in production code :(
if (flag == false)
is sending to a channel every X hours api abuse? it is right?
no
if its disableable then no
if you're sending one message to a channel every hour then no
k
just as dice said if its something that can be used for alot of guilds make sure its an option
and its disabled by default
also dice says fuck please help me :(((((((
its going to be something you can enable and set the hours
yeah then that'd be fine
oh im an absolute retard........
maybe if you ask we'll help you
since api requests are by minute i believe so
:))))))))))))))))))))))))))))))))))))))))))
maybe if you ask we'll help you
it didnt work last time
maybe the people who could help you didn't see the question last time
did someone got an idea how to properly debug canvas renderer? for some reason i dont get any image
ok it logs the info
Hey can someone help?
const pages = {
1: { title: ':one:', description: 'This is page one!' },
2: { title: ':two:', description: 'This is page two!' },
3: { title: ':three:', description: 'This is page three!' }
}
I tried console logging:
console.log(pages.length) but it returns undefined, what should I be doing to find the length? Please ping me if you have a solution.
Idk js, but should there be a 1: 2: 3: before object data?
idk, i saw an example that used it
okayy
@faint prism
const pages = [
{ title: ':one:', description: 'This is page one!' },
{ title: ':two:', description: 'This is page two!' },
{ title: ':three:', description: 'This is page three!' }
];
is this valid?
with the []
and {} inside
it shoukd work theoretically
Looks like an array of anonymous objects to me
meh who cares its just an array
Looks fine, but idk Javascript.
An anonymous object is the instantiation of a type without a class. Like what you're doing. Its inferred from the context.
okayy
actually, looks like JS calls them Object Literals
const attachment = new Discord.MessageAttachment(image, "image.png");
let embed = new Discord.MessageEmbed();
embed.attachFiles([attachment]);
embed.setTitle(data.title);
embed.setImage("attachment://image.png");
embed.setColor("RANDOM");
await message.edit(embed);
```any idea why i cant edit the embed and add a image?. the image is rendered by canvas (tested it with just a normal message.channel.send(attachment) and there was the expected output)
const collector = msg.createReactionCollector(filter, { time: 60 * 1000 })
collector.on('collect', async (r) => {
if (r.emoji.name === '⬅️') {
if (page != min) {
page = page - 1;
await msg.edit({ embed: pages[page] });
}
} else if (r.emoji.name === '➡️') {
if (page != max) {
page = page + 1;
await msg.edit({ embed: pages[page] });
}
}
})
collector.on('end', async (collected) => {
console.log("ended")
})
});
}
anyone know how I can remove the reactions from the author after they react?
r.remove()
yo @lusty quest how many servers u gained by bidding
That's an interesting concept
That removes all users though, I don't think you can just remove one user
last week around 80 @delicate shore
80
total
maybe 90
205 i think
because i dunno if this is normal
actually
rip
it is now in 301
r.remove("⬅️")?
why rip?
rip
@lusty quest why rip tho?
No, just r.remove()
What's your server load at? @delicate shore
my bot is way to niche to gain large amounts of guilds
Specific to a type of group of people
op
denoting or relating to products, services, or interests that appeal to a small, specialized section of the population.
ok
can i filter an array by an array?
:pepehmm:
nested for loop time
:DDDDDDDDDDDDDDDDDDDDDDDDDDDD
@faint prism do you know if i should filter front by back or back by front?
:hmm:
Does it matter?
not sure
@delicate shore
But how is your server holding up?
also h o w
ye
But how is your server holding up?
its complicated (blocked)
i am gonna shift to ditial ocean inn 3 weeks
currently it's on glitch
10$/month
then it will be 5
dollar or some
Guess it's hard to tell with Glitch the performance of the bot under load?
No, just r.remove()
@cinder patio
It removes the bot reaction as well, anyway to filter this out?
Yeah you can actually
oo awesome
r.users.remove(userToRemove) where userToRemove is a User object
can be a user id, yea
oo okayy
you can also do message.author
gotcha thx
i dont get it. i can send the Rendered image as normal message but cant attach it to a embed
tehfuck
like wtf? http://node0.s8s.app/UcT0
(idk if it is even possible to attach images to embed that i edit)
i think it is
Should I be using an embed for my bot replies?
embeds give you more options for what you can do
How do you get a users name, Not in a mention and not a nickname, And no tag included
in discord.js
like from an id?
you cannot edit a message with a new attachment, however you can send an attachment with an embed
User.Username.Split("#")[0] ?
<User>.username should return just the username, without anything else
Are you use it doesn't include the descriminator?
yes
Discord.NET does in the User.ToString() 😛
ToString isn't the same as the respective properties for the username and discriminator
right, but their have it overridden
ToStringing and then splitting is slower than just directly using the props
in discord.js, toStringing also returns the mention string (<@id> ), not the username and tag afaik
That's weird
I guess it's the framework dev's personal preference
Also, why is it that sometimes mentions have <@!id> instead of just <@id>
Hey. I forgot to make it so that an activity shows the amount of servers the bot is in (discord.js)
now it's just legacy behaviour
@earnest phoenix Thank you!
Do you know how I can make the bot have an activity like ServerCount Servers?
:l
depends on the lib
guilds.size or something to that effect
I tried that and it said Undefined.
in v12 all cached entities have been moved to cache managers
:l
Thanks.

oh, you said djs 🤔
Now it's not updating when I invite it.
I guess I shouldn't be doing this then
userQuery = userQuery.Replace("<@", "<@!");```
Ugh, I had it backwards
you have to update it every time a new guild is joined, or over an interval
How do I do an interval?
that's unrelated to djs
read the doc link you got sent
it tells you the args you need to pass
check pins
i like galaxygate, but digitial ocean is a good well known option aswell
but yeah, also pins
Has anybody used lavalink? I know a lot of people using ffmpeg, but I don’t like it much. The main problem is that I don’t want to run the bot locally, I use Heroku with it, but I am so confused about these pow.xml etc. Who could help me deploy a music bot with lavalink on hosting?
- dont reccomend heroku
heroku is known for being bad for hosting music bots
I don’t other options
heroku isn't powerful enough for a music bot ^^^
Oh
What are best free hostings? (I don’t talk about raspberry etc)
lOl JajAJajJa
I need free online hostings with Github maybe?
there are none
pay for resources you want to use if you want something reliable and strong
But it supports lavalink
I got no $$$
Who knows lavalink?
sucks to be you i guess
you're expecting too much from free hardware
which already isn't meant for bots in the first place
Em
my host is pretty kickass but its limited in that it can only bot
and i cant access it like a server
But there a lot of my friends bots hosted on Heroku with music
They said they use lavalink
and they havent stress tested it 🤡
have >=10 guilds streaming concurrently and your bot will begin to choke
Who knows what is pow.xml?
You mean pom.xml? Did you search it up?
It's for maven projects, isn't it?
correct
i have no idea what they want with it if they want to use lavalink since lavalink is a drag and drop jar lol
probably a client lib for lavalink
my bot just suddenly stopped running
discord.errors.LoginFailure: Improper token has been passed.
Uh oh
i regenerated token and updated it, and it still won't start
@restive willow is your token out on github/anywhere it could be seen publicly? if so discord automatically regenerates the token for you
Oh nice! That's pretty cool
no, its not
Yes it is. You don't want a security breach like that
Someone could impersonate your bot
he was saying no its not leaked
Well, that's good then lol
Make sure it doesn't appear in your commit history either
discord.ext.commands.errors.NoEntryPointError: Extension 'management' has no 'setup' function.
any ideas
JavaScript
How can i make a fetch message in a private message???
Like:
client.channel.get("id").fetchMessage("id");
but DM
discord.ext.commands.errors.NoEntryPointError: Extension 'management' has no 'setup' function.
error.
read the error.
it has a setup function
well, check it is the right extension
????
doesnt seem like you did
the error clearly says you havent.
Are you sure you've installed it? Go to your package.json and see if "express" is listed in the dependencies
Probably glitches fault
run npm install
inorganically grown means a couple users with a lot of servers with your bot
tl;dr: waet few months
inorganically isnt the one you wait for
suspicious growth you can wait out
inorganic you must have servers with unique owners for
well basically, you need to wait for that too, the time depends how many different discord servers with unique owners adds the bot into their server.
Can you tell me how to solve this?
resubmit when you have organic growth
:c
const smallGuilds = bot.guilds.filter(g => g.memberCount < 3).map(g => g.name).join("\n");
@regal garnet
Leave them :c
How
<
for now, you really dont have to leave them, just wait till you have more organic servers and resubmit.
in the future there will be a cap before you get verified, so leaving inorganic servers will be required
to get organic servers
some bots have been doing that past 3 years what i know 
@slender thistle
sorry for the ping, but I need some help semi-urgently:
I'm using discord.py. earlier, my bot suddenly turned off, and now I'm getting discord.errors.LoginFailure: Improper token has been passed.. I've tried regenerating my token and updating the file, to no avail. my test bot still runs just fine (it uses the same code, just diff token), so I'm not sure what's up rn
any + all help appreciated
add a limit if one person adds the bot in more than 5 servers, the bot leaves from the newest ones.
(replying to the last chat)
Are you sure you weren't API banned for excessively hitting the ratelimits?
how would i find out if i am
Now that's a question I don't know an answer to
youd be getting 429's right?
You could try again in an hour 
API banned as in getting a lot of 401/403s
and iirc 429s also count
correct however they would get a 429 on an api ban
why not just log your token to see if it's being read correctly in the first place
The above exception was the direct cause of the following exception:
discord.errors.LoginFailure: Improper token has been passed.```
and then i get
```RuntimeError: Event loop is closed```
i think if the bot was running fine before it wouldnt randomly stop working for that reason
@earnest phoenix
log your token
🙃
Breakpoint on that line or log to see what your token is. Make sure it's correct.
If it's empty, you're setting it incorrectly. If it's there, you messed up somewhere else
Hello Devs
So I have a new system which is a premium feature system, where people purchase my premium using patreon and it gives them the role
But I have a problem with it
I usually use this as my command where if someone doesn't have premium role on my server, it will return
.setTitle('Premium Error')
.setDescription("This command can only be accessible in the Attitude Support Server.")
.setColor(colors.cyan)
.setFooter(`Created by HamoodiHajjiri#3886!`, bot.user.displayAvatarURL())
.setTimestamp();
if(message.guild.id != "721372685275234436") return message.channel.send(embedPErrorOne)
let embedPErrorTwo = new Discord.MessageEmbed()
.setTitle('Premium Error')
.setDescription("It looks like you cannot access this command because you don't have premium. If you are willing to purchase premium, click [here](https://www.patreon.com/join/attitudepremium).")
.setColor(colors.cyan)
.setFooter(`Created by HamoodiHajjiri#3886!`, bot.user.displayAvatarURL())
.setTimestamp();
if(message.guild.id = "721372685275234436"){
if(!message.member.roles.cache.has("736643325863395331")){
return message.channel.send(embedPErrorTwo)
}
}```
But when someone uses the premium command on another server, it will start saying cannot read property 'id' of null
or something like that
-botinfo @velvet cypress
Uhm,
Wait where is bot commands?
what line is the error happening on
I added if(message.guild.id != "721372685275234436") return message.channel.send(embedPErrorOne)
what line is the error happening on
@solemn latch I explained above, re-read
🤔 i dont see where you say what line the error happens on
There are a few problems with the code Hamood. First off, are you ignoring DM messages? If a user tries the command in DMs message.guild will be null and it will error. Also, in the second if statement, you are assigning message.guild.id = "721372685275234436", not comparing the IDs (===)
Oh
So what do I do, do I compare?
do I add ===? and remove the if(message.guild.id != "721372685275234436") return message.channel.send(embedPErrorOne)???
Yes but I don't think the error is coming from there, but it is a problem
Let me explain deep
My bot's premium commands wont work if it was on another server, so I added if(message.guild.id != "721372685275234436") return message.channel.send(embedPErrorOne) to stop the problem for now
The general logic is kinda confusing, you should do:
if (message.channel.type === "dm") return; // Ignores DMs
if(message.guild.id != "721372685275234436") {
// This code will execute if the server isn't "Attitude Support Server"
} else {
// This code will execute if it is in the Attitude Support Server
}
Hm..
Okay, can I test it and come back?
And No, my bot never answers dms.
And you missed a part above @cinder patio , its that if the user does not have the premium role, he wont be able to access the command.
suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuup
uhok
well I just included the code you showed us
Google, can you go dms?
I can't if you have any further questions ask them here
I did understand you, and if you use the code snippet I gave you there should be no more errors.
so right now my dashboard gets all of the guilds but i just want to get the ones that the user is in, not everything on the db
Ignore DM messages and compare the IDs instead of reassigning message.guild.id
Dice, if you are using oauth2 to autherize the user you can request all the guilds they're in
Hey, So I have a new system which is a premium feature system, where people purchase my premium using patreon and it gives them the Premium Role.
But I have a problem with it, when someone has the premium role and uses the command outside of the Attitude Support server, it will run an error stating cannot read property 'id' of null
I didn't know what to do, so I decided to put a solution for now and ask the solution for it later, I putted this solution for now,
if(!message.member.roles.cache.has("736643325863395331")){
return message.channel.send(embedPErrorTwo)
}
}```
My question is, someone has premium role on my support server, and when he uses the command outside the support server, it will error, how to fix?
ikr
Okay... then do that
whatever I try to do on my vps
google lemme explain more
how i can do the command skip in 12v?
it just says
EROFS: read-only file system, open '/root/.pm2/pm2.log'
what line is the error happening @feral aspen
oh hey woo
I upgraded my plan and then this happened ^
what line is the error happening @feral aspen
@solemn latch no line @solemn latch
its general
It just errors when someone has premium role on my support server, and when he uses the command outside the support server
I'm logged in as @rooton my vps (ubuntu) and i seem to lack permissions somehow
srry for ping
okay i have a mongoose database that stores guild settings. i want to list all the guilds a user is in with the prefix next to them. i have managed to do this for every guild on the DB, but i want to somehow filter out the guilds that the user isnt in
can somebody help me
you have the user.guilds via oauth right @pure lion ?
you can ask for vps host for help @earnest phoenix
every vps host does things slightly differently
Whats the solution, what should I add or remove?
i need to grand the root user all the permissions but dont know how to do so
that seems to be the problem
user.guilds.forEach
and the foreach push each guild into an array, after grabbing the data you need.
any null, just ignore
how ignore null? thats what i was doing in the first place too lmao
fuck if i seriously wasted my day on this
and if this works
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
if(thingthatwouldbenull){ code that executes if its not null }
ok expicsc
you might need to if(variable != null) it
or if(!variable) { }
if variable is not null works as well
it can't be comapred
this is more complex than originally anticipated
oh no
what happens if you
if(null){}
I make my bot with visual studio code and everytime i close it, the bot goes offline
is there any way to fix this
guilds.forEach(g => {
if (await Guild.findOne({guildID:g.id}) !== null) console.log
})
ehhh?
yes buy a vps @hardy steeple
bots require servers to run 24/7
okay
they don't cost much
https://galaxygate.net/hosting/vps/ is 3$/month
GalaxyGate Hosting
and its powerful, up to about 2.5k servers
ill think about it
thank you for telling me though
makes sense
@solemn latch is the thing i put valid?
i believe so
ok ill check brb
is there a way to store arguments in .json files, the bot im planning will only be in 1 server
store arguments from run commands?
generally speaking, json databases are terrible and should be avoided.
a proper database would be a bunch more reliable
ok so i did nothing but restart my bot, it comes online and starts the on_ready function but won't respond to any commands now
get like a mongo
if it's actually null, wouldn't it throw a null exception?
yeh but still it's only for 1 server
JSON BAD (for database)
Its okay if you have an SSD tho
jeremu shut u-
if you dont care about the data at all, and dont mind the occasional data corruption, sure you can use a json db
ok
I just serialize a repository
USE MONGOOSE DIPSHIT
But I can swap it out EZ if I migrate
js is about to kill me
or any database
@honest perch switch to dpy, serenity, or rust
so much better than js
databases are cool and all, but i wouldn't spend so much time on 1 server
public static class Factory
{
public static IUserRecordsContext GetUserRecordsContext()
{
return new JsonUserRecordsContext(GetLogger());
}
I tried to setup a database, the password wouldn't register :DDD
i mean
Omg I'm so smart I made a big brain move
its apt-get install redis and then nohup redis-server &
Nvm it doesn't work
is discord.js a bad program to code a bot
nah, lots of bots use it.
it just caches too much
I use Discord.NET cuz I'm a C# fanboi
ok thats what i thought
In terms of performance, it's not the best
hi shiv <3
discord.net is a trashy lib
what would you say is the best
def would recommend c# though 👀
It's not the best, but it gives me enough data to do my own code
personally i like js more because im just more familiar with it
which i now realize is a bad reason
ima take a look at rust because js is going to kill me
or aegis.cpp
It's slower than C#, but meh JS for discord bots has a bigger community
disqord is my current favourite due to performance advantages, dsp allows you to be more open with your code (since discord.net only allows entity related methods on instance of entities instead of allowing you to just use the id)
so i suggest you definitely check those libs out
discord.py and eris are the best <3333
I'm not using the entity framework
Although I might when I migrate to SQL or something
what language should one learn
guilds.forEach(g => {
if (await Guild.findOne({guildID:g.id}) !== null) console.log
})
it was literally working the first time i did it but now i get this error:
if (await Guild.findOne({guildID:g.id}) !== null) console.log
^^^^^
SyntaxError: Unexpected identifier
what languages do eris and discord.py use
eris is js
python? lol
yeah i didnt mean ef entities, i meant like the actual discord entities
no i
Oh, do you mean, @earnest phoenix
//
// Summary:
// Gets the Discord.WebSocket.SocketGuild that the command is executed in.
public SocketGuild Guild { get; }
//
// Summary:
// Gets the Discord.WebSocket.ISocketMessageChannel that the command is executed
// in.
public ISocketMessageChannel Channel { get; }
//
// Summary:
// Gets the Discord.WebSocket.SocketUser who executed the command.
public SocketUser User { get; }
//
// Summary:
// Gets the Discord.WebSocket.SocketUserMessage that the command is interpreted
// from.
public SocketUserMessage Message { get; }```
as of right now the current bot i have works with discord.js
I feel the framework gives me plenty of data
its more than one ID being pushed through less but still more than one IDs, some match and some dont
i might go risky and use eris to make a higher quality one, thougj
so ye idk what to do
eris is risky?
no
wdym
im just saying im really busy and itd take a while
yeah those, for example if you want to send a message to a user you need to have the actual user entity so you can call SendMessageAsync
dsp and disqord straight up allow you to SendMessageAsync on the client and it takes in an id as the parameter
i remember forEach is a bit weird with promises @pure lion
for loops 😛
it worked the first time w t f f f f f f
eris is great ive seen it in action
how would one use promise all
i know im just saying it would take quite a while to migrate
@crystal socket do you know if discord.js has a bulk reaction method
i dont think so
promise.all does an array of promises at once
.then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then() @earnest phoenix
which that becomes a pain in the longrun because for something that could be a single REST request you would be making two, one to get the entity and the other to actually do what you want with it, Auger
so you could create each db promise, then do them all at once
@earnest phoenix consult the discord.js help server
which i do not have a invite server cause i'm not in it
i know im just saying it would take quite a while to migrate
@hardy steeple to a vps?
.then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then() @earnest phoenix
@pure lion This wouldnt work first of all, and second that's not bulk
it would take 5 minutes
one*
d.js to eris
yeah
order doesnt matter here does it?
my bot is coded to the standard of d.js and id have to change it to the way eris accepts commands and code which would take a while
wdym fluffy?
in under a second like some bots do
what?
if print(5).then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().return(True): print(6)
use a proxy to bypass some stuff
.then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then()
what?
????
yes
ok
:)))))
???
How the heck can I get the animated emoji ID without nitro? or if I can't is there a way the bot can use the emoji without the ID?
WHO DID THIS 😂
right click on the emji
inspect element @opaque seal
click copy link
95% of the people on this server make my brain hurt
get the id from the link
:/
I tried @earnest phoenix seems like they fixed it
we should make a channel where there are no white names.
^
we should make a channel where there are no white names.
and no me
but i am not your casual whitename
thats not gonna change anything
cause i mean #memes-and-media has been infiltrated by trolls
so 90000 of the idiots here cant see it lol
look up my message history
anyways
JSON BAD
oof
Found the ID I'm just a retard sometimes
???
:(
am i an average whitename? 😳
yes
no
no
oh UHH
qt for definite
a average white name pings atmods for bot verification
development gang
speaking of
oh
gang gang
no
>:c
if (await Guild.findOne({guildID:g.id}) !== null) console.log
^^^^^
SyntaxError: Unexpected identifier
this one omfg i just opened the windows app store kill me
oh thats exactly what i wanted
so you could push each promise into the array, Promise.all().then()
uh i know

lmao
let a = []
guilds.forEach(g => {
a.push(await Guild.findOne({guildID:g.id}))
})
Promise.all(a).then(john => console.log(john));
yeah, i think thats what you want
sickk
you might have to do some logic to get rid of null results
@earnest phoenix discord.net has:
discordClient.GetGuild("guildId").GetTextChannel("channelId").SendMessageAsync("Hello World")
compact
a.push(await Guild.findOne({guildID:g.id}))
^^^^^
SyntaxError: missing ) after argument list
h m
you might not need the await
Extra )
since your promise.alling
You need the await, just await the function bruh
e?
what? you dont await a push, he's awaiting what he's pushing
a.push((await <function>))
@earnest phoenix discord.net has:
discordClient.GetGuild("guildId").GetTextChannel("channelId").SendMessageAsync("Hello World")
@faint prism
yeah that's just pulling from cache thought
though*
How do I make it, so where I can replace the 1 2 and 3 numbers of this? idk how
let i = 0;
let page = 1;
let pages = Math.ceil(leaderBoard.length / 10);
if (args[0] && !isNaN(args[0])) {
page += Number(args[0]);
if (page > pages) {
i = (pages - 1) * 10;
page = pages;
} else {
i = (pages - 1) * 10 - 1;
pages -= 1;
}
}
async function call(u) {
let m = await message.guild.members.cache.get(u.userID);
if (!m) m = u.username;
else m = m.displayName;
let level = u.level;
let j = 0;
let xpInLevels = 0;
if (level >= 1) {
do {
let multiplier = j * 1.25;
if (multiplier === 0) multiplier = 1;
let xp = 150 * multiplier;
xpInLevels = parseInt(xpInLevels) + parseInt(xp);
j++;
} while (j + 1 <= level);
}```
It probably queries the API on the connection thread
>> 149| <%-JSON.stringify(userGuilds)%>
150| <script>
151| window.onload = () => {
152| const fragment = new URLSearchParams(window.location.hash.slice(1));
Converting circular structure to JSON
--> starting at object with constructor 'NativeTopology'
| property 's' -> object with constructor 'Object'
| property 'sessionPool' -> object with constructor 'ServerSessionPool'
--- property 'topology' closes the circle
``` FUCK
@sweet ruin From which part and what are you exactly trying to do there
anything that interacts with the API is granted to be asynchronous and a task
Im trying to replace i (not j). so pretty much I works perfectly right now. but I want to make the 1, 2, and 3 slots to be 🥇 🥈 and 🥉
So i is the 1 2 3 or what
i ranks people based off their xp
i want first second and third place to have the medals
but i dont know how to pull just those
@earnest phoenix
a.push(async () => await Guild.findOne({guildID:g.id}))
modern solutions require modern problems
welp this is what it spat out
[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]
console:
[
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
[AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction]
]
i think you can just put in the promises, no await or anything
@sweet ruin i meant what does output the 1 2 and 3? Does i do that?
ok
arr[i] != null ? WriteLine($"You're looking for {i}") : WriteLine("My god... It's all null");```
@solemn latch same cirular error
@sweet ruin that might need a switch case before that
let ranks;
switch(++i){
case 1:
ranks = "🥇";
break;
case 2:
ranks = "🥈";
break;
case 3:
ranks = "🥉";
break;
default:
ranks = `#${++i}`;
}``` and then you can use `ranks` instead of `**${'#' + ++i}`
@pure lion a.push((await Guild.findOne({guildID:g.id}))) should work if the function is async
but if the function isnt async you simply cannot await it unless you want to use .then, which isn't the same thing
I got no idea how tf it skipped 4
if print(5).then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().return(True): print(6)
@crystal socket dont u have to resolve each of those then?
Doesn't even make sense
why await when using promise.all?
then(variable => something)
i don't know js stop bullying me

("b" + "a" + + "a").toLowerCase()
baNaNa
god tier programming
Idk how does that make sense lmao
Nice
Tysm ❤️
it logs da shit but theres still a tonne of null
let promise = Promise.all(a);
(await promise).forEach(p => { if (p) console.log; else return })
so i tried this and it logged nothing
.format is very useful to multi-language
nerd
chr(10).join for f-strings because yes
anyone know how to send a message to a channel via channel ID? I can't seem to get it to work.
Here is what I am currently doing;
bot.get_channel("actual id").send(msg)
My error message is AttributeError: 'NoneType' object has no attribute 'send'
channel should be a int not string
and it should be awaited
heres the final code
await bot.get_channel(12345).send(msg)
I've tried both of those, same error
I forgot to put await in the original
And yes, the channel doesn't need perms
well then try ```python
await bot.get_channel(12345).send(msg)
It can respond in the channel if I call it via command, but I can't get it to log into one single channel if I call it from a different channel. And I have.
are you getting the same error message?
yes.
and the bot is on the server?
can you triple check the channel ID
you can do this by doing "<#" + the channel id + ">"
make sure its the right id
Yeah. I just fixed it by changing some of the code around, looks like one of my variables was screwing it up. Sorry for the bother, and thanks for the help.
np!
same lol
should anybody want to make a discord bot (discord.py) together, shoot me a message, i currently have one in ~5k servers
No
Do you know C#? @restive willow
https://pastebin.com/7CNDrZG7 that is the code here is the error
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module 'ms'
Anyone know why this might be happening?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Have you installed ms
i think so but maybe not lol
Then install it
Okay i found the problem thanks
can someone help me make a prefix changer in discord.py
@bot.command(pass_context=True, hidden=True)
async def setprefix(ctx, *, nprefix):
nprefix = nprefix.strip()
if nprefix != "":
try:
prefix = nprefix
await commands.Bot(command_prefix=prefix)
except:
await bot.say("Cant Change ...")
else:
await bot.say("New prefix : **{}**".format(prefix))
doesnt seem to work
i have already
Show
oke 1 min
What's prefix
and you need a function that relies on a global dictionary
where key is server ID and value is the prefix for the server
I need help with discord.js how do i know if its installed i use a chromebook and i know tis avalable on linux
if its in your package.json and in the node_modules folder, then its installed
well it is in the node_modules column
I recognize that chrome text editor
I use a chromebook............
I dont have that much expirience
You can install VSCode
i just need whatever software that is compatible with linux to use to make my bot work
I host my bot on an ubuntu server
any JS should work with linux, and Dotnet Core also does too
and java
how do ik if js is downloaded tho
yes
And to that I say, NodeJS probably
to run a Discord bot, yeah
i went through he*l trying to download that
Some JS dev correct me if I'm wrong, but
- download https://nodejs.org/en/
- read some docs on how to make a js project and run it
Alternatively, if you want dotnet core and to write in C# language, you will need other stuff
i have a folder named Node_modules
Actually
I just learned about some cool service for JS discord bot devs
Make an account here, and try to do your project there. They will actually HOST your bot for free
So you won't have to worry about VPS or dedicated servers for a while
Lucky js devs... bah humbug
oh it costs money!?
You cant host bots on glitch really
I host mine on a pi 3
what
Fire will come upon this channel soon
you can't?
You can, but you shouldn't
does it cost money in any kind of way to host a bot?
It goes offline after 5 minutes
damnnn
@queen marsh yes
@queen marsh if you pay someone else to host it for you, yes
It's "free" if you host it yourself @queen marsh
It's a program you have to leave open
Host it yourself
what programm
If you host it yourself on a Raspberry pi, you pay the price of the pi upfront (as low as £9.80) and then 5£ a year in electricity fees
the bot program
Maybe i need to slow down my bot hasnt even got approved yet
Furthermore your Raspberry pi is a full on computer not just. A bot
@halcyon crow Did you just assume I'd run my bot on a pi zero...
I said as low as @faint prism lol
I mean minimum price to self host
is it a one time payment or subsription
Just host yourself at first
It’s a mini computer
You literally buy a mini computer board called a Raspberry pi
And then run your script on that 24/7
You can just have it running on your laptop. And anyone can use it until you close the program or turn off your laptop
I dont know how to host it myself thays why im here i have expirience but not much
Speaking of Raspberry pi, i'm hosting my bot on one and it recently it just won't connect to the Discord bot itself. Commands work but everything in the on_ready function won't load. The exact same code works on my PC and was working yesterday
I don’t use the discord.ext module because of that
Look into docker containers maybe for a baseline environment @cloud pebble
I kept having issues
docker containers are going a bit over my head 😅
@queen marsh in order to run your bot 24/7, you need a computer. You can pay someone to run your bot on their computer, basically renting their computer. This is called a VPS and it’s a subscription. Alternatively you can host it yourself, by buying that ‘computer’ yourself. This is a Raspberry Pi. A cheap, lightweight computer which can run your script 24/7 from inside your house costing no more than the upfront cost buying it and electricity fees which is like $5 a year.
Ya it’s chill we all start somewhere
How do I add an image to this embed
{
title: 'Bibi Shop',
description: 'Welcome to the Bibi Shop!\n\nFeel free to browse around :)',
color: '0xd305fa',
image: {
url: `attachment://${attachment.name}`,
},
footer: {
text: `Page 1/${pageMax}`,
},
},
{
const attachment = new Discord.MessageAttachment(image.toBuffer());
I am using canvas construcotr to render
Without knowing anything
@queen marsh This is an example of running the bot yourself
ok
this ^ tbh
@weak parrot will happily tell you why
Watch some JS tutorials
I would also say learn basic programming before making a bot
But it doesn’t have to be really advanced
Sowwy for tag timo
i dont want a super fancy advanced bot
my bot file got corrupted but i brought it back and re added it to top.gg
so that was an experience
@quartz kindle will happily tell you why you should learn a language first @queen marsh
i know not to make a bot when i dont know what im doing, i thought it would be simple as i had a goal of creating a super simple bot with only 5 commands.
for personal use in my server
use discord.js
You can do that without learning programming tbh
yeah
?
@halcyon crow don't give stupid advice
@honest perch if he wants 5 simple commands such as !say arg, then bot says it back I hardly think it’s efficient for him to learn js
He can just look at a similar bot and change the stuff around that he wants
He won't "figure it out". He will just copy paste code not knowing what he is doing, then coming back and asking how to debug simple code
^
Its important to learn the language before doing bots, even if its simple
,...
Maybe you’re right yeah
I’m not sure I haven’t thought about it much
I do think that if you have an ambitious project it’s most efficient to learn the language first but if your end goal is 5 commands then it’s not necessary. There are literally programs to make bots that don’t involve any programming at all
6 commands
@zenith terrace n o
@minor kelp turkish ?
This guy doesn’t want to learn to create a bot, or to program from what I have heard, he just wants to make his bot and use it. @honest perch
o god, thats worse
So telling him to learn programming is not beneficial
If he doesn't want to program it, tell him to use botghost or something
What’s that?
what is botghost
can you put an emoji in your bot's status?
I've heard of it but what does it do and how is it gonna help me
does
message.reply(blahblah);
not the thing you use for having it ping the command user and then saying the text given?
@queen marsh it's basically a third party that creates a bot for you aka you don't really have to code the bot
and it hosts the bot for you
@bright dove message.channel.send(message)
ok im using botghost then
Wow that sounds like what ya want moddrn!
that's to send a message, not to have it ping the user
disappointing
yes
i really hope my bot is online when the devs test it
or else ill have to wait another 3 weeks
or more
which wouldnt be ideal
i applied like a month or two ago
and i didn't think they'd review mine that quick
and it was before i had hosting
now i have hosting and i have to apply again
@bright dove message.channel.send(‘blah blah {}’.format(message.author.mention))
fstrings >>>
@bright dove
but I've used message.reply(); before and it worked
it's just not now
and I don't know why
message.channel.send(`blah blah ${message.author}`)
try this ^
do message.channel.send('blah blah')
Message reply tags the user
@honest perch exactly
yeajh
channel.send doesn’t
message.channel.send works tho
so use message.channel
if you attach it too a prompt
-_-
yeah
but for whatever reason it's not working
...why
Bruh
same result
yeah
so use message.channel.send('message')
Just use channel send ffs
There is no difference except from a pong
@bright dove are you using the disableMentions option?
Stackoverflow.com guy is typing
I don't know what that means so I guess not
@restive willow oh... wow. That is beautiful how did I not know that
then it should work
@restive willow oh... wow. That is beautiful how did I not know that
@halcyon crow what
lol
@restive willow fstrings
Tim literally has the entirety stackoverflow programmed into his brain its kinda funny
true
fstrings are the love of my life
I have my bot check if a user's ID matches anyone in the Admin db. Then I can do extra stuff, but not just anyone
too bad I can't do eval in C#
OH
apparently it takes 3 weeks for a bot to be noticed or more
no it doesnt
But it's probably best since I'd be afraid it'd go from an eval into RCE
mine took jsut over 3 weeks but its well wroth it
Why u tagging someone in a dm anyway @bright dove
generally dms arent a good thing to rely on because they can be used in harmful ways sometimes
Why u tagging someone in a dm anyway @bright dove
@halcyon crow error for when command no worky
and your bot can be disapproved for dm harm




