#development
1 messages · Page 1943 of 1
go slep
You don’t know you can download and run Pi OS on your own hardware?
isnt pi OS setup for arm?
I mean you spoke about RPIs and I about the OS and that has nothing to do with each other in the first place but I need to do stupid comments sometimes you know
well yes, but why install PIOS to use less power when you can instead download more ram
would it even perform well on x86
before i go I will leave you guys with this lovely image ove my dads 20 year old voip server that hasnt been cleaned in 15 years
gn people
hahaha
gn
give it a ||blow job||
That’s actually damn clean for 15y
You can’t imagine how my server looks after a few month in my garage

i tried had to use a brush cuz the vacuum wasnt strong enough
anyway slep time
i use brushes used for painting, they work amazingly well
like these ones with soft brush, i had an unused one around and started using it to clean electronics, and damn it works amazingly well. i keep it always with me ever since https://ftaelectronics.com/image/cache/catalog/Tools/Masonry Tools/3pcs Flat Paint Cutting Brush Soft Bristle Hard Plastic Painting Stain (2)-1024x768_0.jpg
compressed air is also good, but it finishes very quickly
and doesnt remove the lower dust layers that are stuck to the surface
ok so my bot has Speak and Connect perms and still can't join my channel. Its a public channel that everyone can access
Shhh… nobody has the time to cleanup things you can’t see
Imagine cleaning up under your bed 

who does that? not me :^)
Man… first time bought some LED strips and shapes to pimp by rooms and it looks amazing
Always thought that’s just waste of money
oh shit i thought this was general chat

ok so can someone help me plz
Not if you don’t provide your errors and associated code
Can you use buttons w/o a Interaction / Slash Command?
I mean it goes on the embed, but can you do like message.edit({ embeds:[test1] }) or something?
message.reply({ embeds:[embed], components:[row] })
const filter = (message1) => {
if(message1.user.id === message1.member.id) return true;
return message1.reply({ content: "You can't use this button" })
}
const collector = message.channel.createMessageComponentCollector({ filter, time: 15000 });
const wait = require('util').promisify(setTimeout);
collector.on('collect', async i => {
if (i.customId === 'safety') {
await wait(400);
await message.editReply(`Testing Edited`) }
})```
I assume you can't do that? As it doesn't work for me `o-o`
Components always trigger an event when being used, except buttons acting as links
heh?
Huh?
huh is right. 🤣
You may wanna tell me what you mean in other words then
I'm just trynna edit the embed that was originally sent, but its not a slash command so wondering how to do that.
like usually I can do interaction.deferReply() then interaction.editReply idk how to do that much with just a normal prefix command.
Simply edit the message
message.edit?
Yeah
nvm
Yeah same error
message.reply({ embeds:[embed], components:[row] })
const filter = (message1) => {
if(message1.user.id === message1.member.id) return true;
return message1.reply({ content: "You can't use this button" })
}
const collector = message.channel.createMessageComponentCollector({ filter, time: 15000 });
const wait = require('util').promisify(setTimeout);
collector.on('collect', async i => {
if (i.customId === 'safety') {
await wait(400);
const e1 = new MessageEmbed()
.setAuthor(message.author.tag, message.author.displayAvatarURL({ dynamic:true }))
.setDescription(`Testing`)
await i.edit({ embeds: [e1] }) }```
The interaction has a message property
And yeah you can’t edit messages of others but messages your bot sent
Hah, got it
I just figured out you can defer a message 🤣
Same thing as kinda a interaction
Wow, that opened my eyes a lot 🤣
You’re confusing me
Jumping from editing an embed to interactions to deferring messages
lol, yeah im good at confusing people 🤣
If you wanna keep the content but update the embeds simply use the properties of your interaction
interaction.message.edit({ content: interaction.message.content, embeds: [new_embeds] });
Same goes for if you wanna keep the components
Deferring and updating the message will only work for 15m
Editing the base message always works even if somebody uses the component a year after
(if you can edit a message after a year, not sure about that one tho)
const wait = require('util').promisify(setTimeout);
you can use timers/promise for this
or you can just use a normal setTimeout with an async callback
Music bot seems to not be able to connect to voice channels even tho it has the required perms
code:
@client.command()
async def play(ctx): #works
try:
if ctx.message.author.voice == None:
return await ctx.send(embed=discord.Embed(description="You need to be in a voice channel to use this command!"))
print("Issue: No Voice Channel")
channel = ctx.message.author.voice.channel
voice = discord.utils.get(ctx.guild.voice_channels, name=channel.name)
voice_client = discord.utils.get(client.voice_clients, guild=ctx.guild)
if channel == voice_client:
return await ctx.send(embed=discord.Embed(description="I am already playing music in your voice channel!"))
try:
if voice_client == None:
voice_client = await voice.connect()
else:
await voice_client.move_to(channel)
except:
return await ctx.send(embed=discord.Embed(description="I am unable to join your voice channel! Make sure I have permissions to `Connect` and `Speak`."))
source = FFmpegPCMAudio("http://stream.rudolph.dbot.cc/proxy/oaktradi/stream",**FFMPEG_OPTIONS)
voice_client.play(source) # play the source]
await ctx.guild.change_voice_state(channel=channel, self_deaf=True)
embed = discord.Embed(description=f":christmastree: Now playing christmas music! :christmastree:")
await ctx.send(embed=embed)
except Exception as e:
await ctx.reply("Something went wrong! Try `f!leave` and then try playing the music again. A common cause is me not being able to see the voice channel. If this problem percists, please dm a bot dev.")
channel = client.get_channel(899416695914000465)
await channel.send(embed=discord.Embed(title="Error!", description=f"`{e}`\nServer: `{ctx.guild.name}` ({ctx.guild.id})\nUser: `{ctx.author}` ({ctx.author.id})"))
what error do you get
If a date is provided it must be a timezone-naive datetime representing UTC time.
What does this mean
Should I give datetime object with timezone or without timezone?
Without?
Naive means there's no information about the timezone
Timezone-aware is the opposite of that
Thanks brother was literally confused over it

