#development
1 messages · Page 761 of 1
but still most of the time the usage is high due to people not optimising well before python has any real effect on it
People tend to just scatter globals everywhere and never clean them up
Quick Question How Much Bandwidth Would A Normal Bot(Say Moderation) With Rare Send Database Commands Use?No Music Or Stuff Just add Role And Send messages
Holy capitalization batman
not that much
1TB VPS Enough?
lavaplayer > ***
Yeah that would be minimal and even less once intents are released
it really depends on your usage and how big the guilds are
100k
and language
just get a vps with unlimited bandwidth

d.js
ez
@small prairie that bot does what pretty much every moderation bot does and is using 0.2Mbps
the bigger the guilds the more members you're likely to downloaded
download*
limit is 250k
custom lib?
A custom lib probs xD
a custom lib works yea
or just hella optimized d.js if you still want to use it
Private Bot
anything but d.js 
singlethreaded is weak for something as huge as 1 m guilds
members dont rlly effect anything
> Be mee6
> run a modified version of dpy async branch
just like

use java 
mee6 is actually now mostly Threaded rather than asyncio
yeah that's why dyno often breaks lmaoo

That's why I said modified version lol
wait
just make a bot in assembly
hah weak
write byte code
just use discordgo
i manually send binary instructions to my cpu

dgo doesn't do shit for you

