#development
1 messages Β· Page 1246 of 1
users want your pretty embed
not the one from system
isnt that the wholepoint of your welcomer?
No?
then why have a welcomer in the first place
I don't even think I put it in embed
How do i make the server bot work?
well,you do you, i explained what you should do, if you dont want to,your choice mate
Its not working on my own server
lol
I asked for systemChannel help
systemChannel isn't always available
which we answered and said why its bad to it that way
Yes, got that
so uh
But I also received 'db 101'
?
lul
next time i'll just answer 'you doing bad stuff'
it was a good lesson
without a proper explanation of why after
How do I ask for support with the bots?
In anyway, when I asked month ago about DB, nobody really could help me, so idc that much now when you say that my DB is working bad, it's working that way cause I didn't have any help to work with it 
its part of the struggle of coding, you wont always have someone readily available when you get stuck. Its try and error
Oh
You are sending a type array but it needs to recieve a string @earnest phoenix
Its trying to parse the array into a url but it cant
You need to be sending a string
next time should read the error msg
Does anyone know if there is an api for top.gg/servers votes?
i want to install discord.py lib
and i run the following
py -3 -m pip install -U discord.py
still it showed error
it showed this
^
SyntaxError: invalid syntax```
try pip install -U discord.py
try pip install -U discord.py
@misty sigil it showed
^
SyntaxError: invalid syntax```
pip discord.py?
pip discord.py?
@misty sigil should i write this?
https://pip.pypa.io/en/stable/installing/
@faint prism i need to install discord.py
Is there a possibility to make the discord.py[voice] bot to send a message to all servers it is in with my specifi message? like for example i want mine to respond to (prefix) shutdown to announce it is shutting down.
with an arguement like a reason for example
yea i am on one of this site only
@faint prism @misty sigil i am running the statement plain do i need to add anything??
@silk chasm do u know aka ayush ?
@main chasm ?
@faint prism @misty sigil i am running the statement plain do i need to add anything??
@silk chasm r u both there?
Wait

He was putting it in IDLE?
oof
Yeah that is how he got syntax error
wth is idle?
wth is idle?
@silk chasm Python's built in super sucky IDE
Or python interpreter
type quit() then try the pip install

