#development
1 messages · Page 599 of 1
I change my bot avatar yesterday, and it took 5m
maybe it refreshes every 30 minutes or every hour or something
It is not
hm
It's only been like 20 minutes so I am not surprised, just really impatient
Hi
Ok
@carmine echo iirc avatar updating is 2 per hour. Check discords documentation on rate limits
That is not what I asked, but ok
how to keep our bot connected ?
i coded my bot in js and i could he rest connected but when i close the program window, he is disconnected in my server
You got a vps?
no but i dont find a good free vps
have you some tutorial because i absolutly don't know how to do and my google searches don't give me pertinent results
https://discordapp.com/channels/264445053596991498/272764566411149314/435070769924538370 there's a list of cheap VPS
But he wanted a free one. lol
yeh
There is no good free hosting
Unless you have a rich friend who would agree to host your bot
and heroku ?
is there a way to get a bot hosting on heroku ?
There is but you won't be able to:
- Save anything in bot folder from the script.
- Have voice support.
- Have you bot not restart every 24 hours.
There is nothing bad with having it restart
or really have any optimal performance
^^
Having your bot to play some games that depend on cache
That's true.
Or anything related to cache, I would say
Just save it to a db or something.
Even tho that's not that performance friendly
with datafire maby ?
What
Bruh
fire database sorry : https://console.firebase.google.com/u/0/
firebase
^^
how could i get my commands to work per guild only again? discord,py async
What's an app on mobile that I can use so I could host my bot?

