#development
1 messages · Page 743 of 1
get that with \:emoji:
:dblMod:
Only from pc
Yes
no
No
:
Is it worth of making api for dash and then make express server? or just make directly dashboard into bot ?
Help to do a channel search from such a value <# 652179984349134858> and get its id
plz
Probably worth explaining, I'm sorry
The value of the channel he takes from mongodb
That is, it just saves the link to the channel
args[0]
Don't save them like that in the first place
next?
I already know that it’s better not to keep it that way, but the request was different
example?
Seeing as the format is always the same it shouldn't be that difficult to filter out the part you need
You can google examples
You already know that the id will be all numbers in the string
You also know that the id will be the entire string - the first 2 characters and the last character
Multiple ways to get to it
In search of
https://i.gyazo.com/bad7dc54b43e3c1a05371eb49fe472a9.png
How did he do this
Like the args and stuff
I get the .includes
Mostlikely
Ok thanks
hm
I there a reason I can't use exesive site elements?
For example I cant change the raduis of the .bot-img ect.
var logs = settings.musicCommandChannel.substring(settings.musicCommandChannel.lastIndexOf('#') + 1);
console.log(logs);
settings.musicCommandChannel = channel id
Output : 652179984349134858>
It remains to get rid of >
then just remove it...?
rather than saving the mentions
use substring again and remove it?
save the ids
yeah ^^
@fluid basin no
you're putting unnecessary load on your cpu by having to extract the id out of the mention
I agree
I mean thats the direct answer to his question
well I didn't say it was the best way or anything
and I do agree saving the id instead is more efficient
Hello @someone how are you
matches dog globally and case insensitively
regex is fun
It’s weird since I haven’t learnt it yet
The bot thing
Yea
Scroll up
I’m trying to add it to my bot
tfw search is broken
The pic
from experience regex is something you learn as you need it
then random user
Yes
client is bot client id right? js const dbl = new DBL('eyJhbGnodonttryl9xHPbnbbbsOeq0w0vttl_SYQkYpg7DP3U', client);
^
orginal tokens are longer and..
that's a DBL token ?
yes but its my orginal but not fully: http://prntscr.com/q8dss1
ah ok
i dont have to do anything at that client?
np
how to do like: js args.startsWith('http' || 'https')
if js (args.startsWith('http' || 'https'))
well that's not how you use startsWith
i forgot it
and is args an array or a string?
Can u tell me how i do this in my music bot
thx
that's how you use startsWith
np
Yaa but i want like above image the bar system
I have time system
well i wasn't talking to you sorry, i was replying to CDeveloper
if(args.startsWith('http')) {
//code
} else {
if(args.startsWith('https')) {
//code
}}``` does this work?
sure if args is a string
ok
and you can use else if
yeah.............
makes no change well position
but the *
i wanted to make a "aximage <link>" command and i dont want anything else then a http or https link cuz y
it would never reach the https since https also starts with http
A simple solution would be to check for https first
ok
@surreal sage you should only need to check for http as https includes http.
Fair.
join my bot server then
why would they join your server for that lol
hi
hi there is an xp system and i want to add a set level command
but I tried everything but it doesnt work, can someone help me here is the whole system
//console.log(`xp ${xpAdd}`);
if(!xp[message.author.id]){
xp[message.author.id] = {
xp: 1,
level: 1
};
}
let curxp = xp[message.author.id].xp;
let curlvl = xp[message.author.id].level;
let nxtLvl = xp[message.author.id].level * 600
let nxtLvldel = xp[message.author.id].level * -600
xp[message.author.id].xp = curxp + xpAdd;
if(nxtLvl <= xp[message.author.id].xp){
if(curlvl >= 100) return;
xp[message.author.id].level = curlvl + 1;
xp[message.author.id].xp = curxp + nxtLvldel;
message.channel.send(`> Gratulálok <@` + message.author.id+`> elérted a **${curlvl + 1}** szintet, csak így tovább`)
}
fs.writeFile("./xp.json", JSON.stringify(xp), (err) => {
if(err) console.log(err)
});```
discord js
const Discord = require('discord.js')
const profile = require('../profile.json')
const fs = require('fs')
module.exports.run = async (ub, message, args) => {
if (!message.member.hasPermission("ADMINISTRATOR")) return message.channel.send('Недостаточно прав').then(x => x.delete(1 * 5000))
let pUser = message.mentions.users.first() || message.author;
if (!profile[pUser.id]) {
profile[pUser.id] = {
balance: 0,
BitBalance: 0.001
};
};
let u = profile[pUser.id];
fs.writeFile('./profile.json', JSON.stringify(profile), (err) => {
if (err) console.log(err);
});
let member = message.guild.member(message.mentions.users.first() || message.guild.members.find(m => m.user.username == args[0] || m.id == args[0]))
const setbalance = args[2]
const setbitbalance = args[3]
if (!member) return message.channel.send('Введите имя пользователя')
if (!setbalance) return message.channel.send('Введите баланс')
message.channel.send(`Установка баланса\n\nПользователю:${member}\nБаланс:${args[2]}`)
u.balance += args[2]
}
module.exports.help = {
name: "sb"
}
Edit for yourself @earnest phoenix

