#development
1 messages ยท Page 1444 of 1
So if you say "help" the bot will answer with their help message ?
idk about that my guy
you should atleast make a help command with a prefix
The bot is gonna get declined if there is no help command
help me?
yea nah thats gonna get declined
Yep
prefix with help.
because
if Anyone
ever says
"help me"
that will trigger the bot
not what you want, not what users want
if you do that the bot will start responding to someone who don;t need the bot's help
^
its annoying if you do that
bad plan
A really bad plan
imagine saying help me for a certain subject, then getting respond from a bot with the help page
its annoying af
Althougth the bot gets aproved that people who uses the bot gonna present reports about that feature (?
My english is not perfect sorry if there is any grammar issues
prefixes are made so that the bot will ignore the messages without a prefix, because it means that the message is not for the bot to process
your bot is really going to be listening to every message for "Help me"
dude come on
just put a prefix
that's bad
bad
bad
bad
no
FIRST OF ALL, YOU DON'T DO A COMMAND CASE-SENSITIVE
Ya
SECOND, YOU SHOULD ADD A PREFIX SO THE BOT WILL NOT RESPOND TO EVERY MESSAGE
is your caps key stuck
if you want a chatbot
i believe
2 options, that or he's triggered.
triggered
ok you know how clever only responds to people in a certain channel or any others
that is what you will want
fOR EXAMPLE I NEED HELP WITH A MATH PROBLEM. i AM GOING TO SAY hELP mE. tHE BOT WILL RESPOND AND THAT'S NOT WHAT i WANTED
ayo relax
tf?
Use a command for that chatbot, cause the bot will repond to every message
if its in a dedicated channel it can respond to every message
thats a simple check if the channel is not <id> return None
yes that can also work
or limit the bot's channels
that sounds like still avoiding a prefix
Yep
if (message.channel.name.toLowerCase() !== "chatbot") return;
there
any channel that is not renamed to chatbot the bot will not respond
ya happy now?
Yes
and also take note that if it is the next line
it wont go through
it needs to be the same line
for it to return
Why it return false?
```
function checkDied(userId) {
let ins = games.find((g) => g.userId == userId);
console.log("Function: checkDied" + ins.userId);
let head = [...ins.game.snake[0]];
let body = [...ins.game.snake];
body.shift();
if (
body.some((a) => head.every((v, i) => v === a[i])) &&
ins.game.heading != "stop"
) {
console.log("Overlap");
let index = games.indexOf(ins);
games.splice(index, 1);
return true;
}
head.forEach((x) => {
if (x < defaultX && x > 0) return false
console.log("Border");
let index = games.indexOf(ins);
games.splice(index, 1);
return true;
});
return false;
}
```let checks = checkDied(123456);
console.log(checks);
3rd
turn off caps
smh the return false made it faster than the return true
why are there like 900 ways to say false in js
wot?
Oh wait
- syntax error *
It should return true and not ahead to the return false
Wut
mi confused
you summon me
I mean it should return and not execute that return false;
you help me
@carmine summit what is it supposed to be
then the condition in the if statement returned false so it didn't execute and return true
I think it's perfectly acceptable to
is that an arrow function inside a single statement arrow function i see
wdym?
huh?
What time is it in America?
@earnest phoenix Border
Ask google for the america's time
thats what it outputs
@gilded plank
@carmine summit i meant the stuff inside the parenthesis of the if statement not the curly brackets
There are multiple timezones in America. For example, it's 1 AM here.
damn im 1 hour ahead of you
Damn im 1 hour ahead of you
It's 03:14 AM here.

if it's 1 a.m., Why Are you still on Discord??
why not
Damn I'm 10:45 hours ahead of you @sudden geyser
sometimes you want to program yet there's not enough time in the day
days should be x2 longer
speed ๐ง
Are you from china or any asiatic country?
it also means we get to spend twice as much time in this cursed year
don't you have live classes in the morning?
Me too
who goes to those
once i submit the assignments im good to go
i went to one once, and the whole time the teahcer was just explaining what would be a on a google forms
like google exists
Lol
syntax error
over here we show up every other day from 8 to 12 (sometimes 11)
then continue from 1 to 3 at home
function checkDied(userId) {
let ins = games.find((g) => g.userId == userId);
console.log("Function: checkDied" + ins.userId);
let head = [...ins.game.snake[0]];
let body = [...ins.game.snake];
body.shift();
if (
body.some((a) => head.every((v, i) => v === a[i])) &&
ins.game.heading != "stop"
) {
console.log("Overlap");
let index = games.indexOf(ins);
games.splice(index, 1);
return true;
}
head.forEach((x) => {
if (x < defaultX && x > 0) return;
console.log("Border");
let index = games.indexOf(ins);
games.splice(index, 1);
return true;
});
return false;
console.log(ins.userId);
}
```updated it but it still returns false
Did you try "else" after that if?
head.forEach takes a function that is getting ended by the return keyword
the parent function is not ended
Nvm
um
so I store head.forEach()
using let
and then if it is true
return true
im a genius
wait no I don't get it
Someone need help?
@earnest phoenix help
why it returns false instead of true
In the codeblock above?
@carmine summit 123456 is invalid as a user ID, it's usually a string and a user ID assuming that's what g.userId's comparing to
Well that's why it's returning false
Then use a real game and show me what happens when you die
not a string of number that is hardcoded
Yes I know
an error pops
Show
ins is a user ID
after the checkDied
At let ins, console log ins
Also you can just do delete games.indexOf(ins);
Do that
[
{
userId: '487511010886942720',
messageId: '786844287794413588',
channelId: '780708958829936663',
pause: false,
game: { heading: 'left', snakeLength: 5, food: [Array], snake: [Array] },
map: [
"map."
]
}
]
because
- Yes
- I don't know how those work
Did it work?
wdym did it work?

It is
games is an array
games is an array.
As you can see, it's an array
Then send me ins
then there should be no issue
console log Object.keys(ins)
function checkDied(userId) {
let ins = games.find((g) => g.userId == userId);
console.log("Function: checkDied" + ins.userId);
let head = [...ins.game.snake[0]];
let body = [...ins.game.snake];
body.shift();
if (
body.some((a) => head.every((v, i) => v === a[i])) &&
ins.game.heading != "stop"
) {
console.log("Overlap");
let index = games.indexOf(ins);
games.splice(index, 1);
return true;
}
head.forEach((x) => {
if (x < defaultX && x > 0) return false;
console.log("Border");
let index = games.indexOf(ins);
games.splice(index, 1);
return true;
});
return false;
}
let checks = checkDied(ins.userId);
console.log(checks);
if (checks) return console.log("Died");
yes
And it logged?
yes
Show
["userId", "channeId", "messageId", "pause", "game", "map"]
what is the problem
Idiocy most probably
It should return true
Maybe your overlap logic is wrong
hey
bye
buzy
hey someone knows how to turn it back to on?..
make a support ticket
Does anybody know what this error could be caused by other than the connection being refused
It just randomly started happening recently
I would like to make everything typed after the command to be only 1 string and split it by myself, is that possible (python)? Or do someone have an easy way to get c=gol um n>=10 into a first argument that would be c=gol um and another one that would be n>=10
Is it a prohibited command to delete all channels on the server and quickly create new channels in their place?
Why can't I use ContextException?
Error:(68, 23) java: exception net.dv8tion.jda.api.exceptions.ContextException is never thrown in body of corresponding try statement
try {
event.getGuild().unban(event.getMessage().getContentRaw().substring(8)).queue();
} catch(ContextException e) { //This line gives me the error
return;
}
java
And how do I check if the ban is valid...
@obtuse jolt That happens if you pass anything other than a function to the second parameter on binding an event
how can i add emoji in my bot command
<:name:emoji_id>
how to get emoji id

post emoji., right click, copy link, paste it and copy numeric id before .gif / .png
or... escape it
what that means ?
I want user to. provide a api key
for eg
const s = require('s')
const api = new s.api("")
Uhh, then require it?
if i wanna add multiple roles to a user, do i have to parse an array of role ids in the member.roles.add function? just wanna make sure
class API {
constructor(key) {
if (key === null || typeof key === "undefined") throw new TypeError("An API key is required.");
this._key = key;
}
// Whatever here
}
module.exports = {
api: API
};```
You can pass in an array of RoleResolvable, which can be a role ID or role object
ok
second question: i have an aray with roles id, and i wanna remove the IDs that are not role IDs. I tried this, but it doesn't work. I forgot how to work with forEach 
Need to update bot to v12?
yes
roles.filter(r => <Guild>.roles.cache.has(r))```
@earnest phoenix help
i accidentally turn it off, and i can't enable that, someone can help me?
i told you already to make a support ticket
i did
so... wait
but they doesnt help
how much time?
5 days?
however long it takes
be patient
ok thank u
help me
i dont know what problem i am doing
what u trying to do?
in this website
my text is automatticaly under lined
pls inspect and check what i am doing wrong
set the text decoration to none
something with that @earnest phoenix
@earnest phoenix will it remove font style too ?
i do ctrl u
probably and than see
I dont want to remove font style..
<input type="checkbox" id="click">
try remove that
huh
You're using Glitch so I don't see how you can't just edit it and try
what are you talking about lol
s
it's underlined because it's an anchor element
what ?
setting text decoration to none removes default text decoration
I do not speak English much. I am Turkish.
but where did i ask
you have translators if you don't understand english
@earnest phoenix i set it to none still its ul
did you set it on your anchor element or on your div

i know just basics about html and css
ok?
can u pls visit and inspect what i am doing wrong
i told you what you need to do
i did that
well you didn't if it doesn't work
inspect n see
no
Where can i test my bor here?
you can't
Ok
@earnest phoenix pls help
๐ฆ
i told you what you need to do
i did that
i told you
lol
but you dont trust me

you didn't do it if it doesn't work
otherwise if you did it properly, it would work
@earnest phoenix
text-decoration: none;
that's not set on an anchor element
that's a nav element
...okay?
Hey, fuck you Python!
that css is still not being applied to an anchor element, your element nesting does not matter
Yes fuck you python
File "sorting_algorithms.py", line 20, in shell_sort
for i in range(gap, n):
TypeError: 'float' object cannot be interpreted as an integer
n = len(arr)
gap = int(n / 2)
while gap > 0:
for i in range(gap, n):
if you don't understand what an anchor element is, in just 680 milliseconds you get 269 million results about it
whats this error? discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientOSError: [Errno 32] Broken pipe py
there are problems with the plumbing
get a plumber to fix the broken pipes
Python is a fucking joke
n = int(len(arr))
gap = int(n / 2)
while gap > 0:
for i in range(gap, n):
n = len(arr)
gap = n / 2
while gap > 0:
for i in range(int(gap), int(n)):
What's the damn difference here
why does one work and the other doesn't 
Oh dear lord
Nah, the cause was gap /= 2 at the end of the loop which turned gap into float
[78, 70, 19, 50, 35, 96, 87, 55, 81, 78]
that looks very sorted
Hello! I am very new to discord.js
In VSC,how can we rename a file?
I mean, it shows untitled 1
I wanna rename it to index.js
HLP
right click the file and then choose rename
.addField(`Users`, `${users}`, true)
Not accurate
My bot have 45k users but is showing only 72

they're not in cache
What
what what
But this work
Past
i know it works
discord changed it
Why today is not work
This showing online users?
before the change:
client.users.cache -> online users
after the change:
client.users.cache -> only voice channel users
after the change with "presences" enabled in your dev portal:
client.users.cache -> online users
``` console.log(Ready on ${client.guilds.cache.size} servers, for a total of ${client.users.cache.size} users);
Same here showing wrong users
before and after the change:
guild.memberCount -> ALL members, including offlines
no
size*
client.guilds.cache.reduce((total, guild) => total + guild.memberCount, 0)
Including this $
?
${client.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()}
Try this
Hello Tim
Yah work it thx bro โค๏ธ
๐
the returns inside the forEach are not doing anything
they return the x => {} function
not the outer function
well then it'd have to take an arg acceping a string
@bot.command()
async def say(ctx, msg: str = None):
await ctx.message.delete()
await ctx.send(msg)```
that's it
Why would you use a default value here
@quartz kindle should I use writeFile() with a callback or writeFileSync()?
how can i add this thing in my website
@crimson vapor i am making it longer but when height of device changes, text start to hide behind nav bar
you didnt structure your website correctly then
idk that much about css but I think you use margin-bottom
um
what the fuck is that
depends
browserling
for my use case?
thats my web
if you have a code that you want to run while it's writing, use writeFile()
using writeFile will let your code continue to run while the file is writing, but it wont allow you to write to the same file at the same time, so you have to manage that possibility
using writeFileSync will stop your entire process until its done writing
hi... can anyone please help me integrate those 2 webhook edit and create with a fetch ?
webhook.edit({
name: 'Some-username',
avatar: 'https://i.imgur.com/wSTFkRM.png',
channel: '222197033908436994',
})
.then(webhook => console.log(`Edited webhook ${webhook}`))
.catch(console.error);
channel.createWebhook('Some-username', {
avatar: 'https://i.imgur.com/wSTFkRM.png',
})
.then(webhook => console.log(`Created webhook ${webhook}`))
.catch(console.error);
wut
fs.writeFile(this._tmpFilePath, data, (err) => {
if (err) throw 'An error occured when writing to the DB:\n' + err;
fs.renameSync(this._tmpFilePath, this._path);
});``` this should work fine right
is there any way for me to run code at the same time?
hmmm mixing sync
bruh
fine ill change
I can use sync on the constructor tho
because no reason to not
i use position tag and now everything is ok 
Is there a way to do a line break in Discord?
Works in embeds?
depends in which section of the embed
Field values
yup, it'll work
Kk
what can i use for graphs?
what the fuck
well yes u are
what are u trying to do?
not hard
image is not interpreted as setImage. what should I do.
(node:7748) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
embed.image.url: Could not interpret "{'type': 'Buffer', 'data': [137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 3, 232, 0, 0, 0, 200, 8, 6, 0, 0, 0, 123, 231, 203, 79, 0, 0, 0, 6, 98, 75, 71, 68, 0, 255, 0, 255, 0, 255, 160, 189, 167, 147, 0, 0, 32, 0, 73, 68, 65, 84, 120, 156, 236, 157, 117, 116, 20, 215, 251, 184, 159, 221, 200, 198, 221, 221, 61, 193, 157, 64, 113, 43, 208, 226, 214, 22, 40, 214, 210......
then what have href ?
getPalette(kullanฤฑcฤฑ.user.displayAvatarURL({
dynamic: false,
size: 1024,
format: 'png'
})).then((palette) => {
const embed = new MessageEmbed()
.setColor(autimatic)
.setAuthor('Palette', bot.user.displayAvatarURL({
dynamic: true,
format: 'png',
size: 512
}))
.setImage(palette)
.setTimestamp()
.setFooter(`${message.author.tag} | ยฉ ${bot.user.username}`, message.author.avatarURL({
dynamic: true
}))
message.channel.send(embed)
});
anchor tags
@earnest phoenix what is palette
@earnest phoenix that's JSON not a Buffer or URL
wdym ?
async function getPalette(kisi) {
let rgbParams = await ColorThief.getPalette(kullanฤฑcฤฑ.user.displayAvatarURL({
dynamic: false,
size: 1024,
format: 'png'
}), 10);
let ColorCanvasConstruct = canvas.createCanvas(100 * rgbParams.length, 200);
let ctx = ColorCanvasConstruct.getContext("2d");
function hexComponent(H) {
let hex = H.toString(16);
return hex.length === 1 ? "0" + hex : hex;
}
function rgbHexComponent(r, g, b) {
return "#" + hexComponent(r) + hexComponent(g) + hexComponent(b);
}
ctx.font = "20px NotoSans-Regular";
let goFurther = 0;
for (let i = 0; i < rgbParams.length; i++) {
ctx.fillStyle = rgbHexComponent(rgbParams[i][0], rgbParams[i][1], rgbParams[i][2]);
ctx.fillRect(goFurther, 0, 100, 200);
let saveStyle = ctx.fillStyle;
if (tinycolor(rgbHexComponent(rgbParams[i][0], rgbParams[i][1], rgbParams[i][2])).isDark() === true) {
ctx.fillStyle = "white";
} else {
ctx.fillStyle = "black";
}
ctx.textAlign = "center";
ctx.fillText(saveStyle, goFurther + 50, 30, 100, 30);
goFurther += 100;
}
return ctx.canvas.toBuffer();
}
@earnest phoenix you need to add the image as a message attachment then use the attachment URL in setImage
getPalette(kullanฤฑcฤฑ.user.displayAvatarURL({
dynamic: false,
size: 1024,
format: 'png'
})).then(palette => message.channel.send({
files: [{
attachment: palette,
name: "dosya.png"
}]
}));
?
saw this on the guide:
const file = new Discord.MessageAttachment('../assets/discordjs.png');
const exampleEmbed = {
title: 'Some title',
image: {
url: 'attachment://discordjs.png',
},
};
channel.send({ files: [file], embed: exampleEmbed });
one two three
try it and see
ok i'll try it
console.log("one two three");
it works!
throw "one two three"```
thx thx
doesn't work
@earnest phoenix
throw new String({ destination: "MILLION's face" });
haha take that piece of string in your face you little poop
lol
how do you set the footer text for an Embed object in discord.js
this is my embed as of now:
embed: {
title: cmd.name,
description: cmd.description,
fields: [
{
name: "Args",
value: cmd.args.replace(/</g, "**<").replace(/>/g, ">**")
},
{
name: "Aliases",
value: cmd.aliases || "None"
}
]
}
please forgive the absolutely horrible spacing it's discord's fault
{
footer: {
text: "hi"
}
}```
thanks
@earnest phoenix You still owe me an explaination
no i dont
How do I fix it?
C'mon
How do I make it to return to the main function?
what is the difference between module.exports and exports?
my command handler works with module.exports but not with exports smh
@earnest phoenix because commando uses Commonjs
why do people use forEach in the first place
it's so slow and it brings more cons than pros
exports is a reference to module.exports
So what's the best solution to this?
I'm using vanilla node.js
for()?
for (let filename of fs.readdirSync("./commands")) {
let data = require(`./commands/${filename}`);
bot.commands.set(data.name, data);
console.log(data);
}
ok so you use Common js also
my command files:
module.exports = {
name: "",
description: "",
args: "",
devOnly: false,
aliases: null
async execute(bot, message, args, command) {
}
}
not ES modules
its the same as doing this ```js
let me = {} // module.exports
let e = me // exports
e = "abc" // e becomes abc, me is still {}
?
but if you do exports.something = something, then it will work
for () ?
yes
so you can't set exports to be object directly but you can set individual properties for it
yes because its a reference
oh
ok
so if you add properties to exports, they will be reflected in module.exports as well
but if you assign a value to exports, you are replacing the reference with a different value without affecting module.exports
thank you timmy
Timmy should really get a custom role
I have the answer to my problem I've been dealing with 8hours ago just right under my nose.
yo @green kestrel im making graphs for my bot, can u send me a pic of yours so i can compare?
do i need to add class to anchor tag to use css ?
@earnest phoenix ^
yes
anything that you want to style with css needs to have an id / class / style attribute
ok
style should be avoided though it makes your code look like garbage
@drifting wedge i can do better than that: https://triviabot.co.uk/botstats/
feel free to poach html
btw you know the easter egg is on that page too
@earnest phoenix did i am doing something wrong ?
HTML - <a class="lo" href="/"><div class="logo"> <%- title %> </div></a>
CSS - nav lo .logo{ color: white; font-size: 35px; font-weight: 600; }
3.5 gigs
gigs
o ok lmao
split between 8 processes of about 450mb each
how did u split the proccesses?
lo is a class, not an element, you need a dot (in your css)
why do you guys hate inline styles so much
what if i want to set a specific style for one element only
and ID would be pointless for that
sure
@earnest phoenix thats a valid use for an inline style tbh
so feel free to ping me if u need help
it can be hard to see what has priority with inline styles though
@earnest phoenix this is wrong: nav lo .logo{ you want: a.lo div.logo {
huh
.lo .logo is also valid, but not as specific
@green kestrel from something we talked a bit ago, would you say programming is a like good job?
i didnt see that its in a <nav> element though
like progeramming related?
follow proper async/await pattern
@drifting wedge shift-F5, and then do the konami code on that graph page
I have a question as I am new to MongoDB. If I want to create a new way into storing data, do I just make a whole other type of model with a different name?
try {
await asyncmethod();
}
catch
{
//oh no what are we gonna do now
return;
}
//if your code got to here, it didn't fail
Example I have a model called economy, for economy commands, do I make a whole other model for like social commands (example)?
i already told you, you need to set text decoration to none on the anchor
can you do Collection[int] to get specific elements from a Collection by using their IDs or do I have to turn it to an array first
i mean what jobs pay well?
honestly programming is like top 5
so uh how is it using 300% of the CPU?
the max is 800
I don't even have a wallet I only do programming for fun
100 .... per cpu core
ohh
lmao
i did my hackerman stuff
youve photoshopped that, im looking at it right now 
nah
urs is wrong
edit element?
thats a realy cool page though
and now its melting the server
@earnest phoenix so.. what about this ? a { text-decoration: none; }
theres a ton of info there
yes, that'll work
because inspect element is serverside definitely
Brain does your bot really need to cache users and shit?
client side
nope ur wrong
Code :
@commands.command()
async def ticket(self, ctx):
name = f"ticket-{ctx.author.discriminator}"
guild = ctx.message.guild
await guild.create_text_channel(f'#{name}')
channel = self.client.get_channel(name)
await ctx.send(channel.id)
Error :
Command raised an exception: AttributeError: 'NoneType' object has no attribute 'id'
@drifting wedge sometimes that can climb up to 800%... it doesnt affect the bot performance
theres a library bug, which makes the library threads spin on reconnect to a shard
so it basically 'uses up the idle cpu time' with a busy loop
no not the channel the command was executed in
@earnest phoenix ah tysm.. its working
the channel that got created
restarting the cluster clears the stuck thread
u can only get channel thru id
timmy can i get some halp
but i dont do that unless theres some other reason
as i dont like to disrupt peoples games
how long does reboot take?
the channel you are creating does not match the name you are looking for
about 8 mins, but i dont ever do a full reboot unless i change the shard or cluster count
@green kestrel u should show how many active games
so?
i usually just reboot single clusters, that alone takes about 30 secs
also doesnt create_text_channel return the channel?
how do u reboot certain clusters?
like how did u split up
i do show how many active games, theres a graph for it
so obviously get_channel is going to return None because it did not find a channel
so you cannot get an id from a NoneType
ooh
@drifting wedge separate processes... each process has 4 shards on it, and is a cluster, and identifies for shard ids that are that cluster id mod max clusters
so what should it be
how do u run like specific shards on certain proccesses?
^ my main quest
question
@quartz kindle
@drifting wedge so you end up with this structure:
you do Collection.get(id)
if you look at the shard ids under each cluster, theyre all modulus of 8
wat
@commands.command()
async def ticket(self, ctx):
name = f"ticket-{ctx.author.discriminator}"
guild = ctx.message.guild
channel = await guild.create_text_channel(f'#{name}')
await ctx.send(channel.id)
@solemn elk i think this would work
doesn't that get a key that has the specific name
like for example
all 8 clusters share a common mysql database where they store information that is relavent to all of them, e.g. if i want to do a total user count or total game count
and not get the key based the index
it gets the value assigned to that key
i run my bot twice
isnt that the same
Collections are not sorted, they have no numeric indexes, no numbers
oof
either you get the value from they key, or you need to convert everything to an array
no, you are setting the channel equal to the new channel that is created so you dont have to use get_channel at all
ah ok
thats the table of shard statuses
ok
each cluster independently updates its rows there
then i can use an external cron job to update server counts for uptimerobot, bot lists, etc
like my question is how do u run only certain shards
and yes, exactly like that
like how can u say: in this instance, run only these shards
depends on your library i guess? in aegis, i had to code in support for that into the library
it only had support for all shards under one process at first
its c++ lol
the source is on github
u should release ur version
get_channel is returning none
you can do that with any library as long as the library supports it or if it supports a certain degree of customization. All you need to do is send the shard id and the total shard count on the identify packet, for example, total count 5 and shard id 0, will connect shard 0 out of [0,1,2,3,4]
also guild is just ctx.guild
after that it bootstraps itself, and is pretty much managed by a web interface that watches processes and queries that status table
He got repo access https://github.com/zeroxs/aegis.cpp
what's name
you also don't have to get the channel again
yes, master branch of aegis supports clustering
riht
I'm blind
Hey blind
basically as simple as this
aegis::core aegis_bot(aegis::create_bot_t()
.io_context(_io)
.file_logging(true)
.log_level(spdlog::level::trace)
.token(token)
.force_shard_count(dev ? 2 : from_string<uint32_t>(Bot::GetConfig("shardcount"), std::dec))
.intents(intents)
.clustering(clusterid, maxclusters)
.log_name(fmt::format("aegis-{}.log", clusterid))
);```
@commands.command()
async def ticket(self, ctx):
name = f"ticket-{ctx.author.discriminator}"
guild = ctx.guild
channel = await guild.create_text_channel(f'#{name}')
await ctx.send(channel.id)```
what its doing is... if its in dev mode, always 2 shards 1 cluster
there, I also don't see what's that it supposed to do
if its in live mode, take shard count from a config file, cluster count from a command line parameter
you aren't passing any overwrites to the channel
so everyone will be able to see that ticket channel
lol
the aegis::create_bot_t::clustering() method configures the bot instance as a cluster, identifying for a subset of all shards
@solemn elk if you're looking into a ticket system permissions is key.
from discord.permissions import PermissionOverwrite
@commands.command()
async def ticket(self, ctx):
name = f"ticket-{ctx.author.discriminator}"
guild = ctx.guild
overrides = {
guild.owner: PermissionOverwrite(send_messages=True),
guild.me: PermissionOverwrite(send_messages=True),
guild.default_role: PermissionOverwrite(send_messages=False, read_messages=True)
}
channel = await guild.create_text_channel(f'#{name}', overwrites=overrides)
await channel.send("Ticket message here")```
that's the basic idea
of course you can config it to get a certain role object etc
because I assume you don't want everyone to see that ticket channel
Hi, has anyone ever try to split this kind of message to two column in discord?
to something like this
ty!
hmm i'm asking if maybe someone ever do it like is it will be good in mobile too or no
yeah it does look ok in mobile

especially with the recent updates
true
okay ty
how can I make sure writeFile() is executed before it returns?
_write(data) {
if (data === undefined) throw 'Tried to write to DB without any data';
if (!['object', 'array'].includes(typeof data)) throw 'collection name must be of type object or array';
try {
if (this._caching) this._data = data;
data = JSON.stringify(data);
fs.writeFile(this._tmpFilePath, data, 'utf8', (err) => {
if (err) throw 'An error occured when writing to the DB:\n' + err;
fs.rename(this._tmpFilePath, this._path, (err) => {
if (err) console.log(err);
return true;
// if (err) throw 'An error occured when writing to the DB:\n' + err;
});
});
} catch (err) {
throw 'An error occured when writing to the DB:\n' + err;
}
}```
alr lemme try that
Couldn't you just use writefilysync
doesn't that stop the code until it is run?
yeah, isn't that what you essentially want to do
can't you run await/await functions without stoping the process?
hm?
it doesn't
hmmm
why?
@green kestrel
@green kestrel
lol
who did it
they really liked showing their 2 whole braincells
i was waiting for him to finish typing in order to check if hes going to throw more death wishes lmao
lmao
like he killed 1 person
oh
imma wait and see if he kills another
LOL
then ill arrest him!
Did discord py get a new version 
pi
pizza py
No that's raspberries
ah yes sorry my bad ๐
can anyone help me? i want to run a specific set of shards dpy?
like how would i do it?
I may or may not have googled "Apple Py" because I totally didn't realize the pun
If your using the auto sharper just set the ShardCount=number
uhh like for example
i want to have 50 shards
i want to run 10 shards per instance
but dont want overlap ofc
@drifting wedge doesn't it depend if discord.py supports such an arrangement
i think they do
i dont blame you, apple would indeed do something like charge $499 to run py on their devices
if not i can add it in
Just change to c++ because c++ is win
but like what would i do to do this
Yeah I think you'll need to make your own sharder if you want to have internal sharding.

Apple would definitely make some programming language that costs $15/month to use
cygwin threw a whole ass fit for me yesterday and i'm tired of cpp please :(
Apple has a programming language and you need a mac to use it
from d.py discord
use normal client/bot and set the shard_count to 10 and the shard ids to differant ids for each instance
I am pretty sure discord.py will handle your shards for you
...in cement
I just spent 10 minutes trying to find out why a function argument was undefined and it turns out I didn't even add it to the function
fuck
It will, but I dont think it supports internal sharding @gilded olive
it does
but i want dif proccesses
Rubber ducking will always save your day
Which he is describing.
@drifting wedge how many servers you got
It's not worth clustering like I do until restarts take a long time
i will eventually uhhh
hi
im at 500 servers and already running into erros that i need sharding
Again, not what he is asking for.
oh
like its already slowing down
Coding a cluster system is a lot of fun though
massively
Wether or not you need it
ya i dont think it support internal ones fr @solemn latch
@gilded olive he wants clusters of shards e.g. process A shards 0-4, process B shards 5-8
o
that's done by discord.py already tho? I am like 50% sure
you can ask in their official server gg/dpy
im aiming rn at 100-150 servers per shard
i have the memory
and i have the power to run it
IIRC dpy runs all shards in one process or one shard per process no in between
so shouldnt be an issue
Same as djs
commands.Bot(..., shard_count=10, shard_id=1) will run shard 1```
there we go
with python, how can i like: have a file, and that file makes a couple files run
Do it with shell scripts
Look at start.sh and run-shard.sh in my repo
Just copy it lol
if i have 1 file to run it
They're simple
the whole point is to run them separately
The one file is a simple entry point
Has anyone had their table dropped because your username yet brain lol
ye
You can rejig that across different machines if you want
but how would i stop / run / restart one of them
is there any way to add optional parameters to a js function?
i think so
u can require them
and do var == none
alr
In my case I simply kill -9 one of the cluster processes and it restarts
not just none
wat language are you talking in
Does dpy have something like pm2
python does
Pm2
pm2 is python
You could use that for starting clusters
wait
no
ye
thats what i sue
use
prob will use subproccess
and run console
can i even?
Pm2 can only start node.js process can't it
It works with py too.
interpreter python
Aka slow code 
lmao
uhh can i run root commands with mongo?
like i run a loop
check mongo every 5 mins
and see if it says to restart bot
if it does, run pm2 restart/stop/run bot(id)
whenever installing seequilize from the guide from https://discordjs.guide/sequelize/#a-simple-tag-system I get the following error
const sequelize = new Sequelize('database', 'user', 'password', {
^
ReferenceError: Sequelize is not defined
at Object.<anonymous> (/home/runner/Aperture-Bot/index.js:15:19)
code its mad at
const sequelize = new Sequelize('database', 'user', 'password', {
host: 'localhost',
dialect: 'sqlite',
logging: false,
// SQLite only
storage: 'database.sqlite',
});
what would the require command be
Its in the code example on the page you linked to
im so dum
ty lol
i thought that was just part of their skeleton code lol, i didnt look very hard at it
how to use mongo db in express and ejs and nodejs using website ?
mongoose
@green kestrel sorry for ping again lmao, can i yoink ur restart icon?
like the ๐ looking icon
arent those just from font awesome or something
i doubt it
i looked there already
oh
yeah i just found it too by doing a google search instead of using their search
These kids don't know about that linux stuff ๐
Congrats on 500 servers!
something on my vps keeps using port 6379 and causing my bot to error but when I kill it, it just restarts
i didnt even know my bot was using port 6379
wtf is using that port
#general message -> Just curious if anyone had any thoughts here .. didn't want to ask directly here though.
Not asking for secrets, just curious on expectations.
try netstat -l

-> 
