#development
1 messages Β· Page 1197 of 1
get first user mention in a message
message.mentions means all the channels users bot and other stuff mentioned in the message
ohh
.users means only the users mentioned in the messages
added unit test to me framework
so when tagging someone in a message? mentioning someone else.
oh ty
note that DISCOED does NOT order mentions by the place they apoeared in the message
internal/modules/cjs/loader.js:613 throw err; ^ Error: Cannot find module '/app/server.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15) at Function.Module._load (internal/modules/cjs/loader.js:526:27) at Function.Module.runMain (internal/modules/cjs/loader.js:826:10) at internal/main/run_main_module.js:17:11
What I need to do I cant understand...
wherevere you have require('/app/server.js') change that to the right spot
because the file '/app/server.js' doesnt exist
try to do './app/server.js' instead
with the . to signify look in current directory
Permision denied it said
how do i get host of mongodb?
dont host mongodb externally
unless you know what your doing
just get a local instance
windows
sec
and im not planning to run this pc for 24/7
download this, it should auto start mongodb server on your machine
then you can access it with your code or the mongo script
does this require my pc to be on 24/7?
no, it will turn on/off automatically when you turn your pc on/off
i would like a to host it externally
why?
if that is the case
- where are you hosting your bot
- is there any reason why you can't use a database that is file-based(sqlite)
repl it
oh
that makes more sense
yea use a file based db
wasnt there a sqlite wrapper for bots that dumbed it down a ton @fluid basin ?
eh?
i think it was called easydb or whatever
I've never used repl.it for any bots, but as I know repl should keep your files that you created
how do i get mongo db host and port?
its quick.db
ye
also I do think repl supports sqlite
uh
if you insist on using mongodb, you need a server to keep the mongodb database running
uhhhhh
it is hard to set up locally (if you want to host it at home with a spare pc, port forwarding is required)
just use atlas
and your bot on repl will stop working once your mongodb server stops working
read how to start on using mongodb @carmine summit
no you can have free clusters
brain go brrrrrr
with student pack they also give you $200 credit no card or anything needed
fun if you wanna look at the paid or expensive clusters for free
or you can pay 5$ to have a vps + local mongo instance :^)
or you can pay $3 for the same thing
what happened to your main
yeah right
yee haw
tempted to add docker auto deployment into the travis script
now i can just copy paste that over to all my new api projects
moi bueno
cool
How to add a megalodon bot ?
i prefer not to use atlas when working with mongodb
How to add a megalodon bot ?
@shell lotus find one
unless im working with 2 or more people, then iβd use it, but if im working in my own. just use localhost. dont have to pay for anything
why are people so fucking dunb
how does one be that dumb
about d.js, when my bot gets disconnected by an admin while it's playing music, connection.play won't work next time it's used
is there any way to avoid this?
why are people so fucking dunb
@earnest phoenix that's pretty rude
"Any idea why this doesn't work? shows the code"
"Because <smth>"
"What does that mean"
100% of the time <smth> is a REALLY basic thing of the programming language that everyone knows because it's common sense
@digital ibex i'd disagree on that tbh, quite the opposite, most of us take time out of our schedules to help people, theres quite a small chunk of people who are obnoxiously rude towards new people unironically
@wheat jolt maybe make a note to people saying to stop playing the music before disconnecting it
I fixed it
i dont talk in this server much, but when i do, im talking in this channel and it seems like that to me lul. probably just me coming at the wrong time
it was a typo and the bot didn't handle its disconnect correctly
wdym it didnt handle the disconnect correctly?
"Any idea why this doesn't work? shows the code"
"Because <smth>"
"What does that mean"
100% of the time<smth>is a REALLY basic thing of the programming language that everyone knows because it's common sense
@earnest phoenix I mean, I agree completely with this. It's extremely common beginners come here and have basic questions about a language they don't even know the name of, which definitely can be frustrating lol. But I don't agree with attacking beginners by calling them ||fucking dumb||
It's a lot more productive (and worth the time) to guide beginners to the resources they should use rather than shitting on them for their lack of knowledge. If they clearly don't want to accept those resources then that's their issue.
Oh snap, does PM2 run more than just js apps?
So I should be able to use dotnet myBot.dll
which spawns a child process iirc
Hm guess more work is needed to just work out of the box
anyone know how can i display emojis to represent badges?
@faint prism you might be able to use nodemon fyi
im bore
@dreamy cedar put a slash in front of an emoji (like this one:
) to get its raw form and use that.
a backslash
^^
@faint prism you might be able to use nodemon fyi
@opal plank Just wanted to see if I can run different lang bots using pm2. I'll just stick with systemctl for now, thanks though