just does what it needs to do and connect you to the ws
Disco ded
disco died 80 years ago
ok these jokes are too far
Disco is ded, that's no joke
how to set up all the permissions of one channel on the server to another channel (Discord.JS)
cant you just clone channeL?
I'd like to transfer one channel's permissions to another channel.
File "C:\Users\culan\Desktop\echo\echo.py", line 6, in <module>
import YTDLSource
ModuleNotFoundError: No module named 'YTDLSource'``` i am still giting the same thing
ok just read the error.
i did
yes
path, folder????
PATH the defualt install place of the standard Python interpreture
Meaning of path
Windows path
Featured snippet from the web
PATH is an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located. In general, each executing process or user session has its own PATH setting.
and if its from a seperate folder etc.. you can use from <folder> import <file>
I ain't know anything about this path and folder stuff I'm going back to my old command
Well I have never used it so I don't know what it is
I advise you Learn the basics of python then
Like I said I am going to go back to my old command because I know nothing about those
as we're not going to keep helping you if you dont know the basics where issues can be solved by learning to read documentation and learning the basics
I know basics I have not ever used those in the time I have been coding in python so once again I am going to go back to using my old code
you havent learnt the basics then

im sorry but that is the reality, rather than giving up and going back to old code which might not be the best way of doing it or might go through needless steps. it would benift you overall to learn the basics fully
the basics being:
Importing
Classes
functions
etc...
Not once how about I use path and file and I code for my job everyday not once have I used them

Ignoring exception in on_message
Traceback (most recent call last):
File "D:/Innkeeper/BotStart.py", line 189, in on_message
if str(message.guild.id) in Boot.prefixDict:
AttributeError: 'NoneType' object has no attribute 'id'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Innkeeper\EmbedOrganisers\Paginator.py", line 52, in Pager
await LastSentMessage.edit(embed=EmbedList[Tab])
File "D:\Innkeeper\venv\lib\site-packages\discord\message.py", line 744, in edit
data = await self._state.http.edit_message(self.channel.id, self.id, **fields)
File "D:\Innkeeper\venv\lib\site-packages\discord\http.py", line 220, in request
raise NotFound(r, data)
discord.errors.NotFound: 404 NOT FOUND (error code: 10008): Unknown Message
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Innkeeper\venv\lib\site-packages\discord\client.py", line 270, in _run_event
await coro(*args, **kwargs)
File "D:/Innkeeper/BotStart.py", line 205, in on_message
await CommandsHandler.Main(Data, Toggles=Toggles)
File "D:\Innkeeper\Commands\CommandsHandler.py", line 103, in Main
await Help.Commands(Data)
File "D:\Innkeeper\Commands\Help.py", line 9, in Commands
await Help(Data)
File "D:\Innkeeper\Commands\Help.py", line 95, in Help
await Paginator.Pager(EmbedList, Data)
File "D:\Innkeeper\EmbedOrganisers\Paginator.py", line 54, in Pager
await LastSentMessage.edit(embed=EmbedList[Tab])
File "D:\Innkeeper\venv\lib\site-packages\discord\message.py", line 744, in edit
data = await self._state.http.edit_message(self.channel.id, self.id, **fields)
File "D:\Innkeeper\venv\lib\site-packages\discord\http.py", line 220, in request
raise NotFound(r, data)
discord.errors.NotFound: 404 NOT FOUND (error code: 10008): Unknown Message
``` try except cant catch em all xD, 3 things all going wrong at the perfect timin
There's no current way to get the user that invited the bot right? DJS doesn't have audit log for bot_add yet.
Well that's stable
Right.
Master is actually updated
you'd have to update your code if you want to switch tho
you could probably manually add it too the lib
pls rich
with discord.js, it's possible get max slot emoji for the guild ?
you mean like set it so it has the max number of emojis or find out what it's limit is?
there is
i cant find it in discord.js
i dont program discord.js normally but i do know you can get it /work it out
it will be similar for js
Well... it differs per library
You can use the premiumTier property and just figure out the max slots from there
@digital wagon
Be aware that property is only on the master branch so if you’re on stable, you should upgrade in order to use this
how much fields can an embed have max?
a fuck ton
25
altho 25 feilds looks very messy
I am so confused with this. I have spent the last couple of hours trying to figure out why this exact code I use on my other bot works but it doesn't work now. Help?
I have tried looking on google but I got 0 help on how to fix it. I don't need to be told "Oh, this is the issue" and get not help on how to fix it. I just need help
Probably didn't define commands for your class.
and how/where would I do that? I have been looking back and forth between files for my two bots and Everything is the same
but one bot works and this one doesn't
You would do it in your client's class?
In the constructor.
Here's mine for example. this.commands = new Discord.Collection();
Is there api lag rn?
No
File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\bot.py", line 863, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 728, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 88, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: type object 'YTDLSource' has no attribute 'from_url'``` how can i fix this
code
can't help if you don't send code
def __init__(self, source, *, data, volume=0.5):
super().__init__(source, volume)
self.data = data
self.title = data.get('title')
self.url = data.get('url')
@classmethod
async def from_url(cls, url, *, loop=None, stream=False):
loop = loop or asyncio.get_event_loop()
data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=not stream))
if 'entries' in data:
# take first item from a playlist
data = data['entries'][0]
filename = data['url'] if stream else ytdl.prepare_filename(data)
return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_options), data=data)
@bot.command()
async def ye(ctx, *, url):
async with ctx.typing():
player = await YTDLSource.from_url(url, loop=self.bot.loop)
ctx.voice_client.play(player, after=lambda e: print('Player error: %s' % e) if e else None)
await ctx.send('Now playing: {}'.format(player.title))
that is the code
Can I get some help with that
Try changing the ye
how to set up all the permissions of one channel on the server to another channel (Discord.JS)
clone the channel
Yes
or get bitfield of perms
clone the channel
let a = message.channel.????
message.guild.channels.get('ID').???(a)
you can always use the docs...
"key too large to index"
lmao
const playlist = await youtube.getPlaylist(url);
const videos = await playlist.getVideos();
for (const video of Object.values(videos)) {
const video2 = await youtube.getVideoByID(video.id);
await handleVideo(video2, msg, voiceChannel, true);
}
this code is supposed to get a playlist but if the playlist includes a private video then it will return this error
Error: resource youtube#videoListResponse not found
is there any way I can check if the video is private
How to get random bot emoji? (discord.js)
This is what I want. I need to get 1 random emoji from the guilds where the bot is in
ig just get a list of all the emoji's from all the guilds and randomly pick on, not sure how you would do that in JS but theirs probs a function that gives you a list of the guild's emojis
Thx
Question, for a bot running on Node.js, is the pm2 fork mode suitable enough for sharding?
it should
so I'm making a custom prefix command, but I have a hard-time figuring out how to make the help command show the server's prefix when you ask for help for a certain command
any ideas?
what lib?
you can just use string formatting to change the prefix to what ever the custom prefix is
discord.js
I want this instead of showing the normal bot prefix to show whatever the prefix is set to in the prefixes.json
I can't use the thing I do in the command js prefixes[message.guld.id] because message is not defined