man fuck
if you want to install it on windows do windowskey +r then type cmd, hit enter, now type py -3 -m pip install -U discord.py in the black box. and hit enter again. then wait for it to install.@silk chasm
type
quit()then try the pip install
@faint prism nothing happened
Use your built-in command prompt
lol
not Python IDLE or files
Gotta learn python first at this point
@silk chasm u on windows?
yep
Use your built-in command prompt
@slender thistle can u elaborate?
ok
@silk chasm
WIN + R
type in CMD.EXE
click OK
then pip install discord.py
unless you're in a linux dist
click OK
@charred kindle what do i type in open?
I have a feeling this dude didn't install to path either
cmd.exe
oml
then from cmd
black box opened
good
now
type in pip install discord.py
So zypher, let me ask this. Are you willing to create a Discord bot without any knowledge of Python?
Are you willing to create a discord bot without any knowledge of command line?
how do i add an async function to a module.export?
shivaco how time long my bot approved 
me.see(DBL.guild.members[Dedo])?.redirect_to(DBL.guild.channels[support].pins)
+5 wks
Yeah
done
@mystic ice what errors pop up or something idk I didn't read the manual
my server was dead (vps where i host my bot) so i needed to download the folder and get a new server install
now ive put the files back and installed nodejs, forever and nodemon (which i used to use) it wont start
ehh leme see
/node_modules/discord.js/src/client/Client.js:41
} catch {
^
SyntaxError: Unexpected token {
Update node
npm
djs v12 requires Node.js v12 or higher
i think
apt upgrade node.js -y```
Check the nodejs official website, they have instructions for installing on libux machines
@silk chasm Here is a step-by-step on how to install discord.py
You likely wont find an updated version with apt
and hit enter
@charred kindle installed and updated what's next?
Brutally ignores my question, nice
who
node -v
@charred kindle installed and updated what's next?
@silk chasm Create a bot
zypher
lol
Not like this is the first time this shit happened already
Youre just too quiet shiv, people dont notice you :^)
@silk chasm I'm not going to spoonfeed you anymore. Try reading this: https://realpython.com/how-to-make-a-discord-bot-python/
i created code message collector and i connected Mongo DB but idk how to save 
Save?
upsert a record to mongodb
Save a wot
save date
@silk chasm I'm not going to spoonfeed you anymore. Try reading this: https://realpython.com/how-to-make-a-discord-bot-python/
@charred kindle hmmm....ok.... but if i didn't understood u need to "spoonfeed meh"
wait
client.on('message', async message => {
if(message.channel.name == "suggestions"){
if(message.author.bot) return
message.delete()
if(message.content.toLowerCase() === '?start') {
message.channel.send(' started successfuly :man_biking:')
let filter = m => !m.author.bot;
let collector = new Discord.MessageCollector(message.channel, filter);
collector.on('collect', (m, col) => {
if(m.content.toLowerCase() === '?stop' && (message.author.id === m.author.id)) {
console.log("Stopped.");
collector.stop();
}
else {
let embed = new Discord.MessageEmbed()
.setDescription(m.content)
.setTimestamp()
.setTitle("Suggestion")
.setAuthor(m.author.tag,m.author.avatarURL({format: "gif"}))
.setColor('#4f65ff')
message.channel.send({embed}).then(embedMessage => {
embedMessage.react("751137346422046738")
embedMessage.react("751137346585493536")
})
}
});
}
i connected but removed mongoose.connect but tell me when i used ?start after restart bot i want when bot restarded no need again use ?start ! in
Wat
E n g l i s h please
thats arabic?
No that's enchantment table
when i typed ?start
in channel
work code right?
but if restarded bot not work need ?start again right?
@main chasm restarted...
It's extremely hard to understand you but i get what you mean
you need to save a status in the database
Channel process inactive before ?start
Restarting it reverts back the process
yes
Once the ?start is used, save a document with status property of inactive or not and the channel id
But, first of all, do you use a mongodb client or mongoose client, both are MongoDB Driver's API wrapper
mongoose
Well you can seperate your schema models on a folder and export it through the main command file
@quartz kindle thanks for the help
also ehm
before i used to be able to connect to mongodb via compass
idk if someone else here uses mongodb
sudo mongod --auth --bind_ip MYIP --fork --logpath /var/log/mongodb.log
@main chasm For example, create a models folder, and create a new file called ChannelStatus.js
i ran that not sure if that makes it available
@earnest phoenix ok bro thank u so much i work it now
You likely wont find an updated version with apt
I'm pretty sure there is
const mongoose = require("mongoose");
let channelSchema = new mongoose.Schema({
channelID: String,
active: Boolean
});
module.exports = mongoose.model("ChannelStatus", channelSchema);``` @main chasm in that file
@pliant iron dw i got it

@earnest phoenix can u help me after u helped dedo?
Sure, what did you need help with again
well i had to reinstall my server so need to setup everything again
i need my mongodb to be available to be called by my bot
@earnest phoenix in channelStatus.js ?
Yes
mongoose.connect('mongodb://USER:PW@MYIP:27017/discord', { useNewUrlParser: true });
think i need a connection open for this
sudo mongod --auth --bind_ip MYIP --fork --logpath /var/log/mongodb.log
this is already running
You host your own mongo db client?
think so lol
if you have mongod then yes
Does it give any kind of errors while trying to connect
Hmm was whatever you're trying working before you reinstalled your server?
well it has been 1.5 years since ive installed it lol
the only thing i remember is running
sudo mongod --auth --bind_ip MYIP --fork --logpath /var/log/mongodb.log
then everything used to work
then run it
its running
jk, i dont know what im talking abt
lol
Im on windows with discord.py
OOF
Well that's suspicious to not work, it's like you got a bot with the token you always used but one day you try to restart it without regenerating the token, it says An invalid token was provided
These kind of things are annoying to happen, that you got no clue of why they happen
Version?
mongod version?
4.4.1
nope
last one
what ports need to be open?
27017 only right?
@earnest phoenix still there ? xD
2020-09-15T16:46:37.184+02:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
@earnest phoenix but i not use command handler !
Doesn't matter if you use one or not
fkn mongo lol
almost no one uses it
main problem right there
@earnest phoenix u have an admin acc too right?
mongo tells you to make an admin acc, should be in admin database if im right
if u know what i mean:
"db" : "admin",
"roles" : [
{
"role" : "userAdminAnyDatabase",
"db" : "admin"
},
{
"role" : "readWriteAnyDatabase",
"db" : "admin"
}
],```
Might be relevant in #development
This is "free" hosting
https://discordapp.com/channels/264445053596991498/264445053596991498/755823033486409828
Asus Zenfone 3
lol
Tbh, it was one of my favorite phones I've ever owned
@client.event
async def kick(ctx, member : discord.Member, *, reason=None):
await member.kick(reason=reason)
client.on('message', async message => {
if (message.channel.name == "suggestions") {
if (message.author.bot) return;
message.delete();
let getHandler = require("./models/channelStatus.js");
let getStatus = await getHandler.findOne({ channelID: message.channel.id });
if (message.content.toLowerCase() === '?start') {
if (!getStatus || !getStatus.active) {
if (!getStatus) {
await getHandler.create({
channelID: message.channel.id,
active: true
});
} else if (!getStatus.active) {
await getHandler.findOneAndUpdate({ channelID: message.channel.id }, { $set: { active: true } });
}
message.channel.send("started successfuly π΄ββοΈ");
} else {
await getHandler.findOneAndUpdate({ channelID: message.channel.id }, { $set: { active: false } });
message.channel.send("Stopped.");
}
}
if (!getStatus || !getStatus.active) return;
let filter = m => !m.author.bot;
let collector = new Discord.MessageCollector(message.channel, filter);
collector.on('collect', (m, col) => {
let embed = new Discord.MessageEmbed()
.setDescription(m.content)
.setTimestamp()
.setTitle("Suggestion")
.setAuthor(m.author.tag,m.author.avatarURL({format: "gif"}))
.setColor('#4f65ff');
message.channel.send(embed).then(async embedMessage => {
await embedMessage.react("751137346422046738");
embedMessage.react("751137346585493536");
});
}
});
}``` @main chasm
My head hurts
Whenever I type the command
It crashes
Kick command
async def kick(ctx, member : discord.Member, *, reason=None):
await member.kick(reason=reason)```
What's the problem with it?
If yes, then tell it please
thatβs an event not a command?
Bro. It's an event.
It's not full command
I mean. I didn't sent the full Code of the bot
Only sent this as it's showing an error
@misty sigil
and you didnβt send the error
It's showing
Wait
Lemme send it
It showed something like Error kick command.
The kick command
Hey why is my discord webhook not displaying the actual link? Eventhough it is scraping the new restocks and shoes
what
because it doesnt exist
well why tho
xD
because it doesnt exist
cuz it does scrape the new shoes
ask nike
So the actual link page should be good too
misly I might have not given enough information
But your help was as good as my fucking math tests
Ight, I am going to sleep. Let me know the error in this code before I wake up
async def kick(ctx, member : discord.Member, *, reason=None):
await member.kick(reason=reason)```
everyone starts somewhere
@earnest phoenix should i put my server ip in bindip in mongod.conf?
or u never did this?
Put 0.0.0.0 in
no cuz I bind to 127.0.0.1 but 0.0.0.0 works
@earnest phoenix Error: Cannot find module './models/channelStatus.js'
Show me an screenshot of your bot's main folder
ok
@misty sigil how do u let it run on ur server?
I use systemctl
says i cant start bc its not localhost ip lol
yeah but what line u use?
like i use ehm
I just use systemctl start mongod
sudo mongod --auth --bind_ip MYIP --fork --logpath /var/log/mongodb.log
oh well u dont know my ip dont think it matters then does it :P
@misty sigil
also i cant start it unless bind ip is 127.0.0.1
what?
no
fine?
we need folder
folder or screenshot?
screenshot of the file structure
matt do u know why my compass says authentication failure when i use the admin db with admin/ right pw
matt do u know why my compass says authentication failure when i use the admin db with admin/ right pw
@mystic ice are you bound to 0.0.0.0
what's a popular npm paginator?
sudo mongod --auth --bind_ip MYIP --fork --logpath /var/log/mongodb.log
or mongod.conf?
both
Ye
index.js , config.json ,channeStatus/js
@main chasm then just change
"./modules/channelStatus.js"tojs "./channelStatus.js"
ok
@mystic ice try using it in βbind_ip
aight
???
@misty sigil the db wont start at all
when i try sudo systemctl restart mongod it says it wont start
who that
for this test tube
lol
mongoDB is
test tube? what...
itβs very touchy
@quartz kindle π
yeahh ik
english pls
@fossil oxide this one?
dude...
Lol
oh for the love of god
LOL

Iam kurdish
ok, use google translate, otherwise i dont understand what you want
lol thats suggestion channel
so 0.0.0.0 in conf and in the --bind @misty sigil
seems like someone is properly checking states
what if the process wont start at all π
@north bobcat chawareka ta 5 hafta labar corona drang wallamt adanawa
@main chasm english

@main chasm kurdi
english here
ok
Bzhii
dont worry
Shukr kurdekm dozeo
please english
@main chasm

E bo titleakam warnagrtua
@main chasm Show your new code
please @ me
me lol
lol
@earnest phoenix ok
selftag nice
@north bobcat wait 1m
@main chasm bika kurdi
@north bobcat please speak english
@summer torrent iam kurdishhh
@earnest phoenix
then go #general-int
doesn't matter
@north bobcat
rules are rules
@opal plank yes
@main chasm I said re copy the code i sent
I edited it
@main chasm ping him in general-2, you can speak all languages there
@quartz kindle ok
if they allow any languages here this would start becoming a HueHue fest
@earnest phoenix i copy code but when i type ?start message embed not response me
@earnest phoenix can u tell me when u have time lol
@main chasm bash
@main chasm Just copy and paste this
client.on('message', async message => {
if (message.channel.name == "suggestions") {
if (message.author.bot) return;
message.delete();
let getHandler = require("./models/channelStatus.js");
let getStatus = await getHandler.findOne({ channelID: message.channel.id });
if (message.content.toLowerCase() === '?start') {
if (!getStatus || !getStatus.active) {
if (!getStatus) {
await getHandler.create({
channelID: message.channel.id,
active: true
});
} else if (!getStatus.active) {
await getHandler.findOneAndUpdate({ channelID: message.channel.id }, { $set: { active: true } });
}
message.channel.send("started successfuly π΄ββοΈ");
} else {
await getHandler.findOneAndUpdate({ channelID: message.channel.id }, { $set: { active: false } });
message.channel.send("Stopped.");
}
}
if (!getStatus || !getStatus.active) return;
let filter = m => !m.author.bot;
let collector = new Discord.MessageCollector(message.channel, filter);
collector.on('collect', (m, col) => {
let embed = new Discord.MessageEmbed()
.setDescription(m.content)
.setTimestamp()
.setTitle("Suggestion")
.setAuthor(m.author.tag,m.author.avatarURL({format: "gif"}))
.setColor('#4f65ff');
message.channel.send(embed).then(async embedMessage => {
await embedMessage.react("751137346422046738");
embedMessage.react("751137346585493536");
});
}
});
}```

ok
big ignore :(
@earnest phoenix spoonfeeding
B r u v, i just edited his code, a few lines add, E
still
big ignore :(
@mystic ice You're not ignored, i don't have a solution for your issue
@earnest phoenix come to my server lmao 
when i send one message
bot response me 4 message
lol
Bot ception moment

"Fix it" sure Iβll break it
at this point it might be worthwhile using google translate than freely doing it yourself
or take a english course :)
an*
yes yes, i didn't take any english courses and i learnt english almost on my own so my grammar aint the best. [@opal plank]
ok
one
no forever
ya should try learn basic fundamentals of JS and whole programming
im fairly certain you ran your collector 4 times
idk if d.js adds a collector.stopAll() method or something
π
doesn't seem so but ok (knowing good practices and bad practices, standard functions of JS etc.)
but idk mongodb
then learn or use something else
just seup
@main chasm ok i dedo i understood
thank u for your understand thanks for god
ur bot got DID
thank u for your understand thanks for god
@main chasm talking about ur bot
i want connect mongo db when restarted bot save channel id or name channel
ur bot replied u 5 times , right?
How to use awaitMessages. in djs
start with the docs
yes i know change to 1 time but this is brother changes code
I read the docs
and whats your question?
.awaitMessages(filteroptions)
Look at the example on the link above.
i was looking for an example
// Await !vote messages
const filter = m => m.content.startsWith('!vote');
// Errors: ['time'] treats ending because of the time limit as an error
channel.awaitMessages(filter, { max: 4, time: 60000, errors: ['time'] })
.then(collected => console.log(collected.size))
.catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));
oh okay thx
i was looking for an example
@stark abyss u need help in any api
no
oh he's asking for js...
my question is when bkt resatrted bot process
my question is when bkt resatrted bot process
@main chasm umm is that eng... cuz i only know eng...
wait
wth
i think it's inglish
const mongoose = require("mongoose");
let channelSchema = new mongoose.Schema({
channelID: String,
active: Boolean
});
module.exports = mongoose.model("ChannelStatus", channelSchema);
i want connect mongodb
i don't think that is python...it if would python i can help ya... so i can't...
thats js
thats js
@thick gull ikr
@main chasm in the file you're using it are you requiring the module
like
const channelStatus = require('path/to/your/schema')
let getHandler = require("./ChannelStatus.js");
what is your error
not any error
but
my code suugestion
look
client.on('message', async message => {
if (message.channel.name == "suggestions") {
if (message.author.bot) return;
message.delete();
let getHandler = require("./ChannelStatus.js");
let getStatus = await getHandler.findOne({ channelID: message.channel.id });
if (message.content.toLowerCase() === '?start') {
if (!getStatus || !getStatus.active) {
if (!getStatus) {
await getHandler.create({
channelID: message.channel.id,
active: true
});
} else if (!getStatus.active) {
await getHandler.findOneAndUpdate({ channelID: message.channel.id }, { $set: { active: true } });
}
message.channel.send("started successfuly :man_biking:");
} else {
await getHandler.findOneAndUpdate({ channelID: message.channel.id }, { $set: { active: false } });
message.channel.send("Stopped.");
}
}
if (!getStatus || !getStatus.active) return;
let filter = m => !m.author.bot;
let collector = new Discord.MessageCollector(message.channel, filter);
collector.on('collect', (m, col) => {
let embed = new Discord.MessageEmbed()
.setDescription(m.content)
.setTimestamp()
.setTitle("Suggestion")
.setAuthor(m.author.tag,m.author.avatarURL({format: "gif"}))
.setColor('#4f65ff');
message.channel.send(embed).then(async embedMessage => {
await embedMessage.react("751137346422046738");
embedMessage.react("751137346585493536");
});
})
}
})
can u test code?
no
when i send the message to channel suggestion
bot send message 4 msg
repeat
and i want connect mongo db save channel id
mongoose.connect(private ,
{ useNewUrlParser: true , useUnifiedTopology: true})
@earnest phoenix come back
i need u
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.
π π
Marco come
@misty karma no spam
hello friends. basically i'm trying to set a up a channel in my server where my bot puts every dm it receives, but my code that checks the guild id keeps making it crash and i was wondering if any of y'all knew how to fix this lol ```//dm shit
if(message.guild.id == undefined)
{
message.channel.send("pog")
client.channels.get('736744738933440552').send("<@"+ message.author.id + ">: "+ message.content)
};
//bad words
if (message.guild.id == (icarlypit))
{
if (message.includes("swear word") || (message.includes("bad word")))
{
message.delete(1);
message.channel.send("sire, i am calling the police on you for your potty mouth")
}
};``` (i'm still a beginner at this so uhhhhhhhhh don't judge me too hard lol)
this is discord js btw
Just check for channel type
@main chasm K I'm back, just went somewhere, did you send your new code
message.channel.type == "dm"
@earnest phoenix just look dm i send u new code all file
i've tried that, and it's still not working
class MyClient(discord.Client):
async def on_ready(self):
print('Logged on as', self.user)
async def on_message(self, message):
# don't respond to ourselves
if message.author == self.user:
return
if message.content == 'ping':
await message.channel.send('pong')
client = MyClient()
client.run('Here was the token i can't show it to y'all')```
is there anything wrong with it
@earnest phoenix come i open live
cuz i am getting tons of errors
both codes work when the other is gone so i'm :-|
if(message.channel.type == "dm")
{
message.channel.send("pog")
client.channels.get('736744738933440552').send("<@"+ message.author.id + ">: "+ message.content)
};
//bad words
if (message.guild.id == (icarlypit))
{
if (message.includes("swear word") || (message.includes("bad word")))
{
message.delete(1);
message.channel.send("sire, i am calling the police on you for your potty mouth")
}
};```
client.channels.cache.get
i will try, thank you!
@main chasm I sent you a fixed version, check your dm
can someone help me in alarm/remind me command
Would Client.logout then Client.login work for a task to auto change the bot status? This is discord.py btw
don't log out and log back in to just change the status
Hey guys, whats the correct way to get the currently showing activity from a member?
presence.activities[0] will just give the first in the map array 
@earnest phoenix thank uuuuuu so muchhh you helped me full thank u so much again
activities is array, no?

really master
Hmm?

@opal plank It's an array
then it aint a map
Oh sorry
presence.activities[0] will just give the first in the map :thinkeyes:
But .activites[0] will not always display the right activity :/
@rare plume You could get all members in the server and use discord.Status
https://discordpy.readthedocs.io/en/latest/api.html#discord.Status
I use JS
But thank you still π
Which activity are you trying to show
The one which is also showed in discord
If you're trying to show a specific one
Arrays have a find() method, use it to iterate through to find the right one that includes the correct type
The one which is also showed in discord
@rare plume I mean, you can map that
Wait you mean the custom status? Or all activities
Wait, i try to get a screenshot that shows the problem better
K
I try to explain as best i can lmao
How can i detect what activity discord is currently displaying that what i am trying to do
Hope its understandable xd
if i remember correctly spotify has priority over other activities?
are you looking for one specific activity
because this user might be doing both
You mean, show what activity shows up on their profile
Excatly!
That's impossible to know
Okey, thought that :/
Yeah, thank you both hahaha
Np
what? why is it impossible?
I'm looking at translating my bot into various languages.
As I see it there are three ways it's mostly done, either if, then, else with different hard coded strings (really bad), a JSON or XML external file containing translation strings that can be modified by third parties e.g. volunteers, or finally full on .po files and gettext.
How have you approached this or how would you approach it, did I miss anything? Also translation of everything on demand using a cloud service wouldn't be feasible as it won't scale to the number of servers I'm on.
I'm purely wanting to discuss the technicals of how everyone else approached it.
in javascript users sometimes use string interpolation like
a json file full of strings to translate to like this
en: {
HELLO: "hello, {0}"
}
discord also takes a similar approach
Like: You have {} points of a possible {}?
what? why is it impossible?
@quartz kindle He means,
For example if the user has more than one activity, show the one that appears on the user's profile, not all of them
yes
Yeah that's the format my strings will take however I store them, fmt::format and python style
hmm
@earnest phoenix ah, cant you just assume its the last activity in the array? since activities are added on top of each other
i never fully understood how it could be displayed
perhaps a function like translate("HELLO", "en", ["value 1", ...])
I don't think that would always come out as true, might be falsy but i have no idea if it would be the last or just random elements in the activities array
Well fmt::format does interpolation for me already:
string s = fmt::format("one {} and another {}", var1, var2);
How to make a bot dashboard
How to make a bot dashboard
@earnest phoenix Learn full-stack development
yes but i mean when you have multiple strings like x {} y {} or a {} b {} you probably want to use a function for that
So it's just a matter of how to store the translation array and where
tbh
What is full stack development
@earnest phoenix best way for that depends on your language
i'd store multilingual strings as an object with some number/id as keys
What is full stack development
@earnest phoenix https://bfy.tw/P510
how to store the translation array might be something along the lines of defining an enum or key-value store
so you can pull it by lang and string id
for a typed language you might be able to define a vector/array of similar structs
idk
[{lang: "en", HELLO: "hello, {}"}, {lang: "es", HELLO: "hola, {}"}]
really though idfk how to do it either
in theory this approach should work but maybe theres a better way
I think I'd store it like this:
{ // Object, containing all messages that can be translated by the bot
ERROR: {
"en": "Error {}",
"rs: "...",
...
},
SUCCESS: {
...
}
...
}
And would access it like this: send(MESSAGES.ERROR[user.language],
{
en: {
1: "hello",
2: "idiot"
},
pt: {
1: "olΓ‘",
2: "idiota"
}
}
How to make PokΓ©cord?
hoo boy
yeah, its less readable, but it follows the same style as error codes
so its a bit more portable and smaller
Please help
realistically though numbers is one approach
@earnest phoenix do you know any programming language
your username is "pokemon dev" but you don't know how to make "pokecord"
{
en: {
1: "hello",
2: "idiot"
},
pt: {
1: "olΓ‘",
2: "idiota"
}
}
@quartz kindle I think this is most elegant, I can send that separate struct in a file to a non technical translator
Lol
"there's an api for that"
Yeah you have to use the pokecord api
Bruh moment
welcome to 2020, the age of apis
tim api

pizza api
bruh
@quartz kindle smush APIs together until it works right?
tim api just scrapes stack overflow djs questions
Just loop every API that exists until it works
Just loop every API that exists until it works
@earnest phoenix AHH infinite monkey api
import random
import time
import asyncio
TOKEN = "Her was the token..."
client = discord.Client()
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith(".ping"):
await message.channel.send("pong")
@client.event
async def on_ready():
print("RUNNING")
client.run(TOKEN)
print(client.user.name)```
here's my code
when i run it
it shows bunch of errors
there is no single api to make a bot
you have to make the code yourself
you can use an API to get information
fore example pokeapi.co
Which api
but you have to create something to be able to use it
What is pokeapi.co
it is an api that gives you information on pokemon
like ditto
or pikachu
you create the code that can read that
1000 lines? 
yeah
certificate verify failed: certificate has expired
and when i run it
thats your error
@earnest phoenix can u come in for vc for 2 min i will screen share
I saw, I'm not into python so idk about your error
cuz anyone of u won't understand
I saw, I'm not into python so idk about your error
@earnest phoenix ok.
What is Poke'cord api
@earnest phoenix pokecord api is an API that doesn't exist yet that you'll create
Your response is classic
Love it. No really the point I was making is you must make it
And you're in the right place to learn how
I love watching whitenames get confused asf
anyone have any tips on adding reaction roles (like when someone reacts they get a role) on discord.py?
@silk chasm that error means your ssl certificate is expired. this can happen if your date and time is wrong in your computer, and also if your certificates are missing or corrupted somehow. you will need to reinstall them. google the error and you will find plenty of answers telling you what to do and how
My fault I should have ended it with /s
what is this channel? what is life? whatis love?
whatis love?
@opal plank baby don't hurt me. Don't hurt me. No more.


yes
what could go wrong
Test it test it
anyone have any tips on adding reaction roles (like when someone reacts they get a role) on discord.py?

Test it test it
@green kestrel What'stest
@fair quartz use raw reaction events
ok thank you
@earnest phoenix test is where you stare hard at the code after 6 hours of non stop dev and say "meh looks fine to me" and click Deploy
Nah, testing is like looking at the code once, trying to change something then deploy
Doesn't work? Repeat
Irony is the one thing you change introducing the bug
@quartz kindle
lmao
things might start going on fire
15 Errors
Intense look at the code
Attemps to change one line of code
75 errors
The moment when the error you get is longer than your entire code
(node:58404) UnhandledPromiseRejectionWarning: AbortError: The user aborted a request.
at RequestHandler.execute (/home/thinh/judger-djs/node_modules/discord.js/src/rest/RequestHandler.js:107:21)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:58404) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:58404) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
What the FUCK is this
Discord.js suck
(node:58404) UnhandledPromiseRejectionWarning: AbortError: The user aborted a request. at RequestHandler.execute (/home/thinh/judger-djs/node_modules/discord.js/src/rest/RequestHandler.js:107:21) at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:58404) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:58404) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.What the FUCK is this
@earnest phoenix Your request took longer than 15 seconds to be completed, then it gives that error
Discord server suck
its when i hit 200 joined streams in too short of a time
oh u mean about twitch api
yeah
Finnaly i restart the vps and it works now π₯°
GCP SUCK
Disconnect when i update my sysyem
rip