?
I agree, I also do not like
then dont do it
What???
I actually kind of helped a man above
oh you were replying to that dude
LUL
meanwhile im dealing with this annoying issue:
Traceback (most recent call last):
File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 270, in _run_event
await coro(*args, **kwargs)
File "C:/Users/ChillFish8/Documents/SoraBot/Sora.py", line 107, in on_message
Leveling.leveler(message, client, Colour)
File "C:\Users\ChillFish8\Documents\SoraBot\Leveling.py", line 97, in leveler
Data = readfile(message.author.id, DefualtLevelBoundry, BaseMultiplier)
File "C:\Users\ChillFish8\Documents\SoraBot\Leveling.py", line 81, in readfile
insert_level_data(UserID, DefualtBoundary, Multiplier)
File "C:\Users\ChillFish8\Documents\SoraBot\Leveling.py", line 61, in insert_level_data
c.execute("INSERT INTO levels(userid, level, xp, levelup, multiplier) VALUES(userid=?, level=?, xp=?, levelup=?, multiplier=?)", (int(UserID), 0, DefualtBoundary, Multiplier))
sqlite3.OperationalError: no such column: userid```
with conn:
print("Data base opened sucessfully!")
# Create table
c.execute('''CREATE TABLE levels(userid integer, level integer, xp integer, levelup integer, multiplier real)''')
print("Level Table Made Sucessfully")
conn.commit()```
when this is happening
smh
makes me vvv sad
sqlite3.OperationalError: no such column: userid?
its not liking that i told it to add values into the column userid
saying that it doesnt existr
even tho
i litterally define it above
and then save the table
just hrrrrrrrrrsadas
i sorta wished i picked sql based db instead of mongodb for my project
oh well ¯_(ツ)_/¯
i dont
we have a lot of relational data
,you get random bugs like it not liking a column which is litterally their and staring you in the face
xD
that happens regardless of what db struct you use :^) just means you did it wrong
i usually use orm frameworks because sql gives me headaches 
orm?
object-relational mapper
like?
uh, in c# we have entity framework/core
basically
you do everything with objects
the orm framework does the sql for you
ok but like where is it stored
oh its sql
http://prntscr.com/q8grw0 oof the new 1.1.2
why is it 3314 files
node modules
new module added so i got the reupload
UTIL
axannounce #commands grey OOOOOOOOOOOOF OOOOOOOOOOOOF
there it is
what
@surreal sage uhm... Fun fact: you can re install modules.
@surreal sage FTP? What is this, 1999?
yes i do, but how u then start the bot?
with the vps
@green kestrel what do you sugest instead
cli?
but i dont understand, how u start the bot w/out cli/rdp
SSH/SCP/SFTP
sftp i use
anything other than FTP
ftp is for website :)
Good :)
FTP is plaintext and anyone sniffing your traffic can see your password
not on mine
sftp = ssh file transfering idk
you can connect to ssh too w same host:port and username and pass
atleast i think thats the logic..
does not work
sftpopnly shell and chroot
Yeah that's secure
I assumed FTP when I saw FileZilla
Personally I prefer winscp, but FileZilla works. I stopped trusting them when they tried to put spyware in their installer in agreement with sourceforge
You dont download it from sourceforge tho....
bruh
It seems to be most anti-virus softwares too
FileZilla is fine if you download it properly I dont have any viruses
@amber fractal not the point, they agreed with SF to bundle adware so I don't trust them anywhere now
They may be clean everywhere else. They may have learned their lesson, but why risk it when there are alternatives? 99% of the time i just use scp -r on the command line
I mean every freeware does that just actually pay attention when you download shit it isnt hard
exactly
There was a menu for downloading some crap and legally they have to have a deny button
click that
ez
Yea but it comes to the point of freeware installing shitty programs and browser extension by a tiny checkbox or having to click advanced install to not allow it.
I don't and can't accept such behaviour
Every technical competent person like us that clicks "don't install" on the adware option adds to their download count and encourages them to distribute to others who aren't so smart
hey, why do I get this error when i try to update my server on top.gg discord servers?
500
Internal server error, server lost?
If you believe something should be here contact us through our Discord Server or at support@top.gg
I do think the FileZilla devs learned their lesson pretty quick, but I don't forgive that so easily
It was all over theregister, Slashdot etc
@earnest phoenix they've upped their cloudflare setting and it redirects now from a html page with js for some. Hopefully they've fixed that now
ive tried to update it on my ipad, different browsers, everything
but it always redirects to 500 internal server error
well
internal server error
it's not you, it's the server that's erroring out
switching your browser won't help
oh okay so its everyone getting it?
maybe
most likely
Just delete it
cant really just delete a pup its probably in some other app
guys i made a bot in discord and when i try to invite it it redirects to the link i put but the bot doesnt appear in the server any help?!
whats the link?
How can I detect if a message has an emoji?
I tried to use this
!fwemoji.startsWith("<:") && !fwemoji.endsWith(">")
to know if a message does not have an emoji, but I think it only works with custom emojis, but if I use the default ones it does not detect
discord js
@quartz kindle private?
what's fwemoji?
@west raptor
let fwemoji = args[3]
so it's the 4th thing passed in?
&&
@west raptor yes
@west raptor returns nothing
ok xD
aaa i used to have a function to parse emojis but i cant search for it
Here I was testing, when it is a custom emoji nothing happens because until now I have not put anything up, but when it is an emoji by default it detects it as it does not exist
i think its beacause regular emojis are detected as ascii characters
And what can I do?
idk
:c
https://prnt.sc/q8ivw3 it's detected as this
xD
Do bots still have free nitro?
you can
make a server with you and your bot, add as many emoji as you like
then you can use them anywhere with their id
Yeah
<:emoji:id>
and <a:emoji:id> for animated one
oOH
What
?
@west raptor did you find your code? :c
search by scrolling up
Wonder if there's a possibility for the development of a movie bot, given the ability to go live exists 
So the bot will stream movies?
there are legal ways to stream movies
Totally not working on something like that
However that requires licencing
theoretically speaking, if bots were able to send video data, the bot could just stream from an owner's movie subscription service
yes
however wouldn't the owner need permission from the company who made the film to stream it?
However it is still public
correct
they probably never will
Just wait until someone makes an AI which logs what happens in the movie
into an audio
google's voice to text API 🙃
However more advanced
Think of it as an auto-making audiobook
but it gets it from an mp4
what
Somebody wanted to make it so bots can stream video content in a Go Live situation
No
Discord already shits itself enough
we dont need bots using up more bandwidth
lmao
Well its also illegal in some ways
Stream the whole bee movie
yes
there will be a guild just for that
Yes and the DMCA exists
oh
Spotify has to get permission from the music label, I think
then how about music bots
All streaming services use that
arent music bots basically spotify but on discord
I asked discord about the legality of music bots, they arent allowed to tell us though
oh
no not really
I mean there's nothing inherently bad about music bots just like there's nothing inherently bad about torrenting
There is tho
o
torrenting is illegal
Well then what you said makes no sense
it's a medium for bad things but not bad itself
if you download content that is copyrighted that you have no rights to
it's illegal
how do you get updates out to your users without tos abuse or it being annoying
smh ik piracy is illegal
Then I don't see the argument here
You can torrent things without pirating things
i have the
some software also distributes via torrents
If you dont own that thing, however, it is piracy
yes
Then what are you even talking about?
idk anymore
Copyrighted things regardless of torrent is illegal to download without a license or permission
My point would be that a music bot isn't bad so long as it doesn't break copyright laws but what music bot doesn't violate copyright laws
Most? @scenic kelp
?
It's not against the law to stream music off somthing like YT which TOS allow bots Todo as long as it isn't a pay to unlock <x song>
If you bot forced people to pay to play a song then that would be copy right
And disallowed
Is it possible to get the url of an emoji from those already in discord?
twemoji?
what?
twemoji or custom
twemoji
Yes
https://oliy.is-just-a.dev/fbruum_2325.png this exists too lol
yeah but you aren't going to do that for every single one lol
that's why i sent the map
but can a bot get it?
He sent the map
You can copy the link of an emoji
to get the id of an emoji use ctrl+shift+i and select the emoji to get it's id or link
oh
Didn't seem to work for me
That's the most clean map I've ever seen
It actually is tho
yall how do you define item where you want to get that specific item given by forEach in this scenario:
category.forEach(item => {
let demand = client.users.size * .5
let supply = government.item
})
are you trying to get the item in the government array?
yeah
government[item]
thanks mate
np
hey guys, if I were to theoretically want to fetch 100 message until I reached the end of a channel, how would I do this?
Some sort of loop as the limit is 100 messages for fetchMessages
this is with discord.js btw
With a loop yes just make sure your not abusing the api.
Don't do that
@late latch thank you for doing what I wanted just doing it wrong
error shown there could not help anyone
not completely because you add it and I want to set it up and the "sign screwer doesn't move one level from then on but 1 after 11 after 111
your code
let pUser = message.mentions.users.first() || message.author;
let u = profile[pUser.id];
fs.writeFile('../xp.json', JSON.stringify(profile), (err) => {
if (err) console.log(err);
});
let member = message.guild.member(message.mentions.users.first() || message.guild.members.find(m => m.user.username == args[0] || m.id == args[0]))
const setlvl = args[1]
if (!member) return message.channel.send('jelölj meg egy felhasználót')
if (!setlvl) return message.channel.send('Kérlek ad meg az értéket')
message.channel.send(`${member} Beállítotják a szintjét\núj szinteje:${args[1]}`)
u.level = args[1]
}
module.exports.help = {
name: "setlevel"
}```
xp json error
{"xp":8,"level":"10"}}
this is how it should look
{"xp":8,"level":10}}
cause of error "
setlevel command writes
all I need to do is set the level
pl
Level 10
setlevel 11
level 11
just added "
hello
try setting xp = 598.
@earnest phoenix Number(args[0])
Click the languages you are user
I have a problem if i start my bot using the sharding then it repeats its self and when I use a command it sends the message like 3times
Or is that normal lol
then you're doing something wrong
@willow magnet you set the webhook port and password yourself. then you need to go to your bot's edit page and put there the password you set and the full url to your webhook
@quartz kindle how to get the full url?
can i host my bot free??
well no but actually yes
You can host it for free but then your bot will be very limited
if you have ssh access to the shared hosting, you can maybe install nodejs in there yourself
but you can get an entire virtual server for under $5 a month
then you can install what you want
no i already have shared hosting of 1 year
@slender mountain try message.channel.messsages.first()
I need help with discordgo. I need use db connection pool, that i create in bot.go. But all handlers is in different files. Is there way to move pool to handler files or attach to discordgo.Session?
is for json multiple things for one this the same? json "test": {[ "hi", "test" ]}
oh
no
oh {[ and ]} right?
that's not valid json
^
you have to randomize the array
i do
so whats the problem lol
copy pasta dev doesnt know what to do
it's quite literally the same in json
No you didnt
so does
Learn English
JavaScript Object Notation, so doing it in json is the same as in js
google -> learn english to learn englidh
just removing const?
{
"images": [
"test"
]
}``` hmm? works?
yes that is valid json
ok thx
why do you need it to be an object if you're only going to have one property though
might aswell make it an array from the getgo
yeah
like for multiple commands you could use this
if you want more
or more prefixes
uh
nvm
avoid using json as a database
^
^^^^^^^^^
wdym not use it as db?
storing dynamic data in a json file is really bad
yeah, sure
ok
just keep in mind that you should read the file once on boot and then save the object in a variable
json can be linked with numbers, objects, strings, and booleans
^^
"storing dynamic data in a json file is really bad"
Bruh json files are literally meant to be dynamic in the first place
Not rlly
Yes that's why every language allows you to get the keys and root values when loading a json file so you can either load it fully or get and save certain peices of data
but theres not good reading/writing thingy what wouldnt corrupt json files ex if u have 5 shards and every 5 shards write into it at same time and result is corrupt, thats why use real db/on boot set them into variable
Yes that's why every language allows you to get the keys and root values when loading a json file so you can either load it fully or get and save certain peices of data
that literally makes no sense
how is getting keys and values relevant to storing data that's often changed in json files
and no
json files aren't meant to be used in the context of being constantly changed
it'll never even compare with actual databases
it's IO operations
it is bad for a reason
glorified json
its literally bson but its awesome
it dont really mind if ur bot does only have few shards/no shards
its easy to use
If your bot is to the point of needing to be sharded then it's expected for you to already have a database setup
not really?
not all sharded bots necessarily need DBs but json is just not good for constantly changing values full stop
hey everyone
I want to ban users from my bot. I've created a banlist.json file, put this (https://prnt.sc/q8wyjw) in the file, and then put a little loop (https://prnt.sc/q8wzzn) into the index.js file. It works. The only thing I need is commands to remove or add users into the banlist.json file. How to do that?
using fs you can write/read files. https://nodejs.org/api/fs.html
note that modifying the file too often is not a good idea
you should use a real database
Also, you can use banlist.users.includes(id) instead of a loop
whats the property to see how many guilds my bot is in?
in which lib
discord.js
yes, it's a collection
yes, it's a collection
sigh ok
collections have a size property
it takes long to install a module
bruh
works right? ```js
if (command === "delete" || command === "deletechannel") {
if(!message.member.hasPermission("MANAGE_CHANNELS")) return message.reply(You don't have permission. :no_entry:);
client.user.delete(${message.author.tag} deleted this channel.)
message.reply(Deleted channel!)
}
Test it lol
@surreal sage what fp??
collection#size
nvm
After the multiple messages saying json = trash I started trying to migrate to MongoDB. I’m running my bot off a raspberry pi (if that helps at all). I’m getting this error:
Extension 'cogs.currency2' raised an error: ConfigurationError: query() got an unexpected keyword argument 'lifetime'
Tried searching from MongoDB doc?
Yes, I have tried the trouble-shooting suggestions already
Ok
Send related code
K
from discord.ext import commands, tasks
import discord
import dbl
import pymongo
import dns
import json
class Currency2(commands.Cog):
def __init__(self, bot):
dbclient = pymongo.MongoClient("mongodb+srv://MongoDB0:theartofracingintherain@cluster0-22qio.mongodb.net/test?w=majority")
db = dbclient.test
@commands.command(name="boop")
async def boop(self, ctx):
ctx.send("bonk")
def setup(bot):
bot.add_cog(Currency2(bot))
That’s my code
sad programmer noises
sry but idk
ask on python disc at #help-0(-7)
(in databases channle they wont answer)
@trail reef youre passing it a object but telling it to get the command cog within what its being passes?
commands.Cog is just getting set to the object bot
idk if thats what its suposed todo or what
That’s how you use cogs and extensions, I use this regularly and it seems to work.
you can literally just process.exit() as a shutdown command
or restart if you use pm2
what exactly does <Client>.disconnect do
disconnects from the gateway
Kill me pls I no understand
i dont think it does
leaves whut
is it possible to add/edit things to a ftp server?
with discord.js
nvm
how to let a a bot edit a voice/text channel in a server to a specific value?
every minute
hi
i have a question, not about bots but limitations
how often should app presence state or anything be updated without being considered spam
60 max for status
1/12s
script for join voice chat :) pls
We don't spoonfeed here
how to like do a find server with id command save that as const/var then (varname).channels.find("name", "test1") and gets a channel out that server
First, don't use that way of find, it's deprecated, pass a function. Second it's like assigning any other variable, but you might need to await it
how do i add days to a date and time?
what @earnest phoenix
i want to try get the expiry date
i have 300 days
and i want to add that to the current date
how would i convert that to the month the day and time
what language? js?
yes
Date.now() + <300 days in ms>
ill try it
that's how you get the expiration date of whatever is expiring
will hat convert to the year month date?
it will be a date in ms
you can use this too https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString
Hello
Hello
@quartz kindle my bot is hosted on my own vps
I already discovered how to detect a default emoji of discord, so I share it xD
let regex = [
"\u00a9",
"\u00ae",
"[\u2000-\u3300]",
"\ud83c[\ud000-\udfff]",
"\ud83d[\ud000-\udfff]",
"\ud83e[\ud000-\udfff]"
]
let input = args[0];
if (input.match(regex.join('|'))) return message.reply("It's an emoji")
else return message.reply("not an emoji")
How I can kick members in library JDA pls code(I tried all versions but Nothing is working)?
i don't think people are going to spoon feed you code
It is one line...

then figure it out LOL
xD
Amazon Web Services
A cloud platform similiar to GCP, Digital Ocean etc..
@west spoke Did you just say i'm a bad developer in #memes-and-media?
No?
Oh, ok, sorry
Well, i thought you meant it with "hehe says who"
You said "not everything can be done with aws"
that's the response
Sorry if it seemed like something else


😅
Oh, well, i misunderstood, it's just that i'm a Digital Ocean fanboy
^
Digital Ocean is free right?
Nope
Well, no
Hmmm
It's not
@solar mauve we can't help you if you don't share whats wrong
but if you have access to apache you can host a website on a temp IP
I have a vServer...
It's a full-fledged platform, not just a bot host
also what version of jda are you using?
I use js
Also, @earnest phoenix, if you're searching for something free, Zeit Now and Heroku are good
same for AWS. Storage, web hosting, scripts hosting (lambada, etc.) and a lot of other 3rd party stuff that's useful
Heroku for the website, not bot*
Well, it's possible to host bots there too
Bot i host over my vserver
i wouldn't recommend any free hosts
By zaphosting
they are generally bad
Well, yes and no
On Raspberry PI 3b+
@earnest phoenix It's intended for websites but you can use it to host APIs
lol
how do i convert 300+ days to the current time to get this format? Jan 5, 2021 15:37:25
i also linked this earlier
or you can just do .toString()
Funniest thing about Zeit Now is that it's actually AWS restricted by Zeit to only allow what they want and given to you for free until you reach the limits (that are rather low)
It literally is AWS
Is there some kind of newbie page for this channel that answers such faq entries as "where can I get free hosting", "why not glitch"etc?
We seem to answer these questions an awful lot
Should be a GitHub wiki or something
You have to know what tag to search which is only useful if you know it's there already
Also iirc only mods can add tags? I'd happily contribute to a FAQ wiki
we need as the hermits of #development to create a C+P paragraph
d o n e
help me change it
I just got the basics down

I will very soon be copying over stuff from #502193464054644737 (about 2 hours)
python isnt exactly the 'easiest' to learn with bot making
ik but it's one easy to learn
its somtimes harder infact cuz people overestimate their ability after spending 5 mins with python
Python peh
Back when I was a kid we programmed in BASIC. You could feel like a programming god in half an hour with that
Having an issue where I can just directly pass the CreateEmbed object to CreateMessage::embed and I'm not sure how to work around this since I don't want to pass a function ```rs
#[command]
fn info(_ctx: &mut Context, msg: &Message) -> CommandResult {
let embed = CreateEmbed::default()
.title("Rin bot information")
.description(
"..."
)
.field("Owner", "Dream#0009", true)
.field("Github", "aapriI/rin", true);
msg.channel_id.send_message(&_ctx.http, |m| m.embed(embed))?;
Ok(())
}```
You still code in BASIC @green kestrel
well some schools
in UK
still does Basic
I uh, grew out of it, like babies grow out of nappies
I think Python is decent to what it does
It doesn't scale for big programs but is really a great beginner language
Basic I mean
yes
python is actually decent for big scale projects
It is decent
however the only problem I find with python is how it likes to take a lot of ram
Python tries to be what basic was but is still kind of advanced for a pure beginners language, a beginner's programming language shouldn't go anywhere near objects, classes, or even modularity imho
It's too much for someone to take in who's just learned what a variable is
Most interpreted languages take a ton of ram
Someone had a go at me last week for running 10 shards for 480 servers, because each was a thread, "but threads are 60+ megs each" not in a compiled language they aren't
aaaaa i still can't figure this out and i've been trying for a while now
closures are annoying because I want to just directly pass an object
but
@unique nimbus making a bot as a first project is like.... Hmm... Every dev community has them. Gamedev has the newbies who want to make an mmo that does every game mechanic. Osdev has the newbies that want to make windows...
The fun thing is, people are fucking retards when they think that these look easy but will actually make you want to die
Or other large established open source os
I want to go into os development so I'm attempting to get into it
it's tedious but you learn a lot
Python is pretty good with scaling
Had filesystem drivers and all sorts
It's also incredibly powerful with AI
As for ram it doesn't nessesarily use that much just most people don't optimise their code properly
python in ai is pretty good yeah
wish other languages had better support for it
I mean
tensorflow basically focuses on python when it comes to ai
i've never used perl honestly
Tensorflow makes use of alot of python's simple way of workings etc compared to other languages
You can get tensorflow for java
But it's rlly not very good
And perl is alright ig?
yeah that's what im saying
It's just mostly been replaced by subscripts of JS now
Why can't Unicode emojis be saved in MySQL?
The last couple of days I’ve been developing a little app that imports Twitter feeds and saves tweets to a MySQL database; however, I quickly hit an issue where certain tweets would not save. M
idk
It is important to point out that the 3 bytes of utf8mb3 was an optimization chosen to cover "most modern languages". This optimization becomes untrue in MySQL 8.0 because of a number of performance enhancements
so basically no reason to use utf8 anymore, one should always use utf8mb4, but utf8 (mb3) is still the default
@quartz kindle
I'm trying to use this to change it, but I get an error that I don't understand
ALTER TABLE table_name CHANGE column_name column_name VARCHAR(140) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL;
error:
Missing comma before start of a new alter operation. (near "CHARACTER SET" at position 63)
Discord.js
How come the bot won't send a message to the specified channel?
client.channels.get("648064713132867584").send({ <embed> })
```The code before and after this bit is working. It's not in any kind of `if () {}` or any other thing to check it... I'm all out of ideas.
are you sure the channel exists
Collection#get can return undefined if it doesn't exist
Yes, I directly copied the channel ID. Also, no errors.
perhaps you copied the incorrect id
Nope; no other channel received the message.
I’m new to making bots and I keep getting an error in my logs saying “ discordAPIERROR : missing permissions “ how would I give it the permissions it needs to play music in vcs
Also am I allowed to put image of error in chat
Enable the permissions for VC.
In the server? Beacuse i already did
Is it just me who is experiencing problems which MongoDB deleting the entire document sometimes?
@earnest phoenix which language and library
Yea I already did that would you mind looking at my code ?@floral bloom
it could be you're doing something wrong
Okay, let's go to DM so we don't crowd the chat.
Ok
Are you using JS?
so you're just using the native driver
yes
do you have any code that you think can be the cause of the problem you're having