so assuming i am listening to the interactionCreate event for slash commands. whats the best way to temporarily provide support for the classic commands? like, should i listen for message events too and then parse them? or is there a cleaner way?
im guessing ill just have to listen for messageCreate's?
do i need to enable the intent for it atm too?
or is it ok to ignore that atm since ill be removing the listener before long anyway
nope not til april
sweet, ty ❤️
np
i do tend to over use the semicolon lol
like, i know its not needed, but my brain makes me to it! 😢
yet there isnt one after the processCommand();
lol
#inconsistencies
side note: did have to add an intent there
@pliant gorge
@tight holly
is it possible to define a specific server for a specific shard?
possible yes, but hacky
and probably not the way you imagine
like, if you have 4 shards, and the server you want is in shard 3, you cant magically move it to shard 1
probably not connection wise
but you can create a new special shard that only has that server in it and nothing else
How can I do this?
it does not remove the server from the other shards tho
ok
tim please spill the beans you got me curious
use the sharding formula, for example discord.js has Discord.ShardClientUtil.GuildIdForShardId() or something like that
then get the shard id it would have, if you had 2 billion shards (basically the 32 bit integer limit)
and start a new shard with that shard id, and 2 billion shard count
wait so discord doesn't randomly decide which server gets what shard
nope
ok that's news to me
shard_id = (guild_id >> 22) % num_shards
but then you could theoretically write your own sharder to have all premium servers in a special shard which the bot restarts every once a while to sync purchases
yes you can
yes
but if you have 100 premium guilds, you need 100 extra shards, which can be a hassle to manage
and there is always a risk of collisions
This is what I want
its not guaranteed that that guild will be the only guild in that shard
discord doesn't have to know you didn't make another shard for the guild:)
nah they dont care
i use this method for developing purpose
for example when i run my bot in dev mode, it starts a single shard with only my guild in it
ahh
so it connects instantly, instead of waiting for all 10k guilds to connect
and the production bot keeps running like normal at the same time
so i mean, when i split a server, will it spawn a new shard?
imagine you have 4 shards and 4k guilds, 1k on each shard
ok
before:
shard 1 -> 1k
shard 2 -> 1k
shard 3 -> 1k
shard 4 -> 1k
after:
shard 1 -> 1k
shard 2 -> 1k
shard 3 -> 1k
shard 4 -> 1k
shard 359374987 -> 1 guild
hm
that 1 guild in shard 359374987 will be a duplicate guild, it will not be removed from the other shards
do you have any code examples?
can i remove guild from other shards ?
const n = 99999999;
const guild = "475847364758495069";
const shard = Discord.ShardClientUtil.shardIDForGuildID(guild, n);
const client = new Discord.Client({
shards: [shard],
shardCount: n
})
client.login(token);
no
hm
the total shardCount yes
the higher the number, the less chances of a collision happening (2 guilds who accidentally have the same shard id)
im not sure what is the maximum number discord accepts, but i believe its around 2 billion (the 32 bit integer limit)
hm
I'm looking to create a server. If the language of being "pt br" goes to another fragment and if it is "en us" it goes to another one, the same thing for Premium
this method only allows you to isolate 1 guild per shard
hm
you cannot put multiple guilds in the same shard
unless you're very lucky with collisions, then you can maybe put 2 or 3 max
hm... ok
Hey
is there a good place to learn where to make a webhook to auto send votes into a channel?
ik Im dumb but like mongoose be saying query was already executed
const channel = await message.mentions.channels.first();
const guild1 = message.guild;
let webhookid;
let webhooktoken;
await message.channel.createWebhook(guild1.name, {
avatar: guild1.iconURL({ format: "png" })
})
.then(webhook => {
webhookid = webhook.id;
webhooktoken = webhook.token;
});
if (!channel)
return message.channel
.send(
"I cannot find that channel. Please mention a channel within this server."
)// if the user do not mention a channel
await Guild.findOne(//will find data from database
{
guildID: message.guild.id
},
async (err, guild) => {
if (err) console.error(err);
if (!guild) {// what the bot should do if there is no data found for the server
const newGuild = new Guild({
_id: mongoose.Types.ObjectId(),
guildID: message.guild.id,
guildName: message.guild.name,
logChannelID: channel.id,
webhookid: webhookid,
webhooktoken: webhooktoken
});
await newGuild
.save() //save the data to database(mongodb)
.then(result => console.log(result))
.catch(err => console.error(err));
return message.channel.send(
`The log channel has been set to ${channel}`
);
} else {
guild
.updateOne({ //if data is found then update it with new one
logChannelID: channel.id,
webhooktoken: webhooktoken,
webhookid: webhookid
})
.catch(err => console.error(err));
return message.channel.send(
`The log channel has been updated to ${channel}`
);
}
}
your help request has been denied
skill issue
assuming you're using discord.js - https://discordjs.guide/popular-topics/webhooks.html#what-is-a-webhook
I have done
which statement?
im guessing the new guild
Sad
nope, it's from the testing server that I have it in.
Learn hangouts
been there forever e.e
*issue 
i can't spell
?
He didnt even make a spelling mistake
He's so cool.
dont mind repl.it 
i will mind it
so the error comes from here?
you should setup some logging
this like my second time 
mongoose does a lot of things in the background so they might not even be coming from that
o.
I mean, it should be ig?
as opposed to a pure mongodb driver which does whatever you tell it to do
ok
/home/runner/Kumigg-Bot-1/node_modules/mongoose/lib/helpers/query/wrapThunk.js:21
const err = new MongooseError('Query was already executed: ' + str);
^
MongooseError: Query was already executed: Log.findOne({ guildID: '847392973511327764' })
at model.Query._wrappedThunk [as _findOne] (/home/runner/Kumigg-Bot-1/node_modules/mongoose/lib/helpers/query/wrapThunk.js:21:19)
at /home/runner/Kumigg-Bot-1/node_modules/kareem/index.js:370:33
at processTicksAndRejections (node:internal/process/task_queues:78:11) {
originalStack: 'Error\n' +
' at model.Query._wrappedThunk [as _findOne] (/home/runner/Kumigg-Bot-1/node_modules/mongoose/lib/helpers/query/wrapThunk.js:25:28)\n' +
' at /home/runner/Kumigg-Bot-1/node_modules/kareem/index.js:370:33\n' +
' at processTicksAndRejections (node:internal/process/task_queues:78:11)'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! kumi@2.0.0 start: `node .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the kumi@2.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-12-20T14_36_27_077Z-debug.log
god nodejs errors are sometimes useless
fr
can you replace instances of if (err) console.error(err); to throw err;
if you throw it instead of logging it it should give more details
wait no
a
the bot crashes so it cant be these

it doesnt go past this
await Guild.findOne(//will find data from database
{
guildID: message.guild.id
},
await Guild.findOne(//will find data from database
{
guildID: message.guild.id
},
async (err, guild) => {
if (err) console.error(err);
if (!guild) {// what the bot should do if there is no data found for the server
const newGuild = new Guild({
_id: mongoose.Types.ObjectId(),
guildID: message.guild.id,
guildName: message.guild.name,
logChannelID: channel.id,
webhookid: webhookid,
webhooktoken: webhooktoken
});
wouldn't it be this?
because it's making a new set of data while Im making one as well?

i dont think that should be the case
will probably do nothing but can you use the newer async syntax instead of the old callback method
my brain is confusion rn
const guild = await Guild.findOne({ guildID: message.guild.id }).exec();
instead of findOne({}, (err, guild) => {
})
well well well
would u look at that.
it solved it
but this came out
/home/runner/Kumigg-Bot-1/node_modules/discord.js/src/rest/RequestHandler.js:349
throw new DiscordAPIError(data, res.status, request);
^
DiscordAPIError: Maximum number of webhooks reached (10)
at RequestHandler.execute (/home/runner/Kumigg-Bot-1/node_modules/discord.js/src/rest/RequestHandler.js:349:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/home/runner/Kumigg-Bot-1/node_modules/discord.js/src/rest/RequestHandler.js:50:14)
at async TextChannel.createWebhook (/home/runner/Kumigg-Bot-1/node_modules/discord.js/src/structures/BaseGuildTextChannel.js:156:18)
at async Object.run (/home/runner/Kumigg-Bot-1/commands/Configuration/setlogschannel.js:22:5) {
method: 'post',
path: '/channels/847392973511327768/webhooks',
code: 30007,
httpStatus: 400,
requestData: { json: { name: 'Kumi.gg', avatar: null }, files: [] }
}

now discord isnt happy
you should delete some of your webhooks
in the channel
and add checks in your code to reuse webhooks
but thats a whole another issue
bro
I didnt even see the webhooks
the bot been spamming webhooks
yep ok
await channel.createWebhook(guild1.name, {
^
TypeError: Cannot read property 'createWebhook' of undefined
at Object.run (/home/runner/Kumigg-Bot-1/commands/Configuration/setlogschannel.js:22:19)
you mentioned the channel right
it sent that without even mentioning the channel e.e
just k!setlogs
and that came out

my bot running on a nokia bricked up phone bruh
bruh what is this code lol
const { id, token } = await channel.createWebhook(...)
you're awaiting something with a then method that mutates an outside variable
instead of just assigning the result of the awaited promise
am confusion.
might aswell show them const { guild } = message; too
this was my example of what the correct code would be
Can’t you do “const { webhookId: id, webhookToken: token } = …” also?
pov you work at top.gg
no
Iirc brain uses ip rotation and webhooks to get past global rate limits
damn i must work at top.gg for knowing basic destruction
i meant knowing about webhooks
because they do a lot of that
Not really
I mean still not that many
Plus those are constant
Unlike webhooks for logging or other purposes
Like censorbots resend or triviabot’s trivia questions
who?
sorry just my attempt at insulting you
@earnest phoenix i can help you explain a structure for it in vc
create and use
kk
H
Hey all. 👋 I have this code and I want to create an object with a property named as options and set it as as the array named as allSettings, although, I want to rename the id property in the property of the array of objects and rename it to value. How can I achieve this?
const allSettings = [{ name: 'New Follower', id: 'newfollower' }, { name: 'New Follower', id: 'newfollower' }];
const object = { options: allSettings };
console.log(object, object.options);
client.on("guildMemberAdd", async (member) => {
console.log(member);
member is undefined
I'm trying to do this in slash commands. 👍
I didn't ask for a How to make a slash commands bot.?
I can tell you are listening..
dont you want slash command options?
Did you read my question?
yes probably misunderstand sorry
allSettings.map(setting => ({name: setting.name, value: setting.id }));
Oh, .map() returns an array. I FORGOT. (When you use .forEach(). 💀 )
Thanks!
mh can i add custom emojis in select menu ?
bc when i put <:name:id> my bot doesn't replace by the emoji
What’s channel
Oh wait I didn’t see that
ngl the best way to get a message from a channel is just fetch to discord api manually because caching is annoying sometimes
best to just check if messages is defined then
would be the fastest workaround, not sure if it is the best
const existing = channel?.messages?.cache?.get(data.id);
if(!existing) return;
Can pm2 run a compiled C++ executable?
if it's through a console command, yes
Alright
anyone down to work on a python discord project?
nah
Bruh what sucks is I have a discord bot submitted for the website and I’m waiting, but the bot will be offline for 2 days ‘cause I’m moving houses 
And I feel like it’s going to get declined while it’s offline
It’ll be offline from about the end of today till Thursday I’m pretty sure
in what way?
So just put that in?
I need some help with Discord.py
My code;
@client.command(aliases=['ei','emoji'])
async def emojiinfo(self, ctx, emoji: discord.Emoji = None):
if not emoji:
return await ctx.invoke(self.bot.get_command('help'), entity='emojiinfo')
try:
emoji= await emoji.guild.fetch_emoji(emoji.id)
except discord.NotFound:
return await ctx.send("I could not find this emoji.")
is_managed = 'Yes' if emoji.managed else 'No'
is_animated = 'Yes' if emoji.animated else 'No'
requires_colons = 'Yes' if emoji.requires_colons else 'No'
creaton_time = emoji.created_at.strftime('%I:% %p %B %d, %Y')
can_use_emoji= 'Everyone' if not emoji.roles else ' '.join(role.name for role in emoji.roles)
description = f'''
**General;**
**- Name: {emoji.name}
**- ID:** {emoji.id}
**- URL:** [Link To Emoji]({emoji.url})
**- Author:** {emoji.user.mention}
**- Time Created:** {creaton_time}
**- Usable By:** {can_use_emoji}
**Other;**
**- Animated:** {is_animated}
**- Managed:** {is_managed}
**- Requires Colons:** {requires_colons}
**- Guild Name** {emoji.guild.name}
'''
embed = discord.Embed(title=f'**Emoji information for:** {emoji.name}', description=description, color=discord.Color.from_rgb(61, 31, 103))
embed.set_thumbnail(url=emoji.url)
await ctx.send(embed=embed)
Snippet from code with error;
return await ctx.invoke(self.bot.get_command('help'), entity='emojiinfo')
Error;
Command raised an exception: AttributeError: 'str' object has no attribute 'invoke'
Maybe removing the return word?
I'll try.
you're right
Yeah that didn't help.
Try ```py
@commands.command(aliases=['ei','emoji'])
async def emojiinfo(self, ctx, emoji: discord.Emoji = None):
Isn't ctx a version of str?
ctx means context
without cogs you dopy @client.command() async def emojiinfo(ctx, emoji:discord.Emoji=None):
but because you are using cogs, you need to pass self at the start
and because its cogs, you need to do @commands.command()
All my commands though are @client.command()
did you copy the emojiinfo command from elsewhere?
a small portion from stackoverflow
same file
thats why
dont use self if you're using a unique file
@client.command(aliases=['ei','emoji'])
async def emojiinfo(ctx, emoji: discord.Emoji = None):
if not emoji:
return await ctx.invoke(client.get_command('help'), entity='emojiinfo')```
so remove self, gotcha
give attention to what bun sent
well that just messes up all things that contain self
and how he replaced self.bot by client
- you don't need self as you're not using cogs
- its client not bot
you're using client it seems
you don't need self
Ok
you've copied code from someone using cogs
Ah
btw, take a look on that if you're planning to expand your bot's commands
I have one last question.
Is it normal for people to get snippets from Stackoverflow if they dont know how to do something
Or is it just me?
completely normal
i do that too
Alright
i like to take a look to know how other people solved the same issue
same
Thanks though, now I know something I didn't. You just helped me with two commands I made that don't work.

Because I looked at my other commands that have some things with self.
And put that self in those commands i made.
no problem, we all learn things every day
They don't work. So now I can go back and fix them.
generally, you only really use self in cogs or anything that involves classes
yep
Okay..again thank you!
glad to help :)
Hey Tito
I need some more help with my command.
members = list(privateduos[matchid])
user = discord.User(id=int(members[0]))
is_managed = 'Yes' if emoji.managed else 'No'
is_animated = 'Yes' if emoji.animated else 'No'
creaton_time = emoji.created_at.strftime('%I:% %p %B %d, %Y')
wait
i'm here
yeah
error;
members = list(privateduos[matchid])
^
TabError: inconsistent use of tabs and spaces in indentation
i see the issue
The indents.
members = list(privateduos[matchid])
user = discord.User(id=int(members[0]))
is_managed = 'Yes' if emoji.managed else 'No'
is_animated = 'Yes' if emoji.animated else 'No'
creaton_time = emoji.created_at.strftime('%I:% %p %B %d, %Y')```
yeah
?
members = list(privateduos[matchid])
user = discord.User(id=int(members[0]))
is_managed = 'Yes' if emoji.managed else 'No'
is_animated = 'Yes' if emoji.animated else 'No'
creaton_time = emoji.created_at.strftime('%I:% %p %B %d, %Y')``` for example
still error for user = discord.User(id=int(members[0]))
ive tried that
wait the top one also has an error
and what do you know, its the same error
can you screenshoot the full code?
you've indented user
I will send it.
@client.command(aliases=['ei','emoji'])
async def emojiinfo(ctx, emoji: discord.Emoji = None):
if not emoji:
return await ctx.invoke(ctx.bot.get_command('help'), entity='emojiinfo')
try:
emoji= await emoji.guild.fetch_emoji(emoji.id)
except discord.NotFound:
return await ctx.send("I could not find this emoji.")
members = list(privateduos[matchid])
user = discord.User(id=int(members[0]))
is_managed = 'Yes' if emoji.managed else 'No'
is_animated = 'Yes' if emoji.animated else 'No'
creaton_time = emoji.created_at.strftime('%I:% %p %B %d, %Y')
description = f'''
**General;**
**- Name: {emoji.name}
**- ID:** {emoji.id}
**- URL:** [Link To Emoji]({emoji.url})
**- Author:** {emoji.user.username}
**- Time Created:** {creaton_time}
**- Usable By:** {can_use_emoji}
**Other;**
**- Animated:** {is_animated}
**- Managed:** {is_managed}
**- Guild Name** {emoji.guild.name}
'''
embed = discord.Embed(title=f'**Emoji information for:** {emoji.name}', description=description, color=discord.Color.from_rgb(61, 31, 103))
embed.set_thumbnail(url=emoji.url)
await ctx.send(embed=embed)
you have a return statement and below that, code that will not execute
i mean this
except discord.NotFound:
# This will execute
return await ctx.send("I could not find this emoji.")
# This no
members = list(privateduos[matchid])
user = discord.User(id=int(members[0]))
is_managed = 'Yes' if emoji.managed else 'No'
is_animated = 'Yes' if emoji.animated else 'No'
creaton_time = emoji.created_at.strftime('%I:% %p %B %d, %Y')
ok
@client.command(aliases=['ei','emoji'])
async def emojiinfo(ctx, emoji: discord.Emoji = None):
if not emoji:
return await ctx.invoke(ctx.bot.get_command('help'), entity='emojiinfo')
try:
emoji= await emoji.guild.fetch_emoji(emoji.id)
except discord.NotFound:
return await ctx.send("I could not find this emoji.")
members = list(privateduos[matchid])
user = discord.User(id=int(members[0]))
is_managed = 'Yes' if emoji.managed else 'No'
is_animated = 'Yes' if emoji.animated else 'No'
creaton_time = emoji.created_at.strftime('%I:% %p %B %d, %Y')
I revoked return
something like this
ok
Still that same error.
members = list(privateduos[matchid])
^
IndentationError: unindent does not match any outer indentation level
Ima try to remove return
I actually don't know
I got it from stack overflow.
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Because I forgot how to get user.
Because **- Author:** {emoji.user.username}
user needed to be defined
are you sure on that?
I will remove it.
when you use emoji.user, user makes reference to the user who created the emoji, so you don't need explicitly to define it
you can use emoji.user.name
or emoji.user.mention to mention it
let me see it
ok
lemme paste my old code
Command raised an exception: AttributeError: 'NoneType' object has no attribute 'mention'
That's the error.
Idk, what shall I put instead?
"The user that created the emoji. This can only be retrieved using Guild.fetch_emoji() and having the manage_emojis permission." from discord.py docs
dang
ok thank you again
still not understanding, still won't work
but i can hold it off
not the last word on this, but take it easy when you get stucked
maybe looking up on other things helps you
@undone otter could you send me your bot id
909654785156853800
are you requesting any gateway intents
itsprobably because youre using intents your not verified for
if you read the whole error message it says that
^^
You probably requested message intents and etc.
those take even longer
Ever Time i run node deploy-commands.js I get this error
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1031:15)
at Module._compile (node:internal/modules/cjs/loader:1065:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47```
How do I fix this?
its impossible to say without seeing the code
Ok
@solemn latch this is the code
const commands = [
new SlashCommandBuilder().setName('help').setDescription('Replies with All Commands')
new SlashCommandBuilder().setName('botdev').setDescription('Replies with The Bot dev')
new SlashCommandBuilder().setName('ping').setDescription('Replies with pong!'),
new SlashCommandBuilder().setName('server').setDescription('Replies with server info!'),
new SlashCommandBuilder().setName('user').setDescription('Replies with user info!'),
]
.map(command => command.toJSON());
const rest = new REST({ version: '9' }).setToken(token);
rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: commands })
.then(() => console.log('Successfully registered application commands.'))
.catch(console.error);
you appear to be missing some commas in your array
oh @solemn latch Where Do i put the commas?
in between each element
probably best to not copy paste things from the guide
yeah prob not
@solemn latch I got another error
I got SyntaxError: Unexpected token '.' at Object.compileFunction (node:vm:352:18) at wrapSafe (node:internal/modules/cjs/loader:1031:15) at Module._compile (node:internal/modules/cjs/loader:1065:27) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12) at node:internal/main/run_main_module:17:47
I dont see it in your code ngl
neither do i
How can i disabled that one
then you'll need to contact discord
oh youre probably asking for the third one
the presence
disable that
Ohhh
@solemn latch Found the issue I had a , before a . in the same line thats why
Tysm
@solemn latch And I got ```/home/runner/Nodejs-16/deploy-commands.js:4
new SlashCommandBuilder().setName('help').setDescription('Replies with All Commands'),
^
ReferenceError: SlashCommandBuilder is not defined
at Object.<anonymous> (/home/runner/Nodejs-16/deploy-commands.js:4:6)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47```
looks like you didnt require the function
its covered in the guide you copied from
ok
how shards work? (node.js)
DEFINE THE FUCK SLASHCOMMANDBYIKDER
like the basics of shards? or like how to do them
the basic
dude
see docs
discord allows one connection to have 2500 guilds.
sharding makes your bot have many connections so you can go past 2500 guilds.
it also allows multiple cpu threads to be used
thanks for the info, Woo
Wait @solemn latch Do I need to put const { SlashCommandBuilder } = require('@discordjs/builders'); in my index?
in the same file you got the error in
ok
deploy-commands.js
looks like you didnt require rest
im looking that up
@solemn latch
throw err;
^
Error: Cannot find module 'REST'
Require stack:
- /home/runner/Nodejs-16/deploy-commands.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at Object.<anonymous> (/home/runner/Nodejs-16/deploy-commands.js:3:18)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/home/runner/Nodejs-16/deploy-commands.js' ]
}```
const { REST } = require('REST');
const commands = [
new SlashCommandBuilder().setName('help').setDescription('Replies with All Commands'),
new SlashCommandBuilder().setName('botdev').setDescription('Replies with The Bot dev'),
new SlashCommandBuilder().setName('ping').setDescription('Replies with pong!'),
new SlashCommandBuilder().setName('server').setDescription('Replies with server info!'),
new SlashCommandBuilder().setName('user').setDescription('Replies with user info!'),
]
.map(command => command.toJSON());
const rest = new REST({ version: '9' }).setToken(token);
rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: commands })
.then(() => console.log('Successfully registered application commands.'))
.catch(console.error);```
discordjs has its own rest methods
@solemn latch sorry for pinging a lot
const rest = new REST({ version: '9' }).setToken(token);
^
ReferenceError: token is not defined
at Object.<anonymous> (/home/runner/Nodejs-16/deploy-commands.js:14:50)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47```
It might help to take some time to learn to read error messages, the past 4 errors have been the same error just in a different spot.
Ok
not trying to be sassy, but I dont want to say the same sentence over and over 😔 been a long day
Ok My last error Help ```Error: Cannot find module 'clientId'
Require stack:
- /home/runner/Nodejs-16/deploy-commands.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at Object.<anonymous> (/home/runner/Nodejs-16/deploy-commands.js:6:22)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/home/runner/Nodejs-16/deploy-commands.js' ]
}```
rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: commands })
^
ReferenceError: clientId is not defined
at Object.<anonymous> (/home/runner/Nodejs-16/deploy-commands.js:19:42)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47```