hi, im speak spanish but, intent create my first bot
need help in this line "node bot.js" please, don't work
i Install: npm install discord.io winston -save
And: npm install https://github.com/woor/discord.io/tarball/gateway_v6
Looks like you are using the wrong quotes
@queen geyser regenerate the token then put it
Use " or '
hello, ive been working on this for an hour now but it always gives result as my name instead of following the embed format.
snaeki, avatarURL is a function as far as I know
Use
"or'
@cinder patio omg! TY!
snaeki,
avatarURLis a function as far as I know
ah
client.username
i tried using client.username instead of user.username, but same results :-(
there's no such thing as client.username

1min leme give you my function
You don't have to give me anything. The solution is simple - call user.avatarURL. You are not calling the method
@topaz saddle try .setThumbnail(user.displayAvatarURL)
That's also a function
my brain is hurty
i used on user and work good
avatarURL is a thing
displayAvatarURL isnt
displayAvatarURL() is a thing
avatarURL() isnt a thing (iirc)
it is
it is
it returns null on default avatars, unlike displayAvatarURL()
it returns undefined on default avatars, unlike displayAvatarURL()
@pale vessel thats what iam mean
and work 100%
oh ok, now.
I write "node bot.js" in the Bot Folder in cmd but he don't conect in Discord Server :c
are you logging in?
in discord web?
no, in your code
idk
In older versions of discord.js, displayAvatarURL was a property, but in the version sneaki is using, it's a method
is my first bot xd
feedeo, npm install discord.js?
idk
@queen geyser You need to tell your bot to login to discord at some point in the code
im assuming these older versions are deprecated now feud
yup, v11
do @\instinct login on discord!
and richembed is in older version?
as well
jk, but you do neeed to connect it with your token as param(assuming its d.js)
maybe idk
jk, but you do neeed to connect it with your token as param(assuming its d.js)
@opal plank discord.io
feedeo, npm install discord.js?
@topaz saddle yep, is installed
oh ok
npm install discord.io winston -save
and
npm install https://github.com/woor/discord.io/tarball/gateway_v6
wait what?
tutorial says :c
you using discord.js or discord.io?
oh yikes
lol
lol
use d.js or some up to date lib fam
i literally woke up at 5AM
At this point I feel lost
.
u.u
@earnest phoenix go dot elewhere

@queen geyser that discord.io that i've been looking at, if im not mistaken, is really outdated
ok i understand
?
ok i understand
@queen geyser Use discord.js
it even has some boilerplate code
https://discord.js.org/#/
ty <3
:)
im really new in this area :c
np. Also, learn the programming language. It's called Javascript (JS). Understanding the syntax/grammer of the language will help you with a lot of issues
I just need discord.js or other dependence?
Depends
or does it depend on what i do?
you shouldnt be doing a bot with little knownledge of a language, its what i usually say
you trying to write a russian essay without knowing russian.
bots are intermediate level projects
i'd suggest trying w3schools for a bit before hopping in
just so you get a general sense of JS
I understand technic english, logic and sintaxys of visual.net no more
and some english u.u
i studed programing 2 years but only visual.net