well then get it defined 

JSON databases 
well
json DBs will always be judged
for the long run, we have to warn you
You know how to do it gif be canvas?
JSON dbs are bad to do
JSON should be used for configurations and stuff, not meant for databases
You know how to do it gif be canvas?
what
npm canvas
canvas
For prefixes It's may be nice
no it wont
@maiden rampart late response, but you really just need to get the message instance. You could do it by defining prefix in your help manual/whatever or making it a function passing the message instance.
thx
why does pdo not support reusable variables for sql statements >.>
Any Way To Find Out The "second" Mention I Know <Message>.mentions.first();
d.js
Or Lets Say Any Number Of Mention 5,6,3
Message.mentions Is A Collection?
Nvm
Figured it
you can always read the docs before asking the q
your no. 1 should always be the docs
How Are Mentions Sorted? Ascending To Descending?
d.js
they aren't sorted i think
Everytime I try
they're in an ordinal row, original to how they are placed in the message
https://discordjs.guide/miscellaneous/parsing-mention-arguments.html @small prairie take a look at this, this describes it very well and gives some solutions
Like the Older The account The Less Id It has or whatever
And Its always Getting Sorted Like That
ignore all the references to other code
message.mentions
What I am Working On Has 3-4 In One String
how many mentions in one cmd?
function getUserFromMention(mention) {
if (!mention) return;
if (mention.startsWith('<@') && mention.endsWith('>')) {
mention = mention.slice(2, -1);
if (mention.startsWith('!')) {
mention = mention.slice(1);
}
return client.users.get(mention);
}
um no
wait no
Cant Be Done?
mentions are just sorted how they are in the message
apologies thats not what u were searching for
@mention1 @mention2
idk but thats how it says in all documentation
message.mentions.users.first()
message.mentions.users should be a list
if im correct
yes, but its still gonna start with the lowest id
since fucking when
then why not just use message.mentions.users[listnum]
Idk Ruining My Project Tho
i guess regex the message content yourself
nah its a collection
thats how it works in eris
oh lol i code in discord.js and idk if im right or wrong
If I convert It To array and Console.log that
Its Still ordered as id
sorry idk what eris is
i said d.js uses collections not that
yeah thats right
eris is like discord.js but not discord.js
eris is another module (i think it's called that) that is coded and used for discord bot coding in js
I did a little coding in eris :/
Tried Around eh didnt like that as much
@small prairie you should try getting the mentions from message.content directly
thats what you are supposed to do?
yeah, but i mean, not using message.mentions
what are we trying to do again
yes there is! im trying to explain it rn
@knotty steeple Getting Message.mentions In Sort As It Is In Message
Like <mention1> <mention2> <mention3>
Not Ordered By Their ID
but why
for some wonderful reason i'd Need to Use message.mention.second
lol
basically, get message.content and manually get the id between <@ and > using regex
then just do client.users.get(id you got from message.content)
thats what i would try
Eh You Dont Understand Really But I got A Thing In My Mind That Might Actually work
im sorry, thats what im getting
getting the second mention from that should be possible that way
Damn How Do People Type Like This
Eh I AM Pretty Used To This
My Pinky Finger Just Goes To The Shift Key
I Dont Even Notice
Mechanical Keyboard Helps
do you code like that
Lmfao No
lol
languages are case sensitive RIP
But I Do Write My message.channel.send(s) Like This
very general question:
whats the best dbms or database to use if you need to store large amounts of user data and update it, while being shards-compatible and relatively easy to use?
there isnt a best db
you can use mysql or mongo or postgres or mariadb
you can even use sqlite if you try enough
except sqlite
sqlite is ass
Why is sqlite not shardable? 
its a file
Right
i think its because it drops to a file or something
I know nothing about sharding tbf.
Bot won't get big enough to need shards 😏

the biggest bot ive made had like 150 guilds but it was a furry bot a year ago
lul
i just wanna make sure abt the sharding and stuff
im pretty new to using databases, so i apologize for all my dumb questions
I feel attacked.
better-sqlite3
110 servers

so far i've just been using enmap over sqlite
just bc its super easy to use and set up
enmap is not a database
yeah i know
Time to learn postgres
ew postgres
why not 
i dont like postgres
Would you recommend mongo instead?
lmao
isnt enmap an orm? i just dont know the name for it
or was it like dbms
Yikes
im just gonna look that up, idk what that is
ohhh okay
i understand
ig im gonna try mariadbb
mariadb

I feel goofy as why I don't understand why sqlite can't be used in shards.
Like doesn't mongo store in a path as well?
is Keyv also just based on map()?
Yeah.
you just write to a file
mongo is literally glorified json but it is also a "db"


eh
here comes cyber
nothing to do with json really
lul
someone else said that
yes it was you
no
Like
MongoDB stores data in JSON-like documents that can vary in structure

sqlite is shardable lol
yh
just because it stores data in a single file doesnt make it json
hell even json supports sharding if you do it properly
Does anyone know how one can set a /64 IPv6 block without writing a million lines in my netplan file
idk what netplan is but most ip-based things support using / addresses, did you try writing it literally?
Well, I currently have 512 addresses and created a small script and copied it into /etc/netplan/01-netcfg.yaml
Ah Did it
But with a /64 block I would have to write 18,446,744,073,709,551,616 lines
512 addresses is a CIDR of /119
i dont know where in the config file you need it, but from random examples on the internet i see that it should support the / syntax
I don't think that's IPv6
What site is that?
Netplan is a YAML network configuration abstraction for various backends. It allows for easily configuring networks by writing a YAML description of the configuration and translates it to the format for the chosen backend, avoiding you the need to learn multiple config syntaxes.
Hm
local or public?
public
you cant
why :-;
most ISPs supply dynamic IPs so they change every few weeks
you can, depending on your ISP
oh that's good
not many allow changing of public ip unless its buisness version
even then its hard enought bh
what can I do against a crackhead that tracked my ip?
yeah things are probably stricter now, but 10 years ago you could simply reboot your modem and you'd be assigned a new IP (ADSL)
@quartz kindle ok gtk
on BTs older gen 5 routers
sky, virgin etc dont but BT routers do still get a new ip on every reboot
I have a fuckin FritzBox xD
how did u get IP tracked anyway
if your modem allows for it, you can set your own static IP and try your luck with the ISP assigning it lmao (which most likely wont work)
just fyi with that
if you try it
and it doesnt work
u will cut ur internet
xD
until he sets it back to dynamic
I was playing some Csgo and some dumbass called my ip and location out.
@modest maple
not a massive thing tbh
well, nothing he can really do with that
*
bearing in mind most ISPs now block most DDos attacks
and somtimes routers also have systems in place to prevent it aswell
K
yh
the only way to protect your IP is a VPN
buT wHaT abOuT oNiOn LaYeRs
literally the same thing lul
ik xD
also freenet > onion
I'm getting frustrated with trying to setup my database properly (I'm using mysql for reference) and what I'm trying to do is to get one account to pull up a specific table for each entry they receive (ex. if they have multiple character profiles and they want to pull up a specific character from that profile). Is it even possible for me to do it or have I been going about this the wrong way?
the best approach would be:
table1 -> users (column for unique id and column for array of character ids)
table2 -> characters (column for unique id and column for owner id)
thank you so much!
yeah that's why tables are good to work with
can some one help me
Im coding music nodes but nothing is wrong yet it dosent work ill send the code
wait hold on I have to send it in parts'
Send it as a file
or use hatebin or somthing
- not here ty @earnest phoenix
- go to hastebin
paste it there
save it
send us the link
yes
nothing is wrong
thats a bold statement considering it doesnt work lmao
oh its js
yeah
@quartz kindle youre up <3
i need sleep :(
alright ill come back tomorrow then
rip
Anyone knows why the bot start throwing this error: cannot send empty message.
It’s not any of my commands, it doesn’t show that at least.
what's the full stacktrace, yeah
Well what is this message you're trying to send the
well you sure are trying to send an empty message
The problem is I’m not trying to send anything
check your event handlers

from what i'm seeing you have a database, i'm going to assume you have some string users can modify
i'm aware
reread what i said
you're probably trying to send that empty string in some event handler/command

i'm going to assume you have some string users can modify
can you confirm this? so i don't go helping on assumptions
It's trying to send something
recheck all of your send methods then
The problem is it’s not saying where
i told you to handle your errors properly and then you would know where
I can’t go in every command and check every line 
if you're using an IDE, which i hope you are, search functions exist
Using atom tbh
Atom has a search function
the first error is internals and the second one is irrelevant to what we're talking about @modest maple
Fairs
computers can't lie, so you are indeed trying to send an empty message somewhere
would it be an input string or hardcoded
huh?
night night
Why
\:emoji name:
Doesn't work?
discord.js -> node-opus or opusscript ?
I found out why the error was emitted
I think it’s because of the say command
Today gonna self host and test every command
Hey there, if anyone want a library to paginate/categorize messages with JDA I just uploaded the first public release of my PaginationUtils library
https://github.com/ygimenez/PaginationUtils
I'll add more methods to it, but it already has the core functionality done
I am doing an economic bot. Now I am doing boosters, how can I make them end after a certain time? I need to execute some code after n hours after a person bought a booster. How can I do it? (discord.js)
That is, execute the code after a certain time after writing the command, even if the bot is rebooted
have a db with time stamps of each user who has done boosters
and just have a loop checking if the time stamp has past
Thx
const prefixRegex = new RegExp(`^(<@!?${client.user.id}>|\\${prefix})\\s*`);
if (!prefixRegex.test(message.content)) return;
let [, matchedPrefix] = message.content.match(prefixRegex);
``` Can someone tell my why if the prefix is more than one character, my bot wont recognise the command and how should I fix it?
@digital wagon both the same
hi
@earnest phoenix why are you using regex for a prefix
it's a prefix, you just have to check if the string starts with it
@earnest phoenix I also need to have mention prefix
ok
this is the most effective way i can do do it with my knowledge
i need to check if the prefix is a mention or just a normal prefix quickly
you do know
you could just check if the message starts with the prefix OR the bot is mentioned
so I have const { Client } = require('discord.js') const bot = new Client() bot.login('tOkEn HeRe')
will this work?
it should do but i advise having your token in a seperate file
i just wanted that https://tryitands.ee 
tho, why should the token be in a separate file?
hardcoding the token is bad
if u ever want to make a repo out of ur bot then u cant commit the index file if it has the token in it
without the token getting regened
but if u make a config file u can ignore that and commit the index lol
still better practice to hardcode as little shit as possible
If I would, I would store the token in a file
And then gitignore it or put it in a parent folder
honestly having all ur config in one place just makes ur bot a lot easier to manage if nothing else
yh
like
it does get to the point where sure you can have it in one file
but the bigger it gets the messier it gets
no u
my rather messy project rep
my profile is just full of repos i start working on and then lose motivation 2 weeks later lol
mine consist of my fuck ups
just me failing to use github really
20% clojure, 20% CPP 60% python xD
m
http://prntscr.com/qigniq that meta description is incorrect
eee
i think im gonna buy dbl.site domain to redirect to top.gg
Not in here please
@earnest phoenix do your bot :p
Lol
Shino u rat
Do u get it because shino is a Remote administrator Tool
So u are a R.A.T
this doesnt belong in #development
const Discord = require('discord.js')
module.exports.run = async (client, message, args) => {
client.on('guildMemberAdd', member => {
let autenticando = message.guild.roles.get('ID');
// Adicionar o cargo autenticando ao membro
member.addRole(autenticando.id);
member.guild.channels.get('ID').send("clica no emoji").then(msg => {
msg.react("✅");
// aqui você coloca o coletor de emoji
})
}```
why error
which error
whats the error
bad syntax or duplicate event listeners
unexpected token
I can see on one look the syntax might be wrong.
Another error will be you are flooding your bot with memory leak
You aren't closing your .then
?;çç
copy pastas be like:
Code In function:
Thread = threading.Thread(target=SearchSite, args=(Data, 2, Url)
Thread.start()
while Thread.is_alive():
await asyncio.sleep(0.5)
Subrutine in error:
def SearchSite(Data, Toggle, **kwargs):
global Website, Name, Desc
url = kwargs.get("url", False)```
Traceback (most recent call last):
File "C:\Users\ChillFish8\AppData\Local\Programs\Python\Python37\lib\threading.py", line 926, in _bootstrap_inner
self.run()
https://app.reroll.co/marloso2/174891
File "C:\Users\ChillFish8\AppData\Local\Programs\Python\Python37\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
TypeError: SearchSite() takes 2 positional arguments but 3 were given```
anyway i can fix this?
i think its because the threading module doesnt like **kwargs
if(command === "help") {
const embed = new Discord.RichEmbed()
.setTimestamp()
.setTitle(`*Commands* - ${client.user.username}`)
.addField("Buy", '`' + prefix + 'buy` Creates an channel for you only.')
.setFooter("Luca's Bot")
.setColor("#9370db")
message.channel.send(embed)
}``` it stops when i execute this
Wdym "stops", does it crash? Does it go offline? Any errors?
no error
i test run it in terminal and it just creates an new command line and stops the bot
and the cmd after it works fine
@twilit rapids
No idea then
@twilit rapids @earnest phoenix DM Advertising and spoonfeeding
that isnt it
dm advertising isnt allowed
same for spoonfeeding
@surreal sage can you send me a screenshot of what they send
busted
The simple answer as to why we do not spoonfeed, is it does not help you learn.
If you come in this server and ask a question that has a very basic answer, and you do not know how to figure out this answer...then put quite bluntly, you need to learn more. What we will do, is point you in the right direction to learn what you need to. By simply giving an answer that you, most likely, cannot then figure out why it is the correct answer....you learn absolutely nothing.
All developers need to learn some very basic things:
How to read docs
How to read tracebacks/errors
How to figure out where to look
Would your question be better suited to simply google?
Is your question in the docs, quite clearly?
If you think about your question, do you think it's probably been asked many times before? Have you tried the FAQ?
Whenever you are "not spoonfed", you are being assisted in how to do one of the above. Don't be unnapreciative, it is the type of help you need, whether you want to admit it or not.
gd to post that
bout to get beaned for ads
What kinda programs should I make to get used to the syntax of a programming language I am learning
idk
Does it have exercises?
y
mhm
whats the language shiv?
Fucking Spotify...
C#, Chilliilili
I literally only need exercises
if(command === "help") {
if(args) return;
const embed = new Discord.RichEmbed()
.setTimestamp()
.setTitle(`*Commands*`)
.setDescription('`!buy` Creates an channel for you only.')
.setFooter("Luca's Bot")
.setColor("#9370db")
message.channel.send(embed)
}```
i removed it
ok rip i didn't know codeacademy has the most important programming aspects set for premium-only
if(command === "help") {
const embed = new Discord.RichEmbed()
.setTimestamp()
.setTitle(`*Commands*`)
.setDescription('`!buy` Creates an channel for you only.')
.setFooter("Luca's Bot")
.setColor("#9370db")
message.channel.send(embed)
}
i do not have any errors
does the bot respond to other commands after you did 'help'?
y
then i guess the if-statement block isn't executed
Codeacademy be like pay2learn
yeah apparently rip, sorry i only knew codeacademy for learning languages online but i never really used it
Why the f did I save this anyway https://code.sololearn.com/ct1zPIHr1plP/#cs
j g
?
yes
have you tried reading what it says
wait
if(command === "help") {
const embed = new Discord.RichEmbed()
.setTimestamp()
.setTitle(`*Commands*`)
.setDescription('`!buy` Creates an channel for you only.')
.setFooter("Luca's Bot")
.setColor("#9370db")
message.channel.send(embed)
}```
remove that console.log
thats an test
and it breaks your code because setTimestamp cant fucking chain on console.log
wouldn't that produce an error?
correct
does anything log at all
embed.build
what
this is discord.js
this shal work
the embed should be sending, and if it isn't it should be logging an error
are you on stable or master

Pepe
:///
are you on stable or master
how to change the permission for "@\everyone" and the author
if (command === "help") {
const e = new Discord.RichEmbed()
.setTitle("Commands")
.setAuthor(client.user.username)
.setThumbnail(client.user.avatarURL)
.setColor("#9370db")
.setTimestamp()
.setDescription("`!buy`")
//send
message.channel.send(e)
}```
what
message.guild.createChannel(`${message.author.tag} (${message.author.id})`, { type: "text" } )``` i got this
but i want to change the perms of @everyone and the author
i just looked but i dont understand
because createChannel can include permission overwrites
question:
if you have loads of data (objects, values, etc) that needs to be accessed fairly often but never changed, how would it make the most sense to store it?
if your memory allows it you could store in memory, so store in your code and call it from there
its fixed
nice
AHH
if (command === "buy") {
let channel = message.guild.channels.find(ch => ch.name === `${message.author.tag}`)
if(message.channel.type === "dm") return message.reply("This is DMS! :x:");
if(channel === true) return message.reply("You already have an channel! :x:");
message.guild.createChannel(`${message.author.tag}`, {
type: "text",
permissionOverwrites: [{
id: message.guild.id,
allow: ['VIEW_CHANNEL', 'READ_MESSAGE_HISTORY', 'READ_MESSAGES'],
deny: ['SEND_MESSAGES', 'MANAGE_MESSAGES']
}, {
id: message.author.id,
allow: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'VIEW_CHANNEL', 'READ_MESSAGES', 'SEND_TTS_MESSAGES'],
deny: ['MANAGE_MESSAGES']
}]
})
let channel = message.guild.channels.find(ch => ch.name === `${message.author.tag}`)
//open embed
const openEmbed = new Discord.RichEmbed()
.setTitle(message.author.username)
.setDescription("Welcome to your channel!")
.setThumbnail(message.author.avatarURL)
.setColor("#1e90ff")
//open embed end
channel.send(openEmbed)
}``` but here it does not know "channel" of unknown (null)
@errant swallow what language
javascript with discord.js
just discord.js is good
im just storing it in .json rn but that seemed kinda cheap
and bad
we can ignore that link
yeah i was hoing to ask wtf lmao
i dont think pickle.js is the same a pickle with python
in python you can use pickle to store objects
if the data is pulled and updated very often, use an actual database e.g postgres
as i said, its just static data that only needs to change when i do
if not so often, use sqlite which is minimal and still efficient
okay, thanks for the help, but i'm more looking for something i can edit as text in a file
do you have dynamic data or static data
AAAHH im sorry i didnt give any context
so basically, i have loads of static data, and i want it to be easy to modify when i need to tweak something while coding
then a json file is enough
okay, thank you!
just wanted to make sure
to reduce memory and cpu load read the json file once on boot and save the data it returns and pass it around in your application
yeah, im just gonna require it in my main file
require uses cache anyway so it wouldn't make a difference?
Does the https://top.gg/newbot host a bot i create and keep it online? I have no idea how it works. I have a bot i want hosted for me, its a custom bot for a browser game i helped contribute to.
Rather then point me to the FAQs, why not explain it to me.
because the faq explains it but sureeeeeeeeeeeeeee
Top.gg does NOT host you bot nore is it the place to start making a bot with.
If you want hosting your only good options are:
- Get a cheap VPS
- Self host
if anyone says glitch or heroku dont even think about it
FAQs exist so we can easily help people with questions that are asked often rather than explaining it 80 times a day

i mean allow me to reitterate what i said in more detail:
If you haven't made the bot, but you want to, start here:
Figure out if you want to start making a bot using code;
- Coding a bot requires the knowledge of a programming language.
- If you want to learn from the beginning, you can find a good guide here: https://anidiots.guide/getting-started/getting-started-long-version
- You can ask for additional help with bot development in #development.
If you don't want to learn how to program and start from scratch, you can jump into bot development with: https://store.steampowered.com/app/682130/Discord_Bot_Maker/
Important things you should know:
- If you created a bot on https://discordapp.com/developers/applications/ you must code that bot yourself and then run the code for it to come online. There is no way to "turn on the bot" or "power it on". Bot's are run using code and require code in order to have functionality.
- Bot development does NOT start with adding your bot to https://top.gg/.
- You can ask for help in #development but do NOT expect to be spoon fed (for information on what spoon feeding is, see the top definitions on it here: https://www.collinsdictionary.com/dictionary/english/spoon-feed)
Boi
he wont notice that i just C+P that off faq
/app/bot.js:51
})
^
SyntaxError: Unexpected token )
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)```
help
error
faq literally means frequently asked questions and it's there to answer your frequently asked question lmao
add ';'?
Remove ) @cunning sedge

;-;
I had to do this to handle two versions.
@digital wagon english please
excuse ^^'
no
its the fact that we speak english
and would rather not translate everything you put
also
you dont need todo that / you should idk what ur doing to need that but okayyyyyyyy
Sorry, I'm used to writing in french, so I made a mistake :/
How to format an Collection?
wym "format"
yeah
how to make it log the data in it
.toString()?
lol
ok gonna try
it does work you just arent doing it properly
axeval const formatted = message.channel['messages'].toString()
message.author.send(formatted)
this is what i use at eval
waiittt
bot commands can do things here
axeval message.author.send(message.channel.name)
shal
const collection = message.channel.messages
message.reply(collection.array())``` work?
you'll have to fetch the messages right
using TextChannel#fetchMessages
then that returns a promise of fetched messages
and your attempting to send an array
when reply needs a string
const collection = message['channel'].fetchMessages()
message.reply(collection.array())```
wait
idk why not just use message.channel
i get on the phone later
alright
does that work?
the code?
nvm
I mean both work
TypeError: SearchSite() argument after ** must be a mapping, not str
the code was Thread = threading.Thread(target=SearchSite, args=(Data, 1), kwargs=Url)
oh
nvm
i updated the wrong code
splish splash turns out its still broken
splish splosh fixed it
Did you try turning it on and off again
Im looking for a bot developer that can make a custom bot to connect channels of different discord server's, so a bot for cross server chat, please pm if you are a bot developer that can do that for me
@sudden inlet not the place to ask here
Ok 👍
How to export an chat to an file and respond with the file
but how
i know something with
const athingie = message.channel.fetchMessages()```
idk then
search up in js how to write content and export a file
no
well then
idk what else u want me to say then
if you want to send a file with the stuff in
YOU HAVE TO WRITE THE CONTENT TO THE FILE FIRST
we're not here to spoon feed
Can anyone help me make an anti raid?
- we dont spoonfeed
- you can program / should be able to program it yourself if you want it rather than asking somone else to make it for free
- if you are offering to pay or want buy i suggest Fiverr rather than here unless you want to make an offical listing for a job offer