you fill those in yourself.
or define them
const abc = something;
const clientId = your_client_id;
so this channel is for any kind of development right?
function renderBackground(x, y) {
const backgroundX = MAP_SIZE / 2 - x + canvas.width / 2;
const backgroundY = MAP_SIZE / 2 - y + canvas.height / 2;
context.drawImage(
getAsset('bg.png'),
backgroundX,
backgroundY,
MAP_SIZE / 10,
backgroundX,
backgroundY,
MAP_SIZE / 2,
);
context.fillRect(0, 0, canvas.width, canvas.height);
}
``` I'm making a js 2d multiplayer game and i'm setting a custom background, but it doesn't appear
I used many methods but same
first, you're making a function that uses context but having context scoped as a global variable, is that intended?
huh?
const canvas = document.getElementById('game-canvas');
const context = canvas.getContext('2d');
that's how i defined it at the first of my code
I knew that was what you did
but did you know that you made a function that relied on it as a global variable?
you're calling the function, right?
yep
return the image
kinda
does it work if you fill it in the entire area?
wait isnt that fillRect clearing the image?
It's clearing it?
setting it to a solid color I guess
oh then i'll try removing it
i want to make a simple invite code generator that creates a string with a random adjective and random noun put together. is there a way to store an array of words in dynamodb and only get one value back from an array. should i just do this in memory?
I put it for a gradient color bg but now I wanted a custom one
nm i thought of a way
same
does it work if you just do
context.drawImage(asset, canvas.width, canvas.height)
are you filling the entire screens somewhere else after you draw the image?
also have you confirmed that the code actually can draw the image
i was in css but i removed it few hours ago, i'll check if i'm filling anywhere else
how do I check it?
I tried with other images and same issue
write some code to test it
ok
@crimson vapor ummm now works but bugs:
- It's not well drawed
- The background is too smal compared to map size
and when i put canvas.width and canvas.height, the bg dissapears
i want the image to move too ._. the spaceship's moving but the background is the same as started so it doesn't look like it's moving
how to edit channel permissions in discord js v13 ?
i always got this error
at Object.run (C:\Users\adity\Desktop\HighQ Handler\commands\Channel Manager\lock.js:20:25)
at module.exports (C:\Users\adity\Desktop\HighQ Handler\events\guild\messageCreate.js:116:19)
at Client.emit (node:events:394:28)
at MessageCreateAction.handle (C:\Users\adity\Desktop\HighQ Handler\node_modules\discord.js\src\client\actions\MessageCreate.js:25:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\adity\Desktop\HighQ```
Did you get the right intents on the declaration of your bot client?
Also it says at the top you’re trying to get message.channel.permissionOverwrites, check the actual place of the error and make sure you have the right syntax and the right function. If you don’t know which it is go check the docs for it because you might be using the wrong function as stated by the traceback
I checked the discord js documentation but I couldn't find anything for .permissionsOverwrites
So that might not be a thing, check that you don’t use it in your code and you should find an alternative, what is it you’re trying to do anyway with it?
Oh channel permissions
so
Umm yeah have a look at the documentation it gives a decent overview as to what’s available and is pretty self explanatory
so I don't think there is a solution
I’ll have a look real quick
I've tried the source on github but it really doesn't work xd
You did import it right?
Make sure you did because it might error out if it isn’t imported
I've done it if it hasn't been imported, usually the error is undefined
Aight, umm you could check the auto fill on vscode to see what’s available for the channel.x functions
And see if there’s something like channel.x.permissionX
I've tried it but it's a different function
Aight, we’ll Im outta ideas…
yeah , same
Maybe stack overflow is a good place to check as well
I frickin love stack overflow lol
I can't find the solution there either xd
Damn, maybe open a new one on stack overflow about it?
Wait
Is your discordjs fully up to date?
im using v13.1.0
yea i am using the latest version
Aight, yeah I’m now of no help, I don’t know, good luck tho, you’ll get there!
yeah bro thank u
I’ll have a look soon, funnily enough I’m in a car (backseat)
But I’m checking the docs and stuff
haha xd
And I’ll check vscode soon lol just in case
16 hours elapsed in vscode
Lol nice
Commitment
My bot got declined today too ‘cause it crashed, lol I’ll have to fix it soon too
lmao
Yeah 😎
now , i think i will go sleep
Aight mate, good luck and sleep well
yea thanks
help
you have to animate it based on user input or ship position
if you're on browser you can use requestAnimationFrame()
for example if you control your ship with the keyboard:
on key press -> update ship position -> requestAnimationFrame() -> update map position
https://srcb.in/mWct3C9TGC
see example for fname if i put a text like hi it will work
but if i put for fname if i put hi there it wont work
how I update map position?
I have requestAnimationFrame where I animate the ship
is there a way i could set a timeout to fill a form on vanilla js clientside
like lets say i filled the form then i gotta wait 15 hours
function renderMainMenu() {
const t = Date.now() / 7500;
const x = MAP_SIZE / 2 + 800 * Math.cos(t);
const y = MAP_SIZE / 2 + 800 * Math.sin(t);
renderBackground(x, y);
}
let renderInterval = requestAnimationFrame(renderMainMenu, 1000 / 60);
export function startRendering() {
clearInterval(renderInterval);
renderInterval = setInterval(render, 1000 / 60);
}
export function stopRendering() {
clearInterval(renderInterval);
renderInterval = setInterval(renderMainMenu, 1000 / 60);
}
```i used this one month ago (found on the saves file from replit)
doesn't work
the function you pass to RAF should call RAF again recursively
raf?
ok
let renderInterval = requestAnimationFrame(renderMainMenu, 1000 / 60);
export function startRendering() {
cancelAnimationFrame(renderInterval);
renderInterval = requestAnimationFrame(render, 1000 / 60);
}
export function stopRendering() {
cancelAnimationFrame(renderInterval);
renderInterval = requestAnimationFrame(renderMainMenu, 1000 / 60);
}
it black screens
should I cancel animation frame?
Hi! I just had a question, I'm trying to handle DM with my bot, but when I send him a message the messageCreate event is not triggered. I tried adding partials, and I have the intent enabled. But I've noticed that when the bot sends me a message first, and the DM channel is cached the bot recieves the message. I know it is possible, as some bots offer the ability of having a support chat system in dm.
If any idea, please let me know and ping me ^^
what in the actual fuck...
I've tryied switching the embeds
every single time
it would reply with the nope embed
no matter if there was an error or not
no matter if I've switched the yep and nope embeds
every time it'd reply with the nope
any ideas on whats wrong?
(ping in messages)
hey
textarea.addEventListener('keydown', e => {
if (e.enterKey) {
sendMessage(e.target.value)
}
});
can anyone tell me what's wrong here?
@earnest phoenix what was u saying about replit?

why don't you log the error lol
anyone?
mine?
ok
How can I print data from mongodb to labels one by one in c#?
What’s your need? They got some pretty decent api docs https://stripe.com/docs/api
Personally I would recommend using their ready made checkout page, that way you don’t need to deal with PCI, 3DS and you get better Radar insight due to their fingerprinting https://stripe.com/docs/payments/checkout
Elements are also pretty good if you want something more custom https://stripe.com/docs/payments/elements
I'm working on a project which requires payment screens. It would send the user to either stripe or paypal (based on the page owners choice)
paypal i'm gonna use paypal.me
i've just gotta work out a way to verify if a paypal.me link works
Personally I would just use their checkout page then. On payment complete you just get a webhook back https://stripe.com/docs/payments/checkout/fulfill-orders
Nope
I’d look into possible crypto payment processors later on tho
Depends if people use this service
Coinbase commerce and coingate seem good
Alr thanks
Isn’t PayPal also experimenting with Crypto?
would it be possible to use a different api key for each transaction?
the service would be a landing page system with the landing page owner supplying the paypal email and/or stripe payment location
Why would you need to do that? I think they only allow you to regularly rotate the key
Because I wouldn't actually be handling the transactions
Yes but coinbase and other stuff are specifically targeted at crypto so they might be better
And, is it possible to generate a PayPal payment link from the payment recievers email?
or does it require api keys
Oh. So you are more of a marketplace? That I would not have any idea how to do. I think that’s more of a stipe connect thing https://stripe.com/en-gb/connect
Kind of
Its a developer donation page system
So for example I would own donatey.me/ben and that would give options for entering payment amount and ways of paying
Ah then you should definitely be using stipe connect. (https://stripe.com/docs/connect/standard-accounts)
That enables you as a platform to allow your users to create their own stripe account and give you access to it.
That also makes it so you are not liable for chargebacks and providing tax forms etc
One of the main risks of you taking stipe transactions then later redirect payments to the person is that if the “buyer” charged back the transaction, you are the one liable
Have a look here for liability documentation https://support.stripe.com/questions/dispute-responsibility-for-connect-platforms-and-connected-accounts
yep thats why i don't want to handle the transactions
Thats why I would get the user to set their Stripe details/Login to stripe from the dashboard
So the money doesn't go into my stripe account, only the page owners
Yeah, I guess you could ask them for their API key/login details, but I think that would be risky.
If stripe sees a lot of logins from your device they would probably block login attempts. Also if you ask for APIKeys it could break if the user rotates their key
So I think Stripe connect would be the best. Would require some time to setup, but their docs should be straight forward (https://stripe.com/docs/connect)
Well
What alternatives are there for card transactions?
Paypal seems simple (Paypal.me, might try find doc information on getting payment url from email)
then you definitely need crypto cuz i use it
yeah
its more the best way of doing it
because it will need the developer to link their account
but every single payment provider has identity restrictions
yeah
I can just put my btc address on my devpage tho
There was no error...
probs because you didn't log it
True
bump 
Stripe is good and all but won't work in this case
Unless i figured out Stripe Connect
what's a good merchant rate now?
im getting into using prettier and i have looked through the options page of their website, but cant seem to find an override for formatting if statements
For example,
if(statementA || statementB) return;
gets turned into
if (
statementA ||
statementB
)
return;
my current prettierrc file is this:
trailingComma: 'es5'
tabWidth: 4
semi: true
singleQuote: true
useTabs: true
bracketSameLine: true
Hey! I have made an economy bot, and I want to improve my current /work command. Currently the /work command doesn't let you do anything except for paying you for a random amount of work-hours. I want it to be something like this with random questions and tasks:
Q: What letter is missing? You_ube
A: T
If the person's next message is T, it should respond with a message and give the money.
What is the best way of doing this?
If you have the message intent, you could listen for the next message from the user and see if it's correct
In Discord.js, for example, you'd use collectors
For slash commands, there's none of that waiting stuff
You could make a subcommand for that, like /work answer ... ..., but it would probably be much harder.
Hello everyone, I am just about to fill out my verification for my bot and have asked myself the question, when or for what one needs the Message Content Intent?
If your bot "has unique functionality that cannot be replicated or otherwise implemented with interactions", according to Discord.
Hey guys, am using c#, can someone help me figure out what's making my bot use about 1-2gb per shard?
message content is needed for literally everything that uses messagages and commands with prefixes for examplr
you dont need it if all your commands are slash commands
ahhh okey ty! so ye i need it then 🧐
Anyone 
I think last I checked Miki uses 6gb on 350k servers 
is there a prettier alternative to the "curly" rule in eslint? in addition to my question here #development message
probably
but look into caching, what d.net ia storing for you, if there are ways to customize it, etc
ESLint has a lot of options for curly braces (https://eslint.org/docs/rules/curly), but you said you were using prettier
^
Should ask @green kestrel how much memory trivia uses per guilds
result.user.edge_followed_by.count
4gb on 126k servers, but it's not linear, it could double and only go up 256mb
there's significant overhead for the db layer to speed it all up
i mean that like is there a version of that in prettier
Can I delete a collected message?
message.channel
.send("Please send your IGN.", { fetchReply: true })
.then(() => {
message.delete();
message.channel
.awaitMessages({ filter, max: 1, errors: ["time"] })
.then((collected) => {
collected.delete(); // ?
...
Could you try:
const Discord = require("discord.js");
const ig = require("instagram-scraping");
module.exports = {
name: "insta",
description: "name command",
execute(message, args) {
const userArg = args.slice(0).join(" ");
ig.scrapeUserPage(String(userArg))
.then(({ user }) => {
const embed = new Discord.MessageEmbed();
const name1 = user.full_name;
const image1 = user.profile_pic_url;
const followcount = user.edge_followed_by.count;
const followingcount = user.edge_follow;
embed
.setTitle(`${name1}'s info` || "undefined")
.setThumbnail(image1 || " ")
.addField(followcount + "." || "none")
.addField(followingcount + "." || "none");
message.channel.send(embed);
})
.catch((error) => {
console.log(error);
});
},
};
Not able to test code atm, but you where not calling .setTitle on the embed. If it errors, please send the error message
collected.delete() doesnt work. mb i shouldve specified that
Yeah that is the error the instagram-scraping lib gives
google?
So it is not the embedded or the code I provided above erroring
instagram must tell you the different problems and solutions of scraping errror
the api must have a documentation right
I am getting the same error. Probably Instagram blocking the scraping calls
Contact the owner of the library, not your code
Quick question, how do i get the selected choice from a .addChoice()? (Slashcommands)
is it possible to add AI to javascript/html games?
or at least moving obstacles that follows you/random user
It's possible to do anything in any language that's turing complete
ok
Using discord.py and I'm making a command to test buttons. However its returning an error that says the command doesn't exist.
import os
import discord
from discord.ext import commands, tasks
from discord_components import Button, Select, SelectOption, ComponentsBot
import datetime
from keep_alive import keep_alive
bot = ComponentsBot("!")
intents = discord.Intents.default()
intents.members = True
activity = discord.Activity(type=discord.ActivityType.watching, name="for March 12th")
client = commands.Bot(command_prefix="-", intents=intents, activity=activity)
token = os.environ['token']
client.remove_command("help")
@client.event
async def on_ready():
print("Hello World!")
print(f"Logged in as {client.user}")
@client.command
async def button(ctx):
await ctx.send("Buttons!", components=[Button(label="Button", custom_id="button1")])
interaction = await bot.wait_for(
"button_click", check=lambda inter: inter.custom_id == "button1"
)
await interaction.send(content="Button Clicked")
keep_alive()
client.run(token)
error
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "button" is not found
can anyone help me to do a moving obstacle that follows the player until it hits him or the player hits the obstacle with the bullets
if i enable the "guilds" intent, does that include every intent under the guilds section or do i need to enable every single one
like get every category main from this list
(guilds, guild_members, guild_bans, etc)
i remember they removed the "all" option from working right
like between two times or different timezones?
between two different times
timestamp - timestamp
when is discord giving us forms
atm i store using Date().getTime(); and get the current time and compare
but when it gets to 60 as the difference it resets to 0
savedtime-currenttime
it cant possibly reset to 0
its literally two numbers in a subtraction
soon™️
const diff = check.when - now
console.log(diff)```
it returns 60 and when i refresh page again it returns 0
1640131092228
it stores like that
are you storing again on page refresh?
nope
it just outputs current difference
it only stores the current time when i click submit
which is on an entirely different page and the time in the db is still the same
thats literally not possible dafuq
time is a bitch
True
how would i get the second user mentioned?
what library
that doesn't really matter iirc because mentions aren't ordered the same way as they are appear in the message
in pretty sure you need to parse the message content
!command <@id> <@id> and grab the second one
I assume you aren't using slash commands
some libraries will go out of their way to parse and grab the mentions for you
and some will order it by how they appear in the message
I think Discord.js orders it for example
Order as received from the API, not as they appear in the message content
ah so it doesn't
Nope
let number = db.fetch(`numwarns_${message.guild.id}_${user1}`)
let warnid1 = uuidv4()
let warnid = db.fetch(`warnid_${message.guild.id}_${number}`)
let reason = db.fetch(`warnreason_${message.guild.id}_${warnid1}`)
db.add(`numwarns_${message.guild.id}_${user1}`, 1)
db.set(`warnid_${message.guild.id}_${number}`, warnid1)
db.set(`warnreason_${message.guild.id}_${warnid}`, reason)```
Am I doing this wrong?
Nvm
How do I get the number of text channels a server has with discord.py? discord.guilds.text_channels returns a list
len(discord.guilds.text_channels)
ty
yeah ik
Also embed.set_thumbnail isn't working. Should I covert it to a string?
embed.set_thumbnail(ctx.Guild.icon_url)
error:
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: set_thumbnail() takes 1 positional argument but 2 were given
url=
Then the ctx.whatever
This isn’t ur error but guild should be lowercase
embed.set_thumbnail(url = ctx.guild.icon_url)
yeah i already fixed it. Ty tho
ah alright and ofc nw :)
So, I was improving my /info command, and I ended up writing a handy little module to convert md files info discord embed using this md file formatting:
# TITLE #
Some title
# COLOR #
RANDOM
# AUTHOR #
user.name, user.avatar, https://discord.com/
# THUMBNAIL #
bot.avatar
# DESCRIPTION #
Some description...
# FOOTER #
user.name, user.avatar
# FIELD #
label, string, true
# FIELDS #
label, string, true
label, string, true
label, string, true
# TIMESTAMP #
false```
The embed data is made dynamic using a simple object given when creating/sending the embed, like this:
```js
const md_data = EmbedMD.prepareMD('/directory/path.md');
const embed = EmbedMD.getEmbed(md_data, {
'bot.name': interaction.client.user.username,
'bot.avatar': interaction.client.user.displayAvatarURL(),
'user.name': interaction.user.username,
'user.avatar': interaction.user.displayAvatarURL(),
});
Anyway, wondering if i should release it as an actual module package? seems the kinda thing others might get a use from too (it requires/uses discord.js)
huh
I mean
go for it
looks pretty good
thanks. yea, it works fairly well. I have it reading an entire directory of md files, and then using the filenames as the choices for a command option. so i can do commands like /info about:somefilename and it automatically reads the file and parses it and junk
helps keep that command super neat at least 😄
I dangg
dangg*
yea i would like to test it out when i can aswell
so def would be fun and a cool project
lol no worries, ill probably tidy it up and upload it in a little bit then, get some feedback on it 😄
yea, i got that... and i was like... when did i verify my bot???
still cant figure out which bot was verified, or if it was 😄
na mine is verified lmao
dont you get a verified bot dev badge thing?
awww, was that only the early verified people?
cause iw as totally meant to do mine back then
lmao
fml in the ear
Is this not possible?
settings.settings = settings.settings.filter(x => x !== ({ id: setting }));
I'm trying to remove an object from an array that has an ID of setting which is a value like 0..
x.id !== setting?
.. and keep the rest.
Or JSON.stringify(x) !== JSON.stringify({ id: setting })
I can remove this object?
.. with this code??
Ah
Yeah. 
I tried doing it with this.. but doesn't seem to work.
.. unless it's not actually removing. I'll check with console.log(settings.settings);.
Nope, it's not removing. [{"id":"newfollower"}]
.filter(x => x...).
What do you mean?
Try this, assuming the object only has one property and it's id
It's only one property, correct.
JSON.stringify() turns the object to a string. so you can compare it with another serialized/stringified object
Although, there could be multiple objects in the array?
Although, is it not possible with this?
OH, so x.id !== setting.
Yeah, that would be better
Sweet, it works. 👍
By the way, can this be simplified, more?
if (!hasToast) {
inventory.inventory['toast'] = 1;
} else {
inventory.inventory['toast']++;
};
inventory.inventory['toast'] = ihastoast ? ++inventory.inventory['toast'] : 1;
I have this code, and as you can see at if (!settings) return;, can I break out of the entirety of the Settings.findOne code and continue with the authorSocial.following = ... if no settings were found? Should I do this using promises?
Use await instead of callbacks or move all the code outside that callback inside the callback
Part of my learning process, could you tell me what you refer when you mention callback?
The function you provide to run after the library fetches data from the database
async (error, settings) => {}
Sweet, now when you stated await instead of callbacks, it means?
const data = await Settings.findOne({ userID: user.id });
if (!data) return;
authorSocial.following = ...;
...```
Oh, that's the other way of doing it instead of this, correct.
Well, alright. 👍
damn bro 1 month free nitro omg
i hope its not a scam link
@solemn latch
@sly sierra Finally finished that module to convert md files into discord js embeds
feel free to critique, its my first actual published module 😄
no rush 🙂
hy
Hello
ew ts
dangit, im gonna have to write a ts version arent i
literally package been published for less than 5 minutes
lol
yea, but i dont generally bother with ts
eh, i could just add some comments for intellesense too
yea, i guess i can understand that
~ just updated the package with jsdoc comments, so it should give intellisense now 🙂
not quite ts, but im sure it will do 😄
How do I force user input to be sentence case in Python?
niceeee
eh, idk, im getting a random error now but i gotta run out lol, just @me if you get any issues, ill reply when i get home 🙂
add a .d.ts file and put the typeacript declarations there
thats pretty much all you need
you dont need to actually write ts code
hi
does anyone know what the http endpoint to getting a member's banner on a particular server is
nah thats not what im referring to
that is my global banner
hm
wait nvm in that case i could just inspect element and find out i guess
not exposed yet
oh oof
wait so would this work?
req = await self.bot.http.request(discord.http.Route("GET", "/guilds/{gid}/members/{uid}", uid=user.id, gid=ctx.guild.id))
banner_id = req["banner"]
i mean under the endpoint you mentioned
they don't provide that
or does it not work for bots yet
I rolled out recently
Any arabic here !
.
#general-int for any language general talk



