#development
1 messages · Page 1698 of 1
Ah ok 😀 thank you
and show what's inside of index.js
e.g.
Are YouTube channel command have nsfw content?
I don't think YouTubers are allowed to upload NSFW content, but that varies.
YouTube does have NSFW content in its massive platform, I have seen a lot of playlists that are questionable
they are sort of, but they wont monetise the content
there are a ton of videos from wars where people die, and they still on yt after 8 years
Yeah, but then again, that doesn't mean YouTube is allowing that kind of content
YouTube has a lot of nsfw thumbnails, but little amount of actual nsfw
But it is still nsfw
Can anyone recommend me a free bot that can announce youtube videos but I can customize the message
Yes, thumbnails can very easily be considered NSFW
especially in those borderline educational videos like breastfeeding tutorials etc.
use IFTTT and make a webhook
ifttt is pretty easy to use
just search for a tutorial on yt
but using webhook u need to send it urself
i mean like auto
it's auto
google ifttt
ifttt is actually a pretty useful platform to automate stuff
and it's free
oh wait
apparently they turned it into a paid service
sad
then your best bet would be just to use mee6
although I don't think you can customize the message
welp i need to pay premium for that 😦
i think yes
That error is saying you're trying to call setlocale, but the object you're trying to call it on is undefined
See this 2 pic and s say me why my command won't run when I ping someone 😭🙏
Pls
@earnest phoenix this is with all of my command where I need to ping someone
Yes js
i cant make snipe command
what can we do?
how did you handle it? if you use JS there is quite an easy way to do it
What to do
const user = message.author || message.mentions.users.first();
``` should give you the message author when no one mentioned, and give you the mentioned user if mentioned
if you want to list the roles you have to get the member object not the user object
ㅋ
@lusty quest no bro
I am not getting any error
My command was working
And now don't know why but my all commands where I have to mention or tag someone it will not work see pic bro I gave
In that 1st) pic see it's working
But in next if I tag anyone no response
?
post the entire command here
if its a large snipped use hastebin or something like this
Ok
module.exports = {
name : 'kick', //command name
category : 'moderation',
timeout: 2,
run : async(client, message, args) => {
if(!message.guild.me.hasPermission('KICK_MEMBERS')) return message.channel.send('I do not have permission');
const Member = message.mentions.members.first()
if(!Member) return message.channel.send('Please specify a member to kick');
await Member.kick({ reason : args.slice(1).join(" ")})
message.channel.send(`${Member.user.tag} was kicked from the server!`)
}
}```
See this also same problem
you probably also want to check the permissions of the message author. just a thing i notice
bit overall it should work
i dont touch repl.it
also hasPermission is deprecated use permissions.has() instead
also you probably want to check if you can kick the member with Member.isKickable() -> prevents unnecessary API calls
All is there @lusty quest
See commands will work if I not mention or tag anyone
Wait I shall give u 1 example by pic
@lusty quest
?
why do you now take another command with in the mix? fix one then the others
No I iam just say all having same problem
I am asking is it api problem ???
Maybe ??
module.exports = {
name : 'kick', //command name
category : 'moderation',
timeout: 2,
run : async(client, message, args) => {
if(!message.guild.me.hasPermission('KICK_MEMBERS')) return message.channel.send('I do not have permission'); //--> hasPermission() is deprecated use permissions.has() instead
const Member = message.mentions.members.first()
if(!Member) return message.channel.send('Please specify a member to kick');
//i suggest to add a check if you can kick the member --> member.isKickable()
await Member.kick({ reason : args.slice(1).join(" ")})
message.channel.send(`${Member.user.tag} was kicked from the server!`)
}
}
```here are a few suggestions
console.log your member inside the command
and see what it returns
Ok
Can anyone recommend me a free bot that can announce youtube videos but I can customize the message?
i know a bot that can send notifications, but you probably wont find a free one for the customisation unless you make it yourself
just kitrobit
but it's down right now
so im trying to find a new one
pingcord also works
const Discord = require('discord.js')
module.exports = {
name: 'serverinfo',
run: async (message, args) => {
const logo = ${message.guild.iconURL()}
const embed = new Discord.MessageEmbed()
.setAuthor(${message.guild.name}, logo)
.setColor("#FF005B")
.addField("Server Name", message.guild.name, true)
.addField("Server Owner", message.guild.owner, true)
.addField("Total Members", message.guild.memberCount, true)
.addField("Total Roles", message.guild.roles.cache.size, true)
.addField("Total Emojis", message.guild.emojis.cache.size, true)
.addField("Date server was created", message.guild.createdAt.toLocaleDateString("en-us"), true)
message.channel.send(embed)
}
}
Why the owner code says null
isn't it supposed to be guild.owner.displayName or .nickname?
hi
what does this mean The rest parameter eliminates the need to check the args array and allows us to apply map(), filter() and reduce() on the parameters array.
How to make the command that only the owner of the server can use ?
In what language?
It means that the owner wasn't cached. You either have to fetch the Guild.ownerID or just display <@${Guild.ownerID}>
It means that the parameters passed into a function that uses a rest parameters is put into an array, allowing you to use those array functions. As opposed to being put in the arguments object when you don't use a rest parameter
Isn't that the spread operator
Check that the author of the message is the same as the owner of the server
Yeah, but when you use the spread operator in a function definition, they call it a rest parameter
it's the ...arg ,right?
Yeah
Do you mean the arguments passed into the function?
Yes
Basically, when you put it into an array, due to the rest parameter, is it now called an array function?
No, you don't put it into an array, it's automatically put into an array if you use a rest parameter
The rest parameter syntax allows a function
to accept an indefinite number of arguments as an array, providing a way to represent
variadic functions in
JavaScript.
Learn something new every day 
.. and what do you mean by this, please. As opposed to being put in the arguments object when you don't use a rest parameter
It's all explained in the link
in summary, please
What your quoted is the summary...
i assume eng is not ur first lang
same
Basically function (... args){}; the ...args is what rest args are
instead of doing Array.from(arguments).slice(1) it gets its own var
as opposed to function myFn(arg1, arg2, arg3, arg4) {...}
Although, you could access that like an Array with the arguments key word
var arrayVar = [];
function(some, other, vars, ...restArgs){
[].push.apply(arrayVar,restArgs);
};
ah, alrightt
Except arguments is an object, not an array, you would have to convert it to an array first
how could I run my bot and make it online for testing command in vs code
i am having some issue
Object.values(arguments) 
Not that much extra work. It's all ordered as well
I'd still rather use spread
if you use js i can recommend nodemon
I think they're talking about running it in a debugger
The spread operator just reduces the amount of work you have to do
not here pls
;-;
guys pls link to sign to github
@quartz saddle do you also got this impossible enigma to solve???,
what enigma?
give sign up
i wanna create an acc
ok
show me a screenshot of this impossible enigma
its for some cubes with numbers
and there is 10 like these randomized
in a little bit of time
!!!
i think thats something on your end, github doesnt use anything like that
unless they do and ive never seen it
here, try this link instead https://github.com/join?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F&source=header-home
@earnest phoenix
i didn't see that when i was signing up
..
yeah, me neither
or atleast as i remember
and neither have i ever seen it on github ever
illl try cyber voice
like
it will says some nubers
and i need to write them
oof now i signed up
Is there a way I can make this easier to do so I don’t have to make each one for ever word
Dw abt the inspire command right in the middle
ok
don't bother with profanity filters in the first place
read from here
Oh shit
oh speaking of where can i find a list of accented chars so members won't use them to sneak a banned word
if someone wants to say a slur or a swear word, they'll find a way to say it 🤷♂️
Yeah I should have thought abt that
I finished my new Website UX design 
@vivid fulcrum mans basically just said it’s usless @waxen bough
yup
well
May I ask if trying to make one for my bot sooner or later where can I start?
@slender thistle new transword website is done, poggers
it's like placing a chair in front of someone to prevent them from walking further
they can just go around the chair
well
idk, it seems most bot devs have a website now these days
but i don't think it's a requirement honestly
there's no prerequisite to being a bot developer with a webpage
I just want one so i can store all my commands
where can you start? i mean just buy a web domain and start coding i guess
Oh ok
i heavily recommend github pages for this
^
github pages are clean
this is my current design, i have to fix a few errors left in it though and still not too satisfied
https://transword.xyz/new
const bot = new Discord.Client();
const config = require('./config.json')
const fs = require('fs');
bot.commands = new Discord.Collection();
const mongoose = require('mongoose');
bot.login(config.token);
mongoose.connect(config.mongourl, {
useNewUrlParser: true,
useUnifiedTopology: true,
useFindAndModify: false,
useCreateIndex: true
}).then(console.log(`Connected To MongoDB !`));
//COMMAND HANDLER
fs.readdir('./commands',(err,files) =>{
if(err) console.log(err);
let jsfiles = files.filter(f=> f.split(".").pop() === "js");
if(jsfiles.length <= 0) {
console.log(`NO COMMANDS FOUND !`);
}
jsfiles.forEach((f,i)=>{
let sss = require(`./commands/${f}`);
bot.commands.set(sss.help.name,sss)
})
console.log(`LOADED ${jsfiles.length} COMMANDS !`);
})
//EVENT HANDLER
fs.readdir('./events/',(err,files)=>{
if(err) return console.error();
files.forEach(file=>{
if(!file.endsWith('.js')) return;
const event = require(`./events/${file}`);
let eventname = file.split('.')[0];
console.log(`Loaded ${eventname} Event !`);
bot.on(eventname , event.bind(null , bot));
});
console.log(`Loaded Events !`);
})```
giving me error
is there any issue
not like that
const Discord = require('discord.js');
const bot = new Discord.Client();
const config = require('./config.json')
const fs = require('fs');
bot.commands = new Discord.Collection();
const mongoose = require('mongoose');
bot.login(config.token);
mongoose.connect(config.mongourl, {
useNewUrlParser: true,
useUnifiedTopology: true,
useFindAndModify: false,
useCreateIndex: true
}).then(console.log(`Connected To MongoDB !`));
//COMMAND HANDLER
fs.readdir('./commands',(err,files) =>{
if(err) console.log(err);
let jsfiles = files.filter(f=> f.split(".").pop() === "js");
if(jsfiles.length <= 0) {
console.log(`NO COMMANDS FOUND !`);
}
jsfiles.forEach((f,i)=>{
let sss = require(`./commands/${f}`);
bot.commands.set(sss.help.name,sss)
})
console.log(`LOADED ${jsfiles.length} COMMANDS !`);
})
//EVENT HANDLER
fs.readdir('./events/',(err,files)=>{
if(err) return console.error();
files.forEach(file=>{
if(!file.endsWith('.js')) return;
const event = require(`./events/${file}`);
let eventname = file.split('.')[0];
console.log(`Loaded ${eventname} Event !`);
bot.on(eventname , event.bind(null , bot));
});
console.log(`Loaded Events !`);
})```
code block
whats the error?
why is it saying cannot find module "typescript" when i just installed it
i ran npm i -g typescript and it still doesnt work
how are you calling it
@green kestrel what do you think of this as fitting PSR standards for a logger class?
/**
* Logging events for debugging purposes.
* The log statement must be used in a conditional
* statement if the TopError() exception is passed.
* Otherwise, write to your heart's content!
*
* @param int $level The error level type.
*
* @param string $contents The content that you are logging.
*
* @return string
*/
private function log(int $level,
$contents)
{
// This is the PHP 8 method, un-comment if you would
// opt to a faster method for logging.
// $passing = match($contents) {
// is_string($contents) => $contents,
// is_array($contents) => implode("/", $contents),
// default => 0
// };
/// PHP 7 moment.
switch($contents)
{
case is_string($contents):
$passing = $contents;
break;
case is_array($contents):
$passing = implode("/", $contents);
break;
default:
$passing = false;
break;
}
if(!$passing) throw new \Errors\TopError("LOG_INVALID");
$file = fopen("log.txt", "a");
$timestamp = "[LOGGER] [{$this->levels[$level]}]" . date("F Y, h:i:s A");
$statement = "{$timestamp} {$attach}\n";
fwrite($file, "{$timestamp} | {$attach}\n");
fclose($file);
return $statement;
}```
Trying to make the changes to fit PSR as you mentioned for TopPHP, I would love to hear your thoughts and feedback on things
The other functions basically are just easy accessor methods
So instead of having to constantly do \Errors::LoggerBase::log(3, "blah"); you can just do:
$log = new \Errors::LoggerBase();
$log->info("this is an informatory log.");
guys how do i invite my bot to my server
yay library now supports setting presence 😄
brain 
@latent heron turn that frown upside down 😄
@latent heron PSR compliant logger classes derive from a standard PSR\Log class iirc
i see, i was reading up on the PSR docs so i didn't think there was any actual officially set standard on the exact structure
i looked at various sources though and came together with some sort of compromise
i see
i'll give this a better look this afternoon then
that way you can plug and play any logger that derives the interface as "psr\log"
the TopPHP wrapper is going through almost a whole rewrite right now
to comply with PHP 7 and 8 backwards compatibility, as well as preparations for PHP 8.1 features, PSR standards being enforced, and namespace usage
i did something logger related thats similar in my discord library this week, it was using a specific logging library... instead i made it fire on_log events that you can hook and put whatever logger you want there
mm i see
fuck laravel my guy 😂
i dont use frameworks 🙂
i was heavily debating using like
symfony
but its for really the backbone stuff on requests
i think i want to do this all from scratch though
nah go for standalone psr compliant
i dislike relying on vendors
or youre cutting your userbase in half
gotchga
its nice being able to talk to an actual PHP dev
thought i was really alone here
yeah im curious
TopPHP is also a backbone project to me
because after this i want to make my first API
Pog
i have a sql table of about 20 bot lists
with field names, post type (formdata or json), api tokens, and urls
and a second table of stats
the bot clusters update the stats, and then the script runs on cron every 10 mins to post to all the lists
a reference assignment to stream_context_create and file_get_contents?
oh im sorry
im running on fumes of caffeine here 😂 I thought it was a&
i have to head to work actually
Ah yes. Property id does not exist on type { id: string... }
Thank you TypeScript
nvm. Why do they put a [] at the end to signify an Array, when they should be using Array<T>
So confusing and inconsistent
const Discord = require('discord.js')
module.exports = {
name: 'serverinfo',
run: async (message, args) => {
const logo = ${message.guild.iconURL()}
const embed = new Discord.MessageEmbed()
.setAuthor(${message.guild.name}, logo)
.setColor("#FF005B")
.addField("Server Name", message.guild.name, true)
.addField("Server Owner", message.guild.owner.displayName, true)
.addField("Total Members", message.guild.memberCount, true)
.addField("Total Roles", message.guild.roles.cache.size, true)
.addField("Total Emojis", message.guild.emojis.cache.size, true)
.addField("Date server was created", message.guild.createdAt.toLocaleDateString("en-us"), true)
message.channel.send(embed)
}
}
The command only works for servers I created, when I test it on other servers it doesn't work, when I check my terminal is says can't read display Name and for some reason when other ppl use it, it doesn't work but when I use it it works
@unkempt ocean
@earnest phoenix no promoting your hosting services please
take a look at #rules-and-info
https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=ownerID the ownerID property will always exist, so you can use that to fetch the owner (with the <Client>.users.fetch(); method)
why cant i access functions defined in the same file?
even naming it doesnt call it
how the heck do you delete a page on gitbook
i cant find any way to do that
how are you importing the function anyway
im not
He's exporting it
To access an exported function, even fron the same file, you can just use exports.exportName
yeah but how are you accessing the function from the file
But idk if thats a good method
lemme try
anyone?
it worked lol
Uh I think hover mouse over it, right click and delete
javascript moment
😆
You couldve also made a local function and defined the export as the local function
right click triggers default menu
Lol
https://www.Math.pow(10,100).com/
guys sorry but how to make a project in github
To put your project up on GitHub, you'll need to create a repository for it to live in.
yes I Do
evie.codes and evie.dev
ok
you don't have an exports.conf in one of your... commands, I guess?
@umbral zealot you're a girl?
export.run my
export.run is not export.conf now is it
you have a command handler expecting a .conf property and you're not providing one
so provide one
coz in your web "she slice she dices shes he teaches"
yes, I am
kk,i never seen a girl programmed two webs
well
where did you set your web live
hosting
@umbral zealot
I have it hosted on a VPS service
hold on you want to make a website hosted on github?
https://pages.github.com/ is what you want then
Websites for you and your projects, hosted directly from your GitHub repository. Just edit, push, and your changes are live.
github hosts files, it doesn't do anything else really
i have a web that
either it hosts your project files, or it hosts a website
Well you have the 2 ways to create a project on github, so, I guess you're good? Unless you can start making sense 😛
put the project in the hosting web
what
nvm
you know youve experienced true pain when opening gitbook docs crashes your browser because they use too many g jifs
i still cant find a way to delete a page on gitbook
:( i just realized i was trying to delete the initial page that's why it didnt work
puppeteer is a peer dependency
can't import it at the top
so i can choose not to install it
you can
but even if it's installed it still throws error
let Puppeteer;
try {
Puppeteer = require("puppeteer");
} catch {}
Maybe the module has a default export
try Puppeteer.default
if you don't want to use require
but then the typings will be lost
okay i'll try this one
but only require returns object with default property, no?
import defaults to default
yeah
require() imports everything
import * as a from 'module'
//equivalent of
let a = require('module')
import Module from 'module';
//equivalent of
let Module = require('modulee').default
ohh it worked now haha
import {Class} from 'module';
//equivalent of
let {Class} = require('module')
it worked when you accessed it through default
my question mark key is broken ffs
that was a question
yes it did
bruh
weird
import should resolve the default by itself but it looks like it doesn't
import
yes
import()
no
import is the equivalent of require()
it doesnt resolve on default with import syntax
that doesn't sound right
and also i had to put await because it's a promise
why wouldn't dynamic import also resolve default exports
w h y
cuz dynamic
How does that prevent it though
these autocomplete that's why i thought (await import('module')).launch() will work
even intellisense thinks so
CommonJS would be a good choice for a Node application. All import() expressions will be translated to require() calls, which can conditionally executed at an arbitrary point in your program without having to load, parse, and execute the module upfront.
Yes, but typescript already knows which exports are default so it can just do .default for you
or I dunno
const client = new Client({
^
SyntaxError: Identifier 'client' has already been declared
at wrapSafe (internal/modules/cjs/loader.js:979:16)
at Module._compile (internal/modules/cjs/loader.js:1027:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
how can i fix?
i will sleep now my mother screaming at me
the thing with this is that you can also load types
the fix is to not declare client twice
so what should i change sorry im not the best
my bot has a avatar command its working fine but sometimes like it shows old PFP of the user when the user changes his pfp recently. is it a database problem or my bots problem(curenty i m using my bot throught the terminal, so i thought it can be bots problem), if bots problem what can be the solution???
It's probably a caching issue between the user or your bot not receiving the most up-to-date information.
discord should be dispatching user changes real time
which library you are using @rapid wharf ?
What's your question about it?
hmmm i only know js, but i would assume member intents should affect that
let me check the portal rq
when i put my git repo there,it shows page not found(my web there)
what's your github repo URL, lemme check?
?
its private
do you have guild intents?
cool
did netlify actually log you in to github before it asked for your URL?
nope
because if it didn't... it can't see private URLs (I've not synced netlify with github so I Dunno)
it didnt ask for url
thats why, so i can tell you another thing you can do
it asked for rep
send a request to the api to /users/user_id
do you have an index.html in there then?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
here ^^
so, should i try on intents
either intents, or
if you dont wanna bother
fetch it from the api
just keep in mind ratelimits
so be sure to limit your command usage so you dont end up spamming it
yeah
no problem
it did show you this screen right? connecting to github?
yes
ok so it did actually authorize you. good
yes
but when i click the url of my website
uugdngndfvjufn/netifly.app
it says page not found
wtf
@bot.command()
@commands.guild_only()
@commands.has_permissions(kick_members=True)
async def mute(ctx, user:discord.Member=None):
if user is None:
await ctx.send(":no: **Please specify a user.**")
return
mute_role = get(ctx.guild.roles, name="Mute")
if not mute_role:
await ctx.send(":no: **Create a mute-role first. It has to be named `Mute`. Remember that it's case sensitive too...**")
return
if mute_role and mute_role in user.roles:
await ctx.send(":no: This user is muted already.")
return
try:
await user.add_roles(mute_role)
await ctx.send(f":yes: **Muted {user.name + "#" + user.discriminator}**")
except:
await ctx.send(":no: **I can't mute this user...**")```
I get this Error, can somebody help me?
```C:\Users\MYUSERNAME\Desktop\Programmieren\Python\Discord\Discord Bots\Bot>python "Bot.py"
File "Bot.py", line 86
except:
^
SyntaxError: invalid syntax
line 86 is line 21 here
the lowest except:
I just tried doing this and it works perfectly fine for me https://laughing-shaw-b3a18b.netlify.app/
¯_(ツ)_/¯
did it successfully complete all 3 of these steps?
Anybody here who can help me maybe?
Plz how to do : ban, unban and kick
be more specific
i got this
I can send you a ban command in discord.py
no im in discord.js
aaaw
?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
It looks fine to me. Though, you should be catching Exception rather than any error thrown (except Exception: ...).
i was going to reply with this
anyone here who knows js but little to no C++ mind looking over my mini tutorial and pointing out anything that doesnt seem clear so i can expand on it on the page?
https://dpp.brainbox.cc/a00008.html
ok thx
damnit sec
okay thanks
ok im waiting
there, updated the url to an actual url
dont spoonfeed, second he is using js, not py
No its python
im not in python
okay i deleted it
sry didn't saw that
i dont know py well enough to give advice, so thats why im not replying creeper
prob better to just wait someone who knows py well enough
actually
nah fam
i gotchua
hey, what is the properties for stages channel?? please
@slender thistle you got a customer
their is no unban
same as normal channel
the only difference is the type
which is 13
its in the example
That ? :
guild.members.ban('84484653687267328')
.then(user => console.log(`Banned ${user.username || user.id || user} from ${guild.name}`))
.catch(console.error);```
same? because when i make a join command my bot return "please join a vc"
that is an example, yeah
but is for ban
i had to make mine with undocumented stuff, for now its not a good idea to use it
staging channels are still in development
i want unban
Their is NO unban!
yes ik, but for example "Groovy" can play music in stage channel
yeah, my bot can do too, its undocumented stuff
its not in the docs
i checked it !!
where du u find it :'(
i had to ask advaith for how to do it
you need to send 2 requests outside
one is for the actual join of voice
the second is request to speak along with a topic payload
@umbral zealot what was the problem
i did kick
is it that ?
if (message.content.startsWith(prefix + "kick")) {
const user = message.mentions.users.first();
if (user) {
const member = message.guild.member(user);
if (member) {
member
.kick('Optional reason that will display in the audit logs')
.then(() => {
message.reply(`Successfully kicked ${user.tag}`);
})
.catch(err => {
message.reply('I was unable to kick the member');
console.error(err);
});
} else {
message.reply("That user isn't in this guild!");
}
} else {
message.reply("You didn't mention the user to kick!");
}
}```
mine didn't have a problem
?
okay, i have this one
but he dont join
man
bots SHOULD join just fine, but they wont join the stage channel
thats why i told you
you need to first join
then send 2 other requests
one for topic
if (message.content === '/join') {
// Only try to join the sender's voice channel if they are in one themselves
if (message.member.voice.channel) {
const connection = await message.member.voice.channel.join();
} else {
message.reply('You need to join a voice channel first!');
}
}``` (its an exemple on the doc, so that cant work no?)
and one for requesting to join
which requires checking the permissions
REQUEST_TO_SPEAK is a new permission
a lot of libs dont have it
we have it in detritus already
i asked cake to add it
but still
oaky
its super early in dev, you should wait for your lib to support stage channels in all honesty
its not that hard, but im getting a im new to this vibe from you
but in case you want to attempt it
@opal plank i tried that add bot thing on yr status, but i was unseccesfull in running that js file do i have to install node through my terminal like
intall node
okay, thx
you need one for this
/channels/:channelId
with the payload for topic
if theres none
the second is '/guilds/:guildId/voice-states/:userId'
wai what
requesting to join
do you send that through rest or websocket
theres a LOT of caveats tpo that endpoint
let me see if i can get the docs rq
fuck where is it
they closed it
messy
theres quite a few checklists you gotta do
thats why i dont recommend touching them yet
until more libs support it
it's also so weird they made that a rest request
afaik detritus is the only one with it yet
i went to bother him to add it as soon as it came out

LMFAO
@umbral zealot
i wanna create on netifly like a web(i did) and shortcut like
my web/contact.com
how
I asked you a question about your netflix deployment screen earlier
and you never answered
netifly
lol

I literally just did it for the first time and it was flawless
so I dunno where you missed a queue buddy but it works perfectly fine for me
ok
i just wanna say that can you help of making shortcuts for my web...
like
dude first, stop pinging me, it's obnoxious
Second, what do you mean by "Shortcut"
example/about.com
how to do ping ?
that's a URL, not a "shortcut"
like : the ping is 9485885385848ms
@scenic cove
what?
@ your name
?
no they mean a bot ping command you derp
that is ping
xD
use websocket.ping()
lol
or do a request to users/@ me
in discord.js?
that IS discord.js
ok
also
guys i need some help. why i cannot vote. it said i already vote but i didnt
half of your questions you're asking can be looked up easily on google@scenic cove
yea how to
thank you
I can't tell you because I have no fucking clue what you're asking half the time
ok

i did it but it give me pong -_-
not that, the second or third ones
search for latency
not ping command
didn't working : use websocket.ping() @opal plank
what EXACTLY did you write?
ping command bot discord
would updating role every 10 secs be considered api abuse
not that
you said what i wrote doesnt work
so what did u write in ur code
yes
rainbowroles
that : js if(message.content.startsWith(prefix + "ping")){ message.delete() message.reply("Youre ping is: " + use websocket.ping()); }
nah its not color
@opal plank
its says use it
Discord has a very loose interpretation of API abuse; as quoted by them:
@Danny automating the API in that way /is/ abuse. Automatically doing "X" every N is generally not a good idea. Where X could be posting a message, changing someone s nickname, renaming a role, changing a channel topic, etc...
Generally bots should only react to user actions...
Although, for very large N we generally don t care. But for small N, we do care. Think rainbow bots, etc....```
"N" is not really defined, as rate limits are not a good thing to try to get very close to. You re going to have to mostly use common sense here, compare how close you are the rate limit, how often you do this, etc.
https://cdn.discordapp.com/attachments/272764566411149314/604449094680707072/unknown.png
not write it on code
wow
1 secv
ok????
@scenic cove Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:
- proper syntax
- debuging code
- basic features (vars, arrays, objects, functions)
- read and understand docs
- nodejs module system
As much as we d like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.
Here are good resources to learn both Javascript and NodeJS:
Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie s Accelerated JS: https://js.evie.dev/
Please take a couple of weeks/months to get acquainted with the language before trying to make bots!
wtf is this
WHAAAAT?
read what i sent blaker
is a code
yea,you writed use websocket.ping
ok
he told me that @earnest phoenix
pls
maybe u didnt pass bot
pls
no he sayed use it not put "use" on code
ok.
you litteraly copied code
error refers to bot
code refers to client
You know those 2 are not the same word right? They're different words
its saying client.on is not a function
lol
you dont know enough javascript to code a bot right now
no it doesn't
guys how to publish web on netifly
the error says bot.on isn't a function
how do i fix id
uhhh use the same variable name
@lone nova dont directly copy paste code without first understanding/editing it
const client = require("../../index")
const { MessageEmbed } = require('discord.js');
const logsChannel = '828994844634382386';
client.on('guildCreate', (guild) => {
client.channels.cache.get(logsChannel).send(
new MessageEmbed()
.setTitle('NEW SERVER')
.addField('Name', `${guild.name}` )
.addField('ID', `${guild.id}`)
.addField('MEMBERS', `**${guild.memberCount} members!**`)
.addField('OWNER INFO', `${guild.owner} (${guild.owner.id})`)
.setFotter(`Currently in ${client.guilds.cache.size} guilds!`)
.settThumbnail(guils.iconURL({ dynamic: true }))
.setTimestamp()
.setColour('GREEN')
)
})
client.on('guildDelete', (guild) => {
client.channels.cache.get(logsChannel).send(
new MessageEmbed()
.setTitle('NEW SERVER')
.addField('GUILD INFO', `${guild.name}` )
.addField('GUILD ID', `${guild.id}`)
.addField('GUILD MEMBERS', `**${guild.memberCount} members!**`)
.addField('OWNER INFO', `${guild.owner} (${guild.owner.id})`)
.setFotter(`Currently in ${client.guilds.cache.size} guilds!`)
.settThumbnail(guils.iconURL({ dynamic: true }))
.setTimestamp()
.setColour('GREEN')
)
})```
like do'nt use different words for the same thing
my code
this doesn't match your error
Ok but please please just give me code to do ping and the bot write : youre ping is : 1 ms
PLZ
we dont spoonfeed here
its against the rules
learn javascript first
dms
click here, your bot isn't even running right now
@scenic cove u can start without knowing, thats how u learn lol
dont spoonfeed them
this is only code here only error rised'
?
i was gonna troll them :P
bot is on always on
dont, if you arent going to help, dont cause harm
just learn basics before u make a bot
ok
no it's not, repl currently isn't running because of the error state
click the button buddy
lol
trust the person that you're asking help from
Eey om not english i dont understand all
oy hold on
oh
@umbral zealot this is the error
i see whats going on
why do you have a new client in a folder
turn it into a function
then find guides/tutorials in your language
its not a constructor

new command right ??
and is trying to import it
ok i will remove and say
you gotta turn it into a function
client.on() isn't a command. It's an EVENT
those 2 are different things
if you're trying to reach the guildMemberAdd event you should create events/guildMemberAdd.js
like your other events
ok lets try
and don't just copy/paste those codes, you need to make them look different
like your other events
@umbral zealot are you transgender
why would that matter to you or this conversation
its very important at the moment
do you wanna know what's between my legs? is that a thing that you're obsessed with?
I'm a human being, fuck off
Who gives a fuck and why are you asking this in #development
not trying to be rude ait
sir its showing client.on is not afunction
@lone nova read this again, but slowly
match your existing events and the format of those files
use your brain not your CTRL+C and V keys
but in first all of code we need to add client.on()
but i am not making a event bro
could have fooled me

those are literally events
bro letrally not a event
😳
bro that's the very fucking definition of an event
Its a event
.on() is a function of EventEmitter, a function that receives and emits events
literally an actual event

of instead of that what i write

what do you want to do ? a command?
ya
then make a new command in your commands folder
built like your other commands you clearly already have
logs of server join and leave for bot
those aren't commands

if you want to know when the bot joins and leaves you can use the guildCreate and guildDelete events
those aren't comands.
see this folder right here?
i smell copy pasted materials
those are your events
see this this is exactly in commands folder
Or... and hear me out here.... maybe it's an event listener



its clearly code
erwin what happened to the me!me!me!
nothing, its still here
if you dont see, its probably a bug on your client

Gaslighting
@commands.command(name="subreddit", aliases=["sr"])
async def subreddit(self, ctx, subreddit):
"""Shows a non-NSFW subreddit post?"""
submission = reddit.subreddit(f"{subreddit}").random()
if submission == submission.over_18:
return
else:
embed = discord.Embed(title=f"{submission.title}")
embed.set_image(url=submission.url)
await ctx.send(embed=embed)```
I just want to see if this code MAY work, but because I don't know how to filter posts from a non-nsfw subreddit, idk if this would work 
Yes this is sponsored by randomcode™
Well, I'm using the commands.Bot thingy :/
So am I
Ok
discord.py is asynchronous and reddit isn't
Use import sync?
Do you know what sync means

short for synchronous
ok
@umbral zealot it worked bro thanks
i missed line in index.js module.exports = client;
thanks\
yeah you shouldn't be doing that
Even though I have an IQ of 120+ (true), I stink at Python lol
and I didn't say you should do that
use a fancy fonktion
🙃
I need to read 123456 pages of "Python for n00bs: 69th Edition" unless I have to get a life
it only has 420 pages 
That's the joke lol
no you read mushoku not python for noobs
~ erwin, alternate universe
Ok enough joking, let's stick to coding crap
mushoku tensei will teach you more about how to handle your anger issue than coding, just saying
Ok
How lmao
Why not just stick to aiohttp and manual parsing
It's async and helps you learn
Yeah... ok thx
imagine using await/async and not callback hell
yikes

actually
is there even callbacks in py?
Ok, is there an EASIER language then discord.py?
Brainfuck
preferrably scratch
there's google's Blockly
B-but scratch doesn't have a discord thingy
says who?
scratch >>>>
yeah but it's simpler
ok nvm
@earnest phoenix
You can't mix async and sync in python?
I'll go discord.js (again after 69,420 years)
@opal plank make discord wrapper in scratch
while im not fully jesting, there IS a discord http someone made as a joke for scratch
but dont even do it
async def a():
return await b("ha")
async def b(s: str):
return s[::-1]
# :)
asyncio.ensure_future(a())
yeah
Bad idea to
use js
nah, I'll stick with pi
js will spoonfeed you shit code all the way
Js is super easy honestly
Your bot will hang in case the blocking requests take too much time to process
I meant python
Say, time.sleep()
Yeah
is-odd
Hello!!
imagine coding in JavaScript lol what weebs and freeloaders 
so you get shit for free at the worst possible quality possible, but you can find one or 2 decent packages in there
for (let i = 0; i < items.length; i++) {
noArgsEmbed.addField(`**\`${i + 1}\`**) ${items[i].name}`, [
`**Description:** ${items[i].description}`,
`**Price:** ${(items[i].price).toLocaleString()}`,
`\`ID: ${items[i].id}\``
], true);
};
I am currently having this code which loops through the array of objects.
Is there a way to make a check where if an object's items[i].price is equal to This item cannot be bought. then it wouldn't show in the loop/field?
How?
its meant to be a insult joke
I get that but what’s the grounds of the joke
if items[i].price !== "This item cannot be bought." { addfield }
for a bargain of 19.99$ you can hire @slender thistle as your personal slave coach for questions here
if (condition) continue;
"personal slave"
he knows py
I'M A STUDENT I NEED MONEY
Ok calm down, I'll get a life then
ok
Erwin why are you making it even worse for shiv?
Welp, I'm removing the command then 
Thanks! 😊
cuz i like shiv, so in my way of showing affection ||100% not cuz he randomly started pinging me a couple weeks ago out of nowhere|| i like to show it in a tsundere format or bothering the cuitie pie he is 

Wait so did Erwin change his pfp or is this a bug?
bug
probably a bug
Ok that’s a strange bug

When will you change your pfp to :loli_dance:?
I wont change pfp
It would be funny tho
Anyway you never rated the code I told u to
I even finished the season
Reee

Kind of curious, am I supposed to use a switch() statement if I'm willing to add aliases to arguments or is there a better way?
Put all aliases in an array
Theres always a better way 
Using switch is just messy
imagine if you had 100 commands
and I just noticed that they said aliases to arguments, not commands
Can you elaborate @feral aspen ?
I stack cases in switch statements.
show an example of your current setup and what's problematic about it
though maybe all you need to know is, ```js
switch(thing) {
case 'a':
case 'b':
console.log('a or b');
break;
case 'c':
console.log('c');
}
works fine
which library and programming language are you writing your bot in?
you mean discord.js javascript (your language is not your editor for future reference)
in which case, client.user.setStatus is what you want
or setActivity even
right, great, that's correct.
sure just wrap it in a setInterval
note that you shoudl not do this too fast
every 10, 15 minutes owuld be recommended
with what
setInterval takes a function that will run on the interval, as well as an interval in milliseconds
around setActivity
setACtivity will be inside the function
right so... you... do'nt understand the words "wrap in" or "put inside"?
y'know. one thing inside the other
you're new and yet you have all these files with fancy names
and set up to host on heroku too
I'll take "Bots copied from github" for $400, alec!
Can we share those 400 dollars as I'm a student and I need money plzty
newbies using eslint, yeah sureeee
It’s pog
i personally don't need it since i think my code is clean *enough*
also, eslint has some broken rules so i try to avoid those
just disable them
tru
message this is an
@pale vessel aeon-rose when?
bru
so what
does that abuse rtl?
🙄nothing
allright
yeah