Visual basic hahahaa
oof... that's rough
let's say my university was not very good
is that enough knownledge to try a bot hands down tho? im not familiar with that so i cant say
I really don't like the syntax in Basic
But it's good you have a general idea of OOP π
I think that putting a challenge of this size forces me to understand the .js language, so I try to do my best
I don't think anything's stopping you from making a bot in Visual Basic
JS is a pretty useful language to know
scratch >
I don't think anything's stopping you from making a bot in Visual Basic
@cinder patio that's true... but π€’
I don't think anything's stopping you from making a bot in Visual Basic
@cinder patio you cant do everything you wana
ow.. can i create bot in visual basic?
@queen geyser Well it's just API calls if you don't have an available library
limited commands
It's entirely possible
I try to make my bot save presence data in discord, according to text and voice and then use that data in different ways such as role control for example
of course I don't know how to do any of that but I have faith haha
How did you plan to approach the "saving" feature?
i have no idea c:
Might need to learn how to communicate with a database management system as well then
totally
I am willing to learn everything
starting with a new tutorial that has updated libraries
Hello,does anyone now how to react to the embed the bot sent after the user used a command?
message.channel.send(embed).then(m => m.react("πΆ"))
i trien using .then but
thats correct use of .then
yes ik to use then but i got other code
message.react('π').then(r => {
message.react('π');
});
message.awaitReactions((reaction, user) => user.id == message.author.id && (reaction.emoji.name == 'π' || reaction.emoji.name == 'π'),
{ max: 1, time: 30000 }).then(collected => {
if (collected.first().emoji.name == 'π') {
message.channel.send(`text`)
}
else
message.channel.send(`text`);
}).catch(() => {
message.channel.send(`No Reaction after 30 seconds, command canceled!`)
});```
here is my other code e.e
ok wait
let target = message.mentions.members.first() ||
message.guild.members.cache.get(args[0]);
if(!target) {
return message.channel.send(`Please mention someone`)
}
if(target.user.id == message.author.id){
return message.channel.send(`Hey ${message.author.username} How would you do that please elaborate!`)
}
let embed9 = new discord.MessageEmbed()
.setTitle("Text")
.setDescription(`Hey ${target}, ${message.author} Please react with π or π`)
.setColor('RANDOM')
message.channel.send(embed9)
message.react('π').then(r => {
message.react('π');
});
message.awaitReactions((reaction, user) => user.id == message.author.id && (reaction.emoji.name == 'π' || reaction.emoji.name == 'π'),
{ max: 1, time: 30000 }).then(collected => {
if (collected.first().emoji.name == 'π') {
message.channel.send(`text`)
}
else
message.channel.send(`text`);
}).catch(() => {
message.channel.send(`No Reaction after 30 seconds, command canceled!`)
});```
it has cuss words in it so i changed them
how would i make it so a command in a module.exprot can change a variable called prefix thats already been defined by a var in index.js?
also function on your var not on the message
if you react on message it'll react to the user who sent it
@forest drift attach it somewhere in your index
so if it changes a variable, the command would have to be in the index instead of a module.export?
on chat, message, whatever you want. since you're changing a reference, it'll change that variable value on all of them(since they are all referencing the same thing
no
cause the variable is already defined in the index.js
let a:number = 1;
client.on('message', (m:any) => {
m.a = a;
runCommand(m);
})
//command file
runCommand(m:any) {
m.a = 0;
}
how would i make it so a command in a module.exprot can change a variable called prefix thats already been defined by a var in index.js?
@forest drift if prefix is a global variable, you can read from .env
If it's guild specific, read from whatever datasource you're storing it at
if you call that variable a now on your index, its 0
just reference it in a common object
ok
ghostping? lol
i sent at the same time he sent the msg
since they were here, i deleted
unnecessary mention
or alternatively if you dont want to do that, just do this Jamie
sorry, i didnt say anything cause i was tryuing to undserstand the code u sent
let a:number = 1;
client.on('message', (m:any) => {
runCommand(m,a);
})
//command file
runCommand(m:any,a:number) {
a = 0;
}
this is also doable
ummm would this work:
embed.add_field(name="Image URL", value="[Click here to open](member.avatar_url)",inline=True)
Looking for a hyperlink message. although the "Click here to open" is not marked as a hyperlink
That's because you're giving the url "member.avatar_url" instead of what should be the url
const { prefix1, token1, botname1, boticon1 } = require('./config.json');
var prefix = prefix1;
At top of index
try {
command.execute(message, args, boticon, prefix, botname);
} catch (error) {
console.error(error);
};
Inside the client.on message function
module.exports = {
name: 'help',
description: 'Help Menu',
execute(message, args, boticon, prefix, botname) {
inside the module export file
prefix = "g!";
The code to change the prefix within one of the commands in the module export file
You could use f-strings and wrap member.avatar_url in {}
or use string concentration @acoustic bridge
Well it throws me an error with "invalid syntax" and "did you forget a comma?"
Did you?
show us what you wrote
@forest drift if you doing custom prefixes per guild, i'd recommend going a different route though
embed.add_field(name="Image URL", value="[Click here to open](member.avatar_url)",inline=True)
Like a message event / db / cache interaction
here
like a DBMS
That is no different than your original one.
I wanna make a custom mongo wrapper
Aight so wrapping it in a f string does that
You don't have the () around the url for some reason
i wasnt actualy changing the prifix, i was trying to test how i would change a variable in a module export file that would effect the index file thus affecting the other module export files @opal plank
Yea i just wanted to say... i missed that
if its for that, then yeah that'd be fine
lmao
but id doesnt work
Hey guy's
try this
What's up with everyone
what does a
.dllfile do
@earnest phoenix It's a compiled binary
typically an extension for an executable binary (.exe)
Anyone interested in trading on binary options and earning good profit dm for more info
Anyone interested in trading on binary options and earning good profit dm for more info
@latent valley advert?
not the server for this @latent valley
lol
Nice
π
*and somehow i havent been ratelimited for chunk caching 500 channels
*

let simplest = stringy.split('');
for (i = 0; i < stringy.length; i++){
simplest = simplest.map(letter => {try{ `:regional_indicator_${letter.toLowerCase()}:` } catch (e) {message.reply('nu')}});
}
simplest.join('');```
Ehh, I'm evaling this and the bot is only spamming nu.
Ree?
Redis is a fast and efficient in-memory key-value store
Ooo fancy.
In C# I'd probably use use Dependency Injection to provide a class with a Dictionary property
its basically a js map
how i use custim emojis in canvas
but more complicated
custom emojis = images
so think that way
@pallid igloo why do you even need a try catch
custom emojis = images
@fluid basin ok thx
"go away".split("").map(x => x.match(/[a-z]/i) ? `:regional_indicator_${x.toLowerCase()}:` : x).join("")```thonk
so funny
thanks @mint thicket β€οΈ

indeed
@slender thistle
https://discordapp.com/channels/264445053596991498/272764566411149314/748901401517883472
@faint prism what? i am asking a question
That quote was for the spam from Ural Aslan
Did you mean to quote me?
@static trench
oh sorry
no worries, the link is dead now, but still scrolls up. I can see the confusion π
shivaco im sorry . i didnt mean to ping you π¦
yayayay!
aight if it survives this test i'll push it to the main branch

looking good thus far
wolfram alpha's TOS says I can't cache responses π
I mean, one is in memory, the other is not
it said cache
cache is temporary
if you store it forever, it isnt cache, technically

twas a wild dauy
PROHIBITIONSYour API Client will not, and You will not, encourage or create functionality for Your users or other third parties to:
...
access, cache, store, retain or in any way compile any copies or portion of any Wolfram|Alpha content by any means other than as indicated in Your API Client;
Also CACHING Unless part of a written agreement to the contrary, Your API Client is prohibited from caching Wolfram|Alpha content.
I don't want to cache anyways
is it me or everyone accomplishing good things today? ||(the fact that i drank a lot last night might be the reason why im in a good mood and noticing those small things too)||
I'd be careful associating alcohol that way, lol but that's #general
There was a privacy issue I had with wolfram api that surprised me
can anyone help me in dms?
why not here?
cuz its the full bot code
is it anything fishy?
@opal plank
its a code for a music bot

is it anything fishy?
@opal plank It referenced my server's accurate location...
isk whats wrong in it
@crimson fjord use hastebin or ```
isk whats wrong in it
@crimson fjord send error msg
dont spam channel
dont spam channel
@opal plank idk if i'd consider a single huge msg spam. But it's unsightly for sure
yes
try that
you clearly dont
step debugging shows your code running real time
so you can catch where the error is
i much rather teach you how to debug properly, if that doesnt work i'll help you fix ur code
when i run the bot it comes online on discord buth nothing happens
@crimson fjord Well, what did you program it to do next?
It's only going to do what you tell it to do (I didn't read code)
im so confused about this code tbh
switch on a single case
function without parentesis
@crimson fjord Well, what did you program it to do next?
It's only going to do what you tell it to do
@faint prism its a music bot i tried to make one
i only made the !play command
but dosent work
i watched a tutorial on yt
use docs, youtube videos are bad for learning
oo
actually both
bad
Wait, did he copy code that had comments below saying why it didn't work..?
as much as its annoying yo hear this, you need to learn the lΓ§anguage before using it
as i say, you trying to write a russian essay without knowing russian
hmmmmmm
MDN too
^^
Or design a building without taking classes in architecture. It isn't going to work well
or eating food without teeth
MDN is a bit harder for begginers imo, so i'd still recommend w3schools cuz of their interactive snippets that you can try
when will we know if our bot is done?
-verifybot
Hi! It seems like you are looking for information on how to get your bot verified.
Once your bot reaches 75 servers or more, you are eligible for bot verification. On October 7, 2020, bots with 100 servers or more that are not verified will not be able to be invited to any more servers. You verify your bot on your bot's application page, under the "Bot" section in the sidebar.
If you need more information, check out this article written by Discord about The Future of Bots on Discord and you can ask questions in the Discord Developer Server.
We cannot provide support on how to get your bot verified.
its been a couple hours now, and i still can't find a way to make it so that if the user tag is mentioned, then it gives the avatar of the user tagged, but if there is no tag - it gives the avatar of the msg author.
there are many tutorials online, but all of them have embed, and i have no idea how embed works at the moment.
You should check if user exists before you try sending it.
use || to revert to the message author if that'st he case
For example: ```js
let user = ...
if (!user) {
user = msg.author
}
// now send it```
ah @sonic lodge i did try that, but it wasnt working. i will put it back to that but because i thought that was the reason it didnt work but now i know
For example: ```js
let user = ...if (!user) {
user = msg.author
}// now send it```
tysm
const fetchedLogs = await message.guild.fetchAuditLogs({
limit: 1,
type: ''
})
``` Im trying to get the member that invited the bot inside `guildCreate` Event
what did you try previously
What Do I pass in for type?
I think it's BOT_ADD
Epic ill try that
oops
that should be fine
var user = msg.mentions.user.first() || msg.author;
users
i have a question why its showes like that?
what's the url to the image
https://immh-savage.is-inside.me/7EIEab6C.png
:D
ahh not that
wait ill send
this
the hell
dbl's old domain
^^
why does that still exist
it's probably because the bot isn't verified yet @earnest phoenix
ahh yeah okey thanks
the hell
Should I use this format of storing user data in mongodb collections?
{
hasInteractedWithTheBot: Boolean,
hasInteractedWithGuilds: Array
balance: Number,
inventory: {
protectionItems: {
padlock: Number,
lifesaver: Number,
landmine: Number
}
},
profile: {
embedCollarColor: String,
description: String,
badges: Array
},
hype: [
{
guildID: String,
level: Number,
xp: Number
}
]
}
is Snowflake an actual class
snowflakes are just strings iirc
it's a thing in Discord so I guess it is a class in discord.js too
oh ko
*ok
wtf
the hasInteractionsWithBot seems redundant and inefficient in this case @earnest phoenix
what is hasInteractionsWithGuilds ?
hi is there an event so the bot looks when its added to a server im using discord.js.
Is there a reason and/or fix to why my bot takes so damn long to login?
hi is there an event so the bot looks when its added to a server im using discord.js.
@sharp thicketguildCreate
why r u channel hopping @sharp thicket
im not..
iβve answered u already
hi is there an event so the bot looks when its added to a server im using discord.js.
@sharp thicket guildCreate
You were already awnser Ed
what where?
@sharp thicket
guildCreate
hi so confused en.. , im sneaki.
@queen jetty Why did you post that token
maybe it was an accident
So I'm making the Alexflipnote Floor...
It should work like this:
(https://api.alexflipnote.dev/floor?image=https://cdn.discordapp.com/avatars/610122588110192681/3a1171f14ff08dfd1e3bf2c8802c5fd3.webp?size=512&text=Hi)
https://api.alexflipnote.dev/floor?image=https://cdn.discordapp.com/avatars/610122588110192681/3a1171f14ff08dfd1e3bf2c8802c5fd3.webp?size=512&text=Hi
.setImage(`https://api.alexflipnote.dev/floor?image=${member.user.displayAvatarURL()}&text=${ftext}`)
``` But in my code it won't load...
o
Now it's working! I fixed it.
My websites broken- I made a div with \n and <code> tags, And my command list is all crammed together, No code tags, And is in the navigate bar https://pastebin.com/tW2Mq2aS
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Oh thanks!
np
but how do I take the text from the navigation bar?-
by using different divs π€·
1 only: buy a vps
by using different divs π€·
@restive furnace I did
pyrhon heroku ?
@earnest phoenix im using discord py, on heroku
then buy a vps
or aws or gcp if u dont have money
laggy cuz ur bandwitch
itβs so shit for music that you could put it in #memes-and-media
or aws or gcp if u dont have money
@earnest phoenix Aws is paid
itβs so shit for music that you could put it in #memes-and-media
@misty sigil IS IT POSSIBLE
like can i
YES MOTHER FUCKER
but u have 300β¬ free for first time ??
but u have 300β¬ free for first time ??
@earnest phoenix is that so?
Idk
yes
didnt check
Oh*
300β¬ for gcp, aws & azure too
Yea
@low wasp bitch help me
aaaa?
prefixes in my command handler machine borked
let prefix: string
this.prefixes.forEach((p) => {
//if (!this.prefixes.includes(p)) return
if (msg.content.toLowerCase().startsWith(p)) prefix = p
})
if (!prefix) return
for some reason this doesn't work on prefixes with spaces
My website is screwed up, I'm using a different div and still my cmdList div is getting mixed up
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
you have everything in the navbar div
I do, Agrh
@low wasp b et ch
OI u got me killed
is youtube api or spotify api better
For what, music? Spotify only gives info on songs, playlists, (and maybe 30-second clips)
doesnt some bots really scrape it?
yes, and likely really against their tos
For what, music? Spotify only gives info on songs, playlists, (and maybe 30-second clips)
@faint prism howβs this called exactly? (The package)
and if you want to scrape it (which is against their ToS): https://spotify.com
I see https://www.npmjs.com/package/spotify-web-api-js but for the most part they're all meh. Spotify's API is not too hard to use.
.clear()?
map.clear() ?
yeah try
lets see
Wassup
hi
How would I use a button onclick stuff in this case thing here html <a href=""> Command List </a>, I tried adding a onclick after the href but that gave me a billion errors
Itβs onclick automatically for me
How do I define MessageEmbed?
I tried this:
const { Client, MessageEmbed } = require('discord.js');
itβs defined
if anyone knows discord.py very well,
i want to do something like this in discord.js```javascript
client.on('message', async function(message) {
if(message.author.bot || !message.content.startsWith(prefix)) return
if(message.channel.type == "dm") return message.reply('You can't use me in DMs!')
const args = message.content.slice(prefix.length).split(/ +/)
const command = args.shift().toLowerCase()
if(command === "help") {
//Other Things
}
})
Learn to code in python
ReferenceError: MessageEmbed is not defined
at Object.execute (C:\Users\maxh5\Desktop\Bot\commands\help.js:5:19)
at Client.<anonymous> (C:\Users\maxh5\Desktop\Bot\main.js:43:34)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (C:\Users\maxh5\Desktop\Bot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\maxh5\Desktop\Bot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\maxh5\Desktop\Bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\maxh5\Desktop\Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\maxh5\Desktop\Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\maxh5\Desktop\Bot\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:315:20)
@misty sigil
do you have the require in that file
Looks like you could have imported it wrong. Any time I've ever used MessageEmbed was by creating a new MessageEmbed object
using discord py, heroku and ffmpeg/youtube_dl, how can i set it up?
i have all the code
and it works on my pc
dont copy paste ok
It sounds like you're making a youtubeDL bot lol
lava link is cool from what Iβve heard
That'd be an interesting (illegal and unethical) bot to design.
Imagine typing !getsong Yellow submarine Beatles and it responds with a mp3 file upload
"i have all the code, already, for ffmpeg" sounds like copy pasting, but okay.
That'd be an interesting (and unethical) bot to design.
Imagine typing !getsong Yellow submarine Beatles and it responds with a mp3 file upload
@faint prism lmao thatβs EpIcβ’οΈ
^^ unique idea
It's definitely against copywrite laws
Is this right?
const embed = new MessageEmbed()
.setTitle('x');
message.channel.send(embed);
Yes
lgtm
When I do it it says MessageEmbed is not defined.
I don't think so
const { MessageEmbed } = require('discord.js');
@dawn plaza
^ that looks right
but make sure you aren't replacing the client bit, you need that or else you'll get client is not defined
So you need ideas?
can
look up random APIs on the internet, and make a bot that lets users interact with them
I did that for a Wolfram Alpha API and made a bot
bot.guilds.cache.size
the cached users size != whatever the other users value is
let info = 0
bot.guilds.cache.forEach((guild) => {
info = info + guild.memberCount
})
this is for my member could
I tried bot.users.cache.size to see if it worked
and it gave me a number 300 off
Then your cache doesn't include all the users unless you download all of them
D API doesn't cache offline users in large guilds unless you tell it to
iirc
ahhh
so imma stick to this method of getting my member count
thanks
wait
can I do
a!eval bot.presence.status = "idle"
to change my bots status?
try it and see
it didnt works lmao
setStatus maybe, if that's a thing
or setPresence
bot.user.setStatus(dnd')
Kinda want to start making a bunch of single-purpose bots that just interact with some API
Why google specifically?
there are more APIs than googles too
:')
with google maps and other stuff
@solemn leaf Would you return a link to g maps or a screenshot?
I'd imagine a link would work better
I was actually gonna help my friend with his bot
@solemn leaf You all using git-scm?
interesting!
Is that actually a screenshot of a running application?
yes
I learned a lot these last hours: ')
web interface + dbsql + npm + node.js + .js + discord.js documetnation
it takes a screen shot
then setups controls and info from the application
and sends it to discord
commands are the commands in the game
That's a really cool idea. Pretty high resource overhead for multiple games though
its only one
that's what i figured
Can someone send me a link to a Embed guide? I can't get it to work for some reason and I've tried a few guides already
.js
Can someone send me a link to a Embed guide? I can't get it to work for some reason and I've tried a few guides already
@dawn plaza did you try the library docs?
@dawn plaza console.log(Discord.version)
Those are the two I tried^
console.log(Discord.version)
I used it yday and it works for me
I'm using a command handler, could it be that?
Straight outta the docs
const exampleEmbed = new Discord.MessageEmbed()
.setTitle('Some title')
channel.send(exampleEmbed); // or msg.reply(embed)
:big_brain:
my brain kinda messed up
as ou can tell in my pfp
why would you reply
with it
it would be like
@faint prism
embed
you can reply with an embed
as a command response?
@faint prism I did exactly that and this is what I got
wh
Define discord
figure it out yourself
@solemn leaf Here is an example of msg.reply(someEmbed)
var embed = new Discord.MessageEmbed()
.setTitle('Wolfram Alpha')
.addField('Question', query)
.addField('Simple Answer', data)
.setFooter('Requested by: ' + usr);
msg.reply(embed);
Thatβs it
it doesnt ping?
@solemn leaf no, it matches the msg's context (channel or DM)
Okay, so if I'm getting told Discord isn't defined but I'm already defining Discord, what the heck do I do?
I have the embed command in a separate file btw
I have the embed command in a separate file btw
@dawn plaza it needs to be defined in there too
unless if you pass discord though the anysc

can I make an image a link>
that image is from spotify api btw
with the builder u can put attachement iirc
i think spotify api make my brain explose
you can put the attachment without the builder regardless
or maybe the dev use canvas ._?
so he need to write 100+ lines of code
for a pic
LoL
not?
when you send an embed, you can get the msg's image link from it on the discord's server
@earnest phoenix its not 100 lines it is 108
let embed = { embed : { description: 'hi' }}
<channel>.send(embed);
//equals to
<chanel>.send({ embed : { description: 'hi' }});
//which also equals to
let embed = new Discord.MessageEmbed().setDescription('hi');
<channel>.send(embed);
in the end they are all EXACTLY the same , but using embed builders just use more resources unecessarily
<chanel>.send({ embed : { description: 'hi' }});
cuz you are declaring less variables
of course not
i am dumb
thats why i said embed builders are trash
calling constructor (new), creating variables, calling methods, then sending
rather than
send()

embed builder is stupid imo
wanna see for yourself?
do an embed builder and then before sending, do console.log(embed)
you'll see its the exactly same object i mentioned above
@solemn leaf if you got something against my pfp you're more than welcome to go to #memes-and-media rather than tash talking me here while im explainging something
Use whatever you like both methods work
That pfp gives me dopamine. Thanks
should i learn CSharp or CHastag or C#
C++ fact of the day
C++ spaghetti was used to make tf2
C++ was used to make billions of games - before unity
well, still AAA Game Companies use C++ tho
and also, C++ is only spaghetti, if the developer is bad
pillows are cool
yes
Does anyone know how crosspost work? I have an announcement channel with multiple crossposted messages and channels that follow it don't really show anything nothing
Bot is sending out embed messages and then cross post them
you need to publish them
How do you get who requested a command?
thx
message.author.tag
@misty sigil.username????
my bot did publish messages it seems it's called crosspost in the API
.username is mattthew, .tag is mattthew#0001
or maybe
<@!${message.author.id}> == @earnest phoenix
no.
yes
not in a footer
@grand oyster if your lib supports it, there should be option while sending message
where most requested by: notes are
yeah I already did that it's published in the announcement channel but its following channels don't show any messages
is tag = username + '#' + discriminator ?
Essentially
Command raised an exception: OSError: cannot open resource
error
u want code?
using discord py
and pillow
does anyone know how you open the mail app to send a email or something in html? mailto: <email>?
hey guys!
@still merlin href="mailto:email" iirc
Thanks a lot!
async def info(ctx, user: discord.Member):
img = Image.open("infoimgimg.png") #Replace infoimgimg.png with your background image.
draw = ImageDraw.Draw(img)
font = ImageFont.truetype("Modern_Sans_Light.otf", 100) #Make sure you insert a valid font from your folder.
fontbig = ImageFont.truetype("Fitamint Script.ttf", 400) #Make sure you insert a valid font from your folder.
# (x,y)::β β β (text)::β β (r,g,b)::β β β
draw.text((200, 0), "Information:", (255, 255, 255), font=fontbig) #draws Information
draw.text((50, 500), "Username: {}".format(user.name), (255, 255, 255), font=font) #draws the Username of the user
draw.text((50, 700), "ID: {}".format(user.id), (255, 255, 255), font=font) #draws the user ID
draw.text((50, 900), "User Status:{}".format(user.status), (255, 255, 255), font=font) #draws the user status
draw.text((50, 1100), "Account created: {}".format(user.created_at), (255, 255, 255), font=font) #When the account was created
draw.text((50, 1300), "Nickname:{}".format(user.display_name), (255, 255, 255), font=font) # Nickname of the user
draw.text((50, 1500), "Users' Top Role:{}".format(user.top_role), (255, 255, 255), font=font) #draws the top rome
draw.text((50, 1700), "User Joined:{}".format(user.joined_at), (255, 255, 255), font=font) #draws info about when the user joined
img.save('infoimg2.png') #Change infoimg2.png if needed.
await client.upload("infoimg2.png")```
thats my code
i got it off githuv
but it saying cant open recousce
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OSError: cannot open resource
Don't copy and paste code. Simple
i want to understand it
i wont use this is my bot
but i couldnt find any videos
so can anyone help me cuz its not opening it
Don't use video tutorials & Don't copy and paste of github, Write down what you need
i did dummy
And learn the langue before you try and make a bot
^^^^^^
Don't come and insult us, Its your fault for copy and pasting without knowing how to code
yeah find snippets (if ur lazy) or explanations, and build the command from that information.
^^^^
i did dummy
un-needed insult
Hi guys. I want to be Bot Developer. What I can?
??
the role or actually develop bots
You must submit your bot, like it says in #502193464054644737 like it says at https://discordapp.com/channels/264445053596991498/502193464054644737/555644686199422976
How can Δ± read the badgets in js v12
<user>.flags iirc
Thx
Hello guys how do I add my bot to the top gg site??
why i cant play the audio of the "createStream"?
@still merlin @restive furnace if neither of you are willing to point them in the right direction, please refrain from using this channel
There was two of you, and neither of you bothered to actually help them solve the issue.
i was bored
and then found out i was right, ish
definetly need a fuckton to make a difference, thats 1 mil iterations
but indeed sending payload without declaring it is the most performant
user.presences.activity[0] iirc
yeah
but that returns that
let n = user.presence.activities.find(a => a.name === 'CUSTOM STATUS')
can I do that?
that'll error iirc
I do it for my spotify commands
also pls start using parenthesis
function something something
function (params) {} code
arrow function is a function
still error though
cuz presence isnt always there
do conditional chaining if your node is high enough
that is why there is a if before it
which you didnt show

so how was i suppose to know
anyhow
if it is there i think that might work
give it a try
n is undefined
I did
if u did it would not have error'd
noice
huh?
to get the text
what is n?
tfw your eval is lookin pretty nice