Well can the libs know that your bot is verified
good question, doubt it
since it simply says 'join timeout'
means they dont have a rate handler
maybe?
hey
how do i specify my mongodb adtabase? {
"host": "HOSTNAME",
"user": "USERNAME",
"pass": "PASSWORD",
"dbname": "DATABASE",
"port": "PORT"
}
If anyone's interested here's a hacky script I used to make Google translate go brrrrr and translate 90,000 question database for free without triggering their rate limits
It's such a kludge it hurts, but as a one off it worked very well
Interesting
hi i have an error when i search to make a command i created 250 command
is I don't know what it can be
This is the error
https://pastebin.com/raw/hjQeb1tL
it can't connect
If anyone's interested here's a hacky script I used to make Google translate go brrrrr and translate 90,000 question database for free without triggering their rate limits
https://hatebin.com/tuluiethpd
@green kestrel bruh PHP like who uses browser code instead of node.js
i don't
because I'm not a web developer
hi i have an error when i search to make a command i created 250 command
is I don't know what it can be
This is the error
https://pastebin.com/raw/hjQeb1tL
Pls help
on the production server
Imagine mentioning PHP and forgetting that browser code usually refers to JavaScript
@quartz kindle is actually a bot powered by the stack overflow api and an ai force
@_@
idk
definitely wrong
thats not 10% fam
^
more like 35 ish
@swift umbra Use rounded rectangles
And a gradient instead of that damn green rectangle overlay
ah maths
maffs
pretty bad at that
const isClaim = m => m.content === message.embeds[0].description.includes("got the card!") ```
is this workable
Would suggest storing the gradient as an actual image instead of generating it when needed
math.round if you need round numbers
is it
still off
@ancient nova hmmmmmmmmmmmmmmmmmmmm
just divide the current b total
and multiple by 100
that'll give u %
@opal plank sorry but you can't replace my Math teacher
middle line is 50
actually wtf
it didnt save

sharex
now it did
mid way arrow is 50%
@honest perch they're 1$ nitros from xbox promo
Hi i have a question?
dont ask to ask
Is that your question?
i dont now, do you have a question?
Hi i have a question?
@outer wing Yes you do (only true programmers will get this)
hi i have an error when i search to make a command i created 250 command
is I don't know what it can be
This is the error
https://pastebin.com/raw/hjQeb1tL
Pls help
Code?
idkΓΉ
Unhandled 'error' event
yes
twitch legit taking a piss at me
on startup
GIT IS TOO FRIGGING WEIRD
yassuo wind walled your bot
your redis connection failed
Should I use pogeyress bars?
@outer wing ECONNREFUSED probably passed it incorrect creds or it isn't running. Not sure how Redis works, but you didn't set it up right.
if the line is 500px, then 3% should be around 20px
Need help with percentages ping me
I'll happily send you a link of my Adobe Document Cloud PDF scan of my Math book
Lemme tyoe
that should get you an idea of how wrong ur maffs are
(current xp / total xp to next level) * width of bar = width of green bar
question rq
can i do execute(chat, undefined, 1) ?
to skip args that i dont necessarily need
should also be able to pass null
true that
hence why prop? is called "nullable"
Do them in order:
- Get the user xp.
- Get the user xp needed to level up (the total amount till next level up).
- Subtract the user xp from the total xp till next level up.
- Do the following meth to get the percentage:
(Current user XP / Total XP till next level up) * 100
- HOPE I REMEMBERED MY PERCENTAGE SHIT FROM LAST YEAR KTHNXBAI
is the width of the outline circle actually 700 or am i tripping
@quartz kindle is my meth correct
how do i get the appid number of the test name from json format
{
"appid": 1023270,
"name": "Test"
},
name_of_obj.appid
Is anyone here familiar with creating npm packages?
go fast
API abuse goes BBRRRR

i could actually put 10500 and 0 tbh
i wanna give a bit of leeway before re-attempting
@flint yew has a &wiki command which searches the question on Wikipedia and sends the entire page in an embed
@earnest phoenix yes
Lmao
Why bullying :/
@flint yew wut
l0l
used to be one hour to finish
now down to 20m
using ratelimits smort
and not a single error in console

pretty sure someone asked the same thing 5mins ago
if request took 15 seconds or longer it fails
bjr je suis un nouveau developper independant de bot et je voudrais vous demander une ide de commande je n'ai que celle ci:&help,&ping,&salut,&ban,&kick,&tg,&rip
@vocal mortar english only
oh sorry
@earnest phoenix why name
#general-int you can speak non-english there
Im making a dashboard for my bot and there are role rewards, i did like mee6 , whenever you changing a role level it will sort the roles's list, but if i will change something , other roles will move, for example if i change the "supervisor" role from level 2 to level 3, the roles "prison" and "muted" will change their places even they with the same value (1)
@earnest phoenix yeah so?
you need help with anything?
I want them to stay in the place and not to change their places..
but why
oh wait
its like this,
supervisor: level 3
prison: level 1
muted: level 1
after changing supervisor to level 4 its:
supervisor: level 4
muted: level 1
prison: level 1
I thought it will sort the list again when you change the role HEIRARCHY ORDER within discord themselves not when you cchang the level in the bot
prison and muted got their places replaced
Containers = Containers.sort((a, b) => {
let rewardA = a.getElementsByClassName("RoleReward").item(0);
let selectLevelsA = rewardA.getElementsByTagName("select").item(0);
let rewardB = b.getElementsByClassName("RoleReward").item(0);
let selectLevelsB = rewardB.getElementsByTagName("select").item(0);
let A = Number(selectLevelsA.options[selectLevelsA.selectedIndex].value);
let B = Number(selectLevelsB.options[selectLevelsB.selectedIndex].value);
if(A > B) return 1;
if(A < B) return -1;
return 0;
}).reverse()
this is the code
sigron
@earnest phoenix wuts Containers
why sort then reverse? why not just sort the other way around?
Containers = Containers.sort((a, b) => {
let selectLevelsA = a.getElementsByClassName("RoleReward").item(0).getElementsByTagName("select").item(0);
// let selectLevelsA = rewardA.getElementsByTagName("select").item(0);
let selectLevelsB = b.getElementsByClassName("RoleReward").item(0).getElementsByTagName("select").item(0);
// let selectLevelsB = rewardB.getElementsByTagName("select").item(0);
let A = Number(selectLevelsA.options[selectLevelsA.selectedIndex].value);
let B = Number(selectLevelsB.options[selectLevelsB.selectedIndex].value);
return B-A;
})
un-noodleified

Containers = all role rewards in array
@quartz kindle because I want it reversed