Ping me for answer
hosting on mobile is possibly one of the worst ideas possible
Even though it's a bad idea, it can be possible. If you have an apple device then oof, nothing you can do, but if you have an android device you can download Termux from google play. You can install python, node and other languages on it
@earnest phoenix
I don't have an other devices
you only have an apple phone?
I have a Android Tablet
You can't do anything then. if you have an android then download termiux
read what I said again
can any1 help me pls
help with what?
I mean, I can't help yet because you didn't even say which language you are using, what the issue is and didn't provide the code. So please do those things
They said it was discord.py
but in js you should do message.channel.type !== 'text' instead
Ye
Discord.js
// These are my variables:
let mGame = member.user.presence.game;
let type = { 0: "Playing", 3: "Watching" };
// And this is how I use it in my embed
.addField('Activity', `${mGame ? mGame : "Nothing"}`, true)
There is no error, but I've tried to solve my issue for hours now. So before, in my embed i had this:
.addField('Activity', `${type[mGame.type] || "Nothing"}(${mGame.type || ""}) ${mGame || ""}`, true)
This worked perfectly, but the thing is when the user doesn't play anything I get an error saying "can't read "type" of null", which makes sense, but really, the new one I made, it doesn't tell me the type of the mGame, which I wan't, it just tells me what the persons activity is. Can someone help me fix this problem?
No, I cant do if statements
Inside a field param
if i wanted to use if statements i already would
how about
if(statement) {
.addfield
}
else {
.addfield
}
guys..
I'm not gonna use if statements
And that wouldn't solve the issue either
@earnest phoenix
yes it would
No
ok I am trying to figure it out
Because mGame would still be null
you havent even tried it
The type wont be able to read mGame
please go try it before saying it wont work
For fuck sake good help right there ^
if(object) in javascript checks if the object is null/undefined
is mgame.type defined?
I've been trying to solve this goddamn issue with well experienced programmers for 3 hours straight and you think I / we haven't tried using if statements @earnest phoenix
@carmine echo there is literally a variable for mGame, I provided it xD
and your response is no i don't want to
mGame is still null
@earnest phoenix calm down
@earnest phoenix ive tried what you told me to hours ago
I've had a similar issue. When a bot performed anything that would send the user a DM, the message object would suddenly become null and crash the bot, even though it had no reason to
God. That won't print the type @earnest phoenix
wat
it's literally
if(myobject) {
.addField("my object is defined, i can use props on it")
}
else {
.addField("my object is not defined, i can't use any props on it")
}
why would you need to put it in blocks
because formatting ™
I don't wanna use if statements, how many times do I have to say this, for real?
great
Why don't you
I've seen people do this
function foo ()
{
bar()
}
Like wtf why would anyone do this
Because i dont want to
That's not bot dev-y from you
I completely refuse to use semicolons
My code has 0
I don't use for loops because of that
Just because you don't wanna use it doesn't mean it's not gonna work 
^
But to be honest, not using if statements to prevent issues is a stupid idea
what does their avatar have to do with anything
I have an iPhone that is Huawei
If you think hard enough, everything does
you seem to be confusing the terms iphone and smartphone
(Someone also didn't get a bit of sarcasm in there)

apple invented discord
But I've heard someone say that they have an ipad made by samsung that runs windows
windows can run on arm
yes
and you could run windows on an x86 phone/tablet
someone managed to run windows on a switch
switch is arm /shrug
Good article, felt like I should pop it in here in-case anyone looks in search
http://codetheory.in/using-the-node-js-bcrypt-module-to-hash-and-safely-store-passwords/
Using bcrypt is the proper way to store passwords in your database regardless of whatever language your backend is built in - PHP, Ruby, Python, Node.js, etc. Why ? Here's the answer. So how do we go about employing this technique in Node.
just store them in plaintext
my favorite
nah lets use json for everything

@client.command(pass_context=True)
async def customemote(ctx):
if ctx.message.author.id == beta:
#Codestuff
i dont get the IDs in beta = [] to get access to command
519219093878997000, 297025946773356544]```
tag me with a suggestions
you're checking if an id is equal to a list
you need to check if the id is in the list
nvm
also my name why
It has been over 5 hours now and discordbots.org still has the old profile picture of my bot cached. How do I update it?
try editing the bot and saving
tried 3 times
client.guilds.get(guildID).shard.send(packet)
send(guildID, packet) {
if (client.guilds.has(guildID)) return client.guilds.get(guildID).shard.send(packet);
throw new Error('attempted to send a packet on the wrong shard');
}
I am unsure of how to actually send the packet
Bc the npm package I am using uses client.ws.send
but in master that doesn't work
d.js master*
April 6th 2019, 10:51:18 am :: Clap Bot Beta has been put online.
April 6th 2019, 10:51:26 am :: Loaded commands.
April 6th 2019, 10:51:27 am :: Successfully connected to database.
April 6th 2019, 10:51:35 am :: Clap Bot Beta has been put online.
April 6th 2019, 10:51:35 am :: Loaded commands.
2
2
KawaiiPanda#6311 has gadined 2 and 8
(node:11944) DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.
April 6th 2019, 10:51:36 am :: Successfully connected to database.
10
When I do that
it restarts the bot
i get this error: Command raised an exception: TypeError: Object of type Record is not JSON serializable
for this command:
@bot.command(aliases = ["warnings"])
async def warns(ctx, *, user: discord.Member = None):
warns = await bot.pool.fetch("SELECT * FROM warns WHERE userid = $1 AND guildid = $2", user.id, ctx.guild.id)
embed=discord.Embed(title='Warnings', colour=discord.Colour.gold(), description=warns, timestamp=datetime.datetime.utcnow())
embed.set_footer(text='GBot')
await ctx.send(embed=embed)```
well yeah
cry
;v
it's a sql record you cant just throw it into something that takes a string
for loop it
so in the discord.js docs it says the embed color must be a number but what about things like "CAC232" or "random"?
https://discord.js.org/#/docs/main/stable/class/MessageEmbed?scrollTo=color
oh
clearly states that this is just for received embeds, https://discord.js.org/#/docs/main/stable/typedef/ColorResolvable
here are the options you have for embed colors and their respective representations
thats exactly what i was looking for thanks
didnt know there are colors like "PURPLE"
i thought its only just hex and random
but ye thanks
time to reset
may want to regen that
It's in bot hell now
there are logs in bot hell and whatnot
It will forever be logged in #265156361791209475
how do i regenerate?
on the discord developers page
Integrate your service with Discord — whether it's a bot or a game or your whatever you wildest imagination can come up with.
select your application, go to bot, and there should be an option to regenerate the token
What is an Illegal return statement?
return must return a value, and must be used inside a function
That is my full code
it does return a value
This only happened on my beta bot
I just tried it on my Real bot
and it works fine
they arent
Yea, I thought so.
ok
I don't know why it is erroring though
cause like
it works on my other bot as I said
but when I started to rewrite it into d.js master
it started erroring
I feel so dumb
I got it fixed
I forgot to save
It was using code from before
Lol
so this isn't technically bot development but its directly related to my bot
I've never used oauth2 before, once I have the user's code, can I just use that to authorize api requests?
Or wait no it looks like I then have to use the /oauth2/token endpoint to get the token nvm
wait maybe
wait idk what's going on I'm just going to try it
you need to exchange the code for an access token
an example of which is in discord api docs
im trying to submit my bot
im getting
"Detailed description too short"
but my description is 351 chars
Then you must make your long description longer
without spaces
Screenshot?
Description
e
That is not a screenshot
Just send a screenshot of the whole page
Anyone able to help me out real quick with giving rewards to someone upon them voting? (nodejs)
How can I make it so that the Event class recognizes the event by the event file's filename?
https://gist.github.com/SinistreCyborg/f9638d08b34a0ecb08164b50d382213d
dbl.hasVoted(message.author).then(voted => {
//reward
});```
@earnest phoenix
@opaque eagle you can try something like this ```js
class Parent { constructor() { console.log("I'm " + this.proto.constructor.name); } }
undefined
new Parent()
I'm Parent
Parent {}
class Child extends Parent { constructor() { super(); } }
undefined
new Child()
I'm Child
Child {}```
not file name but you can just have the classes named the same as the file
there's someone here using simple-youtube-api to search videos on youtube?
(JavaScript bot)
how do u check how many votes your bot has
Ty
@bot.event
async def on_command_completion(ctx):
print(f"{ctx.author} used the {ctx.command} command at {ctx.guild.name} ")
commcompl = await bot.pool.fetch("SELECT * FROM cc")
await bot.pool.execute("UPDATE cc SET commcompl = commcompl + $1", 1)```
i am trying to keep up with how many times commands are completed, but it doesn't update
Why does this happen? https://gist.github.com/SinistreCyborg/1f50385b88a5ab78fdef93d9d6246d57
I’m using enmap for my bot and after a little while as the bot is being used, it then starts spewing this error (node:5956) UnhandledPromiseRejectionWarning: EnmapTypeError: The key "264445053596991498" is not of type "Object" or "Array" in the enmap "guild_data" (key was of type "String")
The key was fine before but idk why its now cause if this error.
Ik what’s wrong tho, the data associated with the key is corrupted over. So any ideas on what’s causing it to corrupt would be greatly appropriated.
@opaque eagle probably because there's a comma after that?
Wdym
What frustrates me is that ...args does contain all the parameters before CommandOptions?
theres a comma at the end of that line
but you can't have a comma after the last one
Wait where?
- That is valid.
- Removing the comma doesn't fix the error... I just tried.
You can't have a trailing comma in JSON, but it's valid in JavaScript objects.
oh weird
It's preferred b/c it saves an extra line of commit if you're adding a new property
i want to add bot at discord and make other account when i want to add the bot.but now I can't go to my first account and add bot 😅
Any solution
that isnt english
you can only add bots to your server if you have admin privileges iirc
did they change that? i couldve sworn it used to be admin only
it was always manage server afaik
Lol
oof didnt know
ah sorry i dont know python so cant help
@earnest phoenix maybe ask in the d.py server?
dunno if anyone active here knows py
did u send a chain message
no
Unless other people had a guy named Enter New Name do something to them
then....
?
what i posted was about this guy named Enter New Name
then insta banned
Hey, anyone uses Spotify here in Js?
Anyone can give reply of my question?
I just said don't trust them
Leave
No U
@earnest phoenix please dont be rude
nobody has responded probably because nobody knows about that
Hi @bright spear
wot
If I add your bot to a server to me, you add mine?
@earnest phoenix general please and No aDs
Okay, sorry for the inconvenience.
@earnest phoenix Don't advertise, It's stated in our rules
I'm not becoming rude bruh, I shut down my laptop that's why I said 'leave'
what
that... makes no sense
when you say "leave" like that it means you're telling someone to leave
Oops
ah hes just mad that he was dumb enough to give me his server credentials a couple months back and got his server rm rf'ed
who
lmao
Ahh! Leave it.
Does anyone know if the "Test Webhook" button is borked on the "Edit Bot" page? It alerts that it succeeded but I've been waiting and my hook hasn't been called.
@upper roost did you save before testing?
so im trying to create an event emitter to communicate between 2 js files but it isnt working and i have no idea why
// main.js
const { EventEmitter } = require('events')
const gameDispatcher = new EventEmitter()
gameDispatcher.on('end', _ => {
app.quit()
})
module.exports.gameDispatcher = gameDispatcher```
```js
// view/index.js
const { gameDispatcher } = require('../main.js')
gameDispatcher.emit("end")```
it complains about `app` not being defined in `main.js` on a completely unrelated line
app is defined and works perfectly in main.js
!spotify
Hello. It's been over 15 hours and DBL still has the old profile picture of my bot cached. Any way to force it to update? I tried editing and saving many times
ok thank you
yourMap.get('numbers').id
what's ('numbers')?
but i dont know that
So you have a discord.js collection. Do you want to get all the ids as an array or do you want to get a specific one?
const users = message.reactions.get("🎉").users;
console.log(users);
i want all the ids in an array
just the ids
yourMap.map(x => x.id)
TypeError: this.off is not a function
Why would I be getting this?
I am trying to host the bot on my vps
off is not a function?
and I get this error
did you at any point try to call this.off
no not that I know of
it turns a discord.js collection into an array of ids
=> is a function (sometimes also known as lambada)
lambda
it is an arrow function
yes
Still don't know why I am getting this.off is not a function
you could also do this
yourMap.map(function(thing) { return thing.id })
so like:
var newArray = users.map(x => x.id);
```?
more or less, yes.
ok thank you
You can rename x to whatever you want
ok
.map() takes a function as it's first parameter
then passes the user object as the first parameter to that function and puts back whatever the function returns
oh ok
ok
msg.channel.createMessage(`If you want to support me then give a vote https://discordbots.org/bot/${client.user.id}/vote`).then(m => m.delete(10000));
``` Why this is not working
what is delete(10000)
It's not deleting the message after 10000 interval
is that eris?
Yep!
msg.channel
that shouldn't be the issue
it's a method on the channel object
there is no such thing as delete(number)
does message even have a delete method 
Gn
.then(m => setTimeout(() => m.delete(), 10000))
thnx
might have been a bit too spoonfeedy but ok
It's working
1|clap | at Function.Module._load (module.js:498:3)
1|clap | at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:27:21)
1|clap | at Module._compile (module.js:653:30)
1|clap | at Object.Module._extensions..js (module.js:664:10)
1|clap | TypeError: this.off is not a function
1|clap | at WebSocketShard.onReady (/home/kawaii/Clap Bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:171:14)
1|clap | at Object.onceWrapper (events.js:313:30)
1|clap | at emitNone (events.js:111:20)
1|clap | at WebSocketShard.emit (events.js:208:7)
1|clap | at WebSocketShard.onPacket (/home/kawaii/Clap Bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:339:14)
1|clap | at WebSocketShard.onMessage (/home/kawaii/Clap Bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:264:10)
1|clap | at WebSocket.onMessage (/home/kawaii/Clap Bot/node_modules/ws/lib/event-target.js:120:16)
1|clap | at emitOne (events.js:116:13)
1|clap | at WebSocket.emit (events.js:211:7)
1|clap | at Receiver.receiverOnMessage (/home/kawaii/Clap Bot/node_modules/ws/lib/websocket.js:789:20)
Full error
const { Node } = require('lavalink')
const queue = require("./LavalinkQueueManager.js")
module.exports = (client) => {
const voice = new Node({
password: 'kawaiipanda',
userID: client.user.id,
hosts: {
ws: "ws://localhost:2333",
rest: "http://localhost:2333"
},
send(guildID, packet) {
if (client.guilds.has(guildID)) return client.ws.shards.first().send(packet);
throw new Error('attempted to send a packet on the wrong shard');
},
});
client.on('raw', pk => {
if (pk.t === 'VOICE_STATE_UPDATE') voice.voiceStateUpdate(pk.d);
if (pk.t === 'VOICE_SERVER_UPDATE') voice.voiceServerUpdate(pk.d);
});
client.music = voice
queue(client)
}
with code I think the error is originating from
what
password: 'kawaiipanda'
Oh lavalink
Yea
Lavalink
@carmine echo also yes password is kawaiipanda
lol
I couldn't think of anything else
I never used lavalink
kk
Lavalink is good
I know
Because I used it in Java, the music quality 😍

Just gonna say
you said ou never used it
but anyway
#general if we are going to continue this
which I am not
but you feel free too
ok sorry
in what context
are you using that in your code? maybe this is being called from an improper place so it has the wrong reference

I am using master
meanwhile my problem still stands
Wuts your problem?
_ It's been over 15 hours and DBL still has the old profile picture of my bot cached. Any way to force it to update? I tried editing and saving many times_
I've already eliminated the possibilities that it updates every 1, 2, 6 and 12 hours. So I am just hoping that it'll be 24 hours
it better not be 72
xD
are you a hundred percent sure it is not your browser cache
Guys since i'm new to pages with reactions i wonder if someone can suggest me something
If my bot sends a message with reactions i have to memorize the id of the message so when i get the event "messageReactionAdd" i will check if the id of the message is one of the messages with pages into it?
should i remove the message id of pages if it's too dated?
just to avoid having a long array
If someone doesn't use reactions for 30 seconds?
yeah
So you do like an Interval?
well in my case im using c# so im not quite sure of a js equivalent
Or just dont have 9999 commands
wat
I suppose we're talking bout a help command
y
And i decided to send 1 message per category
one simple solution is to have a website for the list of the commands, then simply redirect the user to the website
I can do it with pages or simply send less messages
I thought to use normal pages
I see
But that was not the main problem
I was wondering how to make it work
So, i think i should memorize IDs of messages somewhere
And whenever someone adds a reaction to a message in that array it will trigger something
discord.js
Have an array of arrays and which each array being a "page"
ye
bruh
How to make clickable text in discord.py embed?
yes
no
very much yes
no
Emil i sent you a link that generates for you the embed
ik
k then
but i dont want author
no space in between
congrats you have a space
i need it in add_field stuff
Wesley
owo
Didnt see that i could not have a space there
its markdown
new Discord.ReactionCollector(messagefilteroptions);```
yes
Just await your bots reply
And call createReactionCollector() on it
Do you need an example 😂
Actually i can't get the whole mechanism
gay ^
someone help me
this code
(node:4) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined
of this
What do I change?
I understood nothing
change userUpdate to the correct event
not sure which tho
try guildMemberUpdate
but im not sure if it works
did not work
well from rereading it seems the code can't get the server id from oldUser
so might need to check in that too
if I remove this line, the bot will get an update from all users
Someone know about a cool premium feature for a bot? Tag me
@trail dagger custom command
i dont have web dashboard
make features that are worthy of the price
like what
how would i know, its your bot and your brain 🤷
How would I set default values for a MessageEmbed?
Like I'd want a specific color, footer, timestamp, etc, unless otherwise specified.
You can create a method
Or a function
createEmbed(author, title, color, footer, avatarURL, url, description, thumbnail){
const embed = new Discord.RichEmbed()
author ? embed.setAuthor(author) : false
title ? embed.setTitle(title) : false
color ? embed.setColor(color) : false
footer && avatarURL ? embed.setFooter(footer, avatarURL) : false
footer && !avatarURL ? embed.setFooter(footer) : false
url ? embed.setURL(url) : false
description ? embed.setDescription(description) : false
thumbnail ? embed.setThumbnail(thumbnail) : false
return embed
}```
I do something like this
If i don't specify anything it will use the "false" as default
But you can change it to fit your needs
Eh it's kinda lame for a solution... I was looking to extend the MessageEmbed class
TypeScript / JavaScript
Yeah
^
didn't knew
That's kinda what I've resorted to doing rn... I'm extending the MessageEmbed class and using defaults in the constructor
well it was an outdated solution anyway
My solution:```ts
import { MessageEmbed, MessageEmbedOptions, Message } from "discord.js";
export class FeliciaEmbed extends MessageEmbed {
constructor({
color = // whatever
}: MessageEmbedOptions, message: Message) {
super(data);
}
};```
I think you can add a custom function to the prototype MessageEmbed class
That's pointless
And it is working?
I have another seemingly dumb question... Can I set properties of process and have it carry over from file to file?
your solution
Yeah atm
@pearl kelp aayyyy, rip x
@bright spear 🤦 nope, I just saved it and it's working now, thank you!
hey
can someone help me
i want to make invite command
but idk how to make the link like join
big oof
?
Language @earnest phoenix?
js
buddy, stop splitting lines so much, thanks.
so just make it reply with a message that contains the link?
maybe
absolutely.
prefix and somethink the reply message is hello you can join our discord click and when you click on the click text it opens the link
you can have markup in an embed
i didnt understand
@earnest phoenix https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet
refer to the Links section
i know html
i didnt mean like that ill type a command and you will see what i mean go to testing 1
markdown is not html but ok
markdown was made to simplify html
hm
how i can use html in my bot
please read the part about links
yes
you can use it just as they did there
ok
(text)[link] I think
other way round isn't it?
it is
bot.guild.channels.find(channel => channel.name === "votes").send(`<@!${global.uid}> (${global.uid}) has voted and recieved ${global.vcu} vote crates and ${global.vpu} vote points`)
whats wrong here?
client doesn't have a guild property
it has one called guilds which is a collection of servers your client is in
const guild = bot.guilds.get("556648764841000980");
bot.guild.channel.find(channel => channel.name === "votes").send(`<@!${global.uid}> (${global.uid}) has voted and recieved ${global.vcu} vote crates and ${global.vpu} vote points`)
what should I make it?
remove the botfrom your second line
and disregard what lazyneko said
its channels
guild.channels.find
yes
ok
@marble needle so it worked
but
its undefined now
because its not in an event
K
Ah
can someone send me the code
in js
when you click to a text example (here) it opens a link
@earnest phoenix you've been told multiple times already how to do it
i dşidnt understnad at there
take some effort out, and read it so you can understand it a bit
dude
you havent even opened the link you got sent
wtf
i did
done lie
dont
otherwise you would have seen theres about 10 examples about hyperlinking
Then scroll to the damn links section, and read it.
yea there is
and html python js
and there is also the code shown that lets you see how they did that
^

.....?
Does anyone know if there is anyway to get an invite of a guild the bot is in using code?
In python
I don't think that is allowed
You better not do it without the users' consent
Yes
i have a levelbot that can send messages to users on levelup. However both serverowner and user have the option to turn that off and on. By default no messages get sent. The serverowner has to activate it, but a member then by default receives these messages from the respective server until he opts-out (as described in every level up message).
is this bad practice / not allowed / user unfriendly?
i think it's allowed
Ok it has been over 30 hours and dbl still has my bot's old profile picture cached on the website
how am I supposed to update it
Why doesn't ctrl + shift + 7 comment something in VS Code?
@carmine echo You know, there is one place to update the profile picture and name for the application, though there is one for the bot user too
On General Information you just update the application
Though on bot you update the bot user
async def kick(ctx, member: discord.User, *, reason='No reason was given'):
if ctx.message.author.server_permissions.kick_members:
embed = discord.Embed(color=0xffff00)
channel = client.get_channel(560915918192902145)
embed.set_author(name='Kick')
embed.add_field(name="User", value="{} ({})".format(member, member.mention), inline=False)
embed.add_field(name='Kicked by', value=f'{ctx.message.author}', inline=False)
await client.send_message(channel, embed=embed)
await client.kick(member)
else:
await client.say('You dont have permission to use this command')
Nothing is wrong right? is should send to the channel but still it doesnt
hope i am not blind
Guys how to let the bot use custom emojis?
He must be into a server that cotains them?
yes
use @!thonk
and use everything between <>
just do @\ and so the emoji you want to use
obviously it did lol
thank you cry 😄
😮
oof
@dull bobcat It does update the bot's profile picture, as it is different now, but perhaps it does not fire some pfp update event or something. I'll try.
wrong channel, sorries
is there a way i can change this color? i tried edting the background but that didnt change it
?
is there anyway i can change the background color of the description section to match the theme the user has?
on embeds? @vivid mortar
Hello. I currently have a collumn for my inventory system in my SQLite database. It should be filled with a JSON that has the inventory items in it. Right now, I am trying to put like for example, 3 of items and put them into a Discord Embed. How do I do that? I tried using a for loop, but either that's not going to work, or I am just dumb and I don't know how to do that with the loop.
@bot.event
async def on_message(message):
if message.content.startswith('!goodnight'):
await bot.say
embed = discord.Embed(title="goodnight", description="Sleep well!", color=0x00ff00)
embed.add_field(name="Field1", value="goodnight", inline=False)
embed.add_field(name="Field2", value="goodnight2", inline=False)
await client.send_message(message.channel, embed=embed)
after I used these code it printed log in as doraemon and the bot cilent but then it doesn't respond to any commands
Is this wrong code or it's down
@vivid mortar css, by using the <style> tag, although I am pretty sure that html and markdown do not like each other in this case, so idk
no
<style>
body {
background-color: #292D33;
}
</style>
ok i will test that
or just <body style="background-color: #292D33">
nope
wym
<style>
div.longdescription {
background-color: #292D33 !important
}
</style>
div.content maybe?
for me it changed the frame
but it changed here
['music', 'member', 'chat', 'channel', 'roles', 'games'] cannot be loaded. [Callback is already a command.]
ah I see
.longdescription .content {
background: #292D33 !important
}
anyone know why tf this happens?
no just use this
ok
finally
learn css
yesyes
waitwaitwait, traceback stack?
The traceback
['music', 'member', 'chat', 'channel', 'roles', 'games'] cannot be loaded. [Callback is already a command.]
epic
Related code please
@unreal rampart Provide the code causing this issue or we won't be able to help
nvm i made it darker apparently
I dont know what code is causing the issue, as i got this after i restarted me IDE, and not before, i didnt make any changes
looks epic tbh
nvm i fixed the issue
it looks unreadable
awww really ^
i suggest sticking to 2 or 3 colors instead of mixing all of them
very readable to me. although I would not use colors as it's a useless dependency
not like I don't have many useless dependencies already though
this is basically how i set up my logging, i still need to fix a container bug but

Oh yes I completely forgot
my issue still stands
for over 30 hours
DBL still has the old version of my bot's pfp cached. how do I force it to update?
Are you sure its server side and not client (aka your browser)
I tried other devices
now it shows up like this
and it still has the old profile pic on the bot listing
Seems like it tried to update, but gave up in the middle
Can you send me the link to your bot page in DMs
anyone worked here with react?
i have a master component that keeps track of states of other components, it does that for every single one how it's supposed to expect the for the second one; https://i-love.weed.moe/OJdBvmyl.gif
nevermind im dumb, i never changed the states in the master component from the child component
my b
Python?
use contains
@earnest phoenix link to docs?
javascript, right?
yeah
its just a simple includes(word) i think
nope
oh nvm
js str.includes(substr)
you are confusing py with js
how do i see if something dont have a dot then?
if (input == "folders") {
fs.readdit("./", (err, files) => {
if (err) return console.error(errString + err);
let ffiles = files.filter(f => f.includes("."));
ffiles.forEach((f) => {
console.log(sysString + f)
});
});
}
I mean, this gets all the files but i want the folders which usually dont contains with a dot in their name, so how do i make ffiles without the dots only?
const filter = (reaction, user) => {
return ["❌"].includes(reaction.emoji.name) && user.id == message.author.id;
}
message.awaitReactions(filter, {
max: 1,
time: 1000 * 30,
errors: ['time']
}).then(async (collected) => {
let reacion = collected.first()
console.log(reaction)
if(reaction.emoji.name == "❌"){
await message.delete(1000)
}
}).catch((e) => {
console.error(e)
})```is there any reason this wont work? It never logs the reaction either
well I see a typo, but I dont know if it would affect much
Yeah no difference
Hey
what lang + lib do you recommend for image generation?
I would like to make an API for my bot but all the libs I tried are either leaking or bad for some other reason
i'm trying to git clone chromium but I don't wanna leave my PC on over night cloning 14.8gb of files
what can I do
anyone knows how to loop through all users within a specific role? (discord.js)
you won't have the history, but if you don't need it (eg just building it) there's no need
Can you not post that here?
@spare swallow #memes-and-media for that please
haha I remember building chromium as well and I just did that because the repo is too big
Are there any kind of security things I may need to worry about if I am building a bot that writes things to databases?
don't use default passwords
or even better, block outside connections on the db port if possible
I should have specified, I mean databases relating to SQLite3