CD do I know you from another server?
idk
@copper cradle
we are in dev servers
and I did an anti raid but it didn't ban the fake accounts that were raiding too much
my server was attacked today


failure in the code ig then
@twilit rapids fucking change or nicks back
- You could ask nicely
- No, because you have ads in your status
i do not have an ad in my nickname
ok sorry
Can you please change back my nickname?
toxic much
Did you even read my message?
no
😩

Literally still telling to invite
lmao
now good?
If I ever see you with status ads again it will never be changed back
time to wip out ye old status logger bot
#memes-and-media now please
What's the difference between private and protected in C#?
Access modifier?
yep
Private: The type or member can only be accessed by code in the same class or struct.
Protected: The type or member can only be accessed by code in the same class or struct, or in a derived class.
C+P Microsoft docs smh
xD
bruh
I'm doing discord bot tutorial on my YT channel
no advertising
no being noob
yah no
no being idiot
didnt need that either
pretty much

add what
- is the custom stats (online, dnd, away, and 'the bot is doing something' ect)
what lib
- is the mentioning people
what lib
bots can't have custom status
you can set status's
and <@!id> format aswell
ooh oki ive been trying everything for the custom stats XD
the exclamantion mark formatting is just for detecting mentions
it today does nothing
oh oki
oh did they fix that?



I was tad bit lazy soz