like when i update a document, it will sometimes update it perfectly and sometimes delete the entire document
and i used too many sometimes
If a discord.py bot is sharded, do the shard ids remain the same? If so, do the servers which have been previously put on a shard stay on that particular shard?
I dont have experience with sharding because my bot is still 900 servers away from reaching the point that needs sharding
f same
@distant plank collations are set per database and per tables
ALTER DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE tablename CHARACTER SET utf8 COLLATE utf8_general_ci;
you can also change individual columns. your error says its missing a comma, idk which database version/edition you're using
@floral bloom are u doing ({embed: somethingEmbed})
({embed: {
color: 0xffff00,
title: "Etc."
}})
why dont u use rich embed
do js let embed = new Discord.RichEmbed() .setTitle("Etc.") .setColor("0xffff00") message.channel.send({embed: embed})
@empty owl I dont think you need quotes with 0x
Wait whats the problem 👀
I'm just faster with object based embeds.
Object based embeds are better
people have different preferences
I use both
Can somebody answer my question above, please?
ok thats fine guess i will just ask somewhere else
ok
@quartz kindle phpMyAdmin SQL Dump
-- version 4.8.5
Versión del servidor: 8.0.13-4
-- Versión de PHP: 7.2.24-0ubuntu0.18.04.1
that comes out when i export it
Just in case you haven't, you also need to grab the guild, so either grab the guild with message.guild or bot.guilds @floral bloom
@slender mountain I don't see how that'd be an issue because I detect deleted messages and use the same thing and it works.
I am making a Beyblade game bot and when I need to call out for a special move of a specific bey, I will require the Bey’s file and execute the special function. But it outputs in the console that special is not function. I am sure that I got the correct file and constructor. Here’s my code
are you sure there is special method in the Beyblade class?
its in the ace dragon class which extends the beyblade class
super.special just sets a value to 0
@floral bloom lol I never actually knew that the client had a collection of channels. I just tested it and it worked for me so it must be something else?
Mhm, not sure what though.
can I see a bit more code?
I have the end of a if () {} else {} before it and a message.delete(); after it. (delete the author message, nut the embedded message.)
@earnest phoenix can you share your code for ./Beyblade.js?
it's probably not in the super class
@floral bloom
I am afraid I still don't really have enough information or code to really help.
No errors?
it just doesn't send?
@vital lark I think the problem is they set this.special in the constructor
I tested it myself and it used the value from the constructor instead of the method
so i need to give another name to the special function?
Either one, but the function could be ideal
ok thanks
@sudden geyser yea
ur correct
this.special (from that class itself) is a function and a getter
@floral bloom are you still having issues getting the channel?
@sudden geyser Yes, I am.
@slender mountain I'll DM you a code snippet.
Also, sorry, AFK.
np
if you log client.channels.get("648064713132867584") to your console, do you get a channel instance or undefined? Is there an error?
@sudden geyser I get a channel.
try richEmbeds
rich embeds and normal objects are both fine
Yeah, it won't change. Unless my embed has an error and it isn't being caught.
Woo, I found it! I was using message.guild.members.get(memberID).tag instead of client.users.get(memberID).tag. The logs weren't catching it.
@slender mountain ^
Oh lol, so we were looking at the wrong code 
Yes. 😂
Normally it gives me an error for that, so I didn't suspect anything...
haha
No problemo
Should I use db.collection.updateOne or updateMany when I need to update several data for one person? MongoDB, Javascript
@slender thistle a single one like {_id: 123, stuff: “hi”}
updateOne
for single documents use updateOne
ok
Yo I just need some help
I’m new to developing bots, I have tried to load a bot I was developing onto a private server but when I pull up the authorize tab then load the client ID for some reason I get “Unknown_error you may now close this window or tab”
What's the url?
Are you sure you passed the client_id correctly like client_id=1234567890 (numbers being the actual client ID copied)
I believe I’ve figured it out, the problem was that I had to reinstall node. I’m going to try it tomorrow.
imagine having to install node to invite discord bots
Well then yes I’m sure, i’ve tried to input the client id multiple times. The same result has occurred.
console.log(someGoodMornigMessage());

how can i store custom prefixes for servers? like !setprefix <prefix> i know how to do args etc but how to store in json or in mysql?
NEVEER USE JSON AS A DB, that over with most people use a SQL db yh
or mysql lool
Mysql is a SQL DB smh
ik

soooo, today's project: implement a dynamic shared object module loader, with the facility to load, reload and unload modules at runtime.