Unless those apply
Still noted
or just \❌
How can I remove this "play station theme thing" (I think you all know what I mean circle , square, ..) from my discordbots.org website ? I dont know much about HTML thats why Im asking
Ok thanks
cad? computer assisted design?
Computer aided dispatch system I'm guessing for fivem correct?
Is there a link you can send me
For?
For gta 5 role playing ps4 for my server
If you want a cad that's already made it's called opencad but this isn't the place to ask.
this is bot development not server development
Sorry
lmao
general development is also accepted here
Yeah
hey
Does anyone know on how to set the User & server display in total on a python3.6 bot in watching server XX
So can I send message.guild.iconURL as an attachment in a message.channel.send() function?
I’m trying to make a command to show avatars
i guess
It isn’t working too well
Actually nvm
I can just send different embeds instead of messages
ok
Also getting the glitch
Where my bot is sending two messages instead of one
Resetting the token usually fixes that right?
uh
Have you tried turning it off and on again?
I might be restarting the bot too fast?
I’m making anew command as we speak
And testing
The control Cing the bash terminal
Then running node again
I’ll just try and make sure the bot goes completely offline before turning it back on again
ok
Yall are wrong bruh
The application is running twice
Probably one in command prompt and one in yiur text editor
But a restart of your pc should fix it
And if it doesn't, then just fuckup a part in your code so it errors
@broken elm
For discord.js 11.4.2, how do you get the name of a user with the tag?
user.tag @silver lintel
because linux is the superior os
@broken elm k, then you run your bot in terminal and your text editor, running same application twice will just make everything twice
thats not th eproblem