#development
1 messages · Page 165 of 1
boss, how, i am really very new to sever'
i just told you above
go to the discord developer dashboard
go to your custom bot
generate a link for BOT
with the permissions you want to give it
There is two main reasons for this short mini series creation. First reason is so we dont have to cover this again in any future bot tutorial series, then the second reason is for referencing to help people that may not know these steps aswell as the ability to post this within our help channels in our discord when needed.
Thanks to oxide host...
This video shows you how specifically
hello bot
am good
Error: CONSTRAINT `logs.log` failed for `s1_DEVELOPMENT`.`logs`
at PromisePool.execute (C:\Users\yarne\OneDrive\Bureaublad\Current Projects\Topaz\node_modules\mysql2\promise.js:373:22)
at KeyvMysql.<anonymous> (C:\Users\yarne\OneDrive\Bureaublad\Current Projects\Topaz\node_modules\@keyv\mysql\src\index.ts:61:29)
at Generator.next (<anonymous>)
at C:\Users\yarne\OneDrive\Bureaublad\Current Projects\Topaz\node_modules\@keyv\mysql\dist\index.js:8:71
at new Promise (<anonymous>)
at __awaiter (C:\Users\yarne\OneDrive\Bureaublad\Current Projects\Topaz\node_modules\@keyv\mysql\dist\index.js:4:12)
at C:\Users\yarne\OneDrive\Bureaublad\Current Projects\Topaz\node_modules\@keyv\mysql\src\index.ts:60:33
at KeyvMysql.<anonymous> (C:\Users\yarne\OneDrive\Bureaublad\Current Projects\Topaz\node_modules\@keyv\mysql\src\index.ts:79:11)
at Generator.next (<anonymous>)
at fulfilled (C:\Users\yarne\OneDrive\Bureaublad\Current Projects\Topaz\node_modules\@keyv\mysql\dist\index.js:5:58) {
code: 'ER_INNODB_AUTOEXTEND_SIZE_OUT_OF_RANGE',
errno: 4025,
sql: `INSERT INTO logs (userid, log) VALUES ('259776081316282368', 'really long json object'`,
sqlState: '23000',
sqlMessage: 'CONSTRAINT `logs.log` failed for `s1_DEVELOPMENT`.`logs`'
}
anyone knows how to solve this?
make log bigger
how
actually, good question, it wasn't supposed to error
it's 1749 characters long
yeah
but I don't understand any of the links I click haha
but isn't JSON just a fancy version of longtext?
and isn't longtext able to hold 65000 characters?
Also the constraint is just the json_valid function
but when I use SELECT json_valid(the object) it returns 1
which means it's valid right?
so why does it still not meet the constraint?
pffff, I wouldn't have a clue how to solve this
heyyy guys
currently getting fucked in haskell.
I think that i need some extra info about a certain assignment i have to do
I need to create a shifter
that shifts a char x amount of times to the right
but honestly, i am a bit stuck. How do i wrap the elements around if they exceed 'Z', being 90? I used modulo... but sometimes it still leaves me with too low ascii chars
music bot for Discord. Supports Spotify, Deezer, Anghami, Soundcloud, Bandcamp, mp3, mp4, Vimeo etc.!
is this okay with discord bot
You wont be supporting Spotify I'll tell you that. But the rest in discords eyes is fine.
What Miyuka is trying to say is that you likely won't get verified if you support Spotify as a streaming provider because it violates Spotify's Terms of Service
Not correct.
Spotify is literally not a possible streaming service since it doesn't have a public API. Any library that claims to do so is using the meta data from spotify and looking it up on YouTube basically making the bot a YouTube bot.
gif me text for music bot
Write it your self.
please
Nope.
can you help me
It's still possible but harder to play off spotify directly
Without using their public api
The only public data is what? 5 seconds? Something really tiny.
And Spotify wont give someone access to the pivate api for discord purposes.
That's not what I'm trying to say
how i can verfay music bot ??
You can still use their client api, that's how you play songs from the spotify client on your phone or pc
Which is undocumented and unsupported, but it's still possible
by verifying it
there’s no secret formula
that’s not a secret formula
Yeah true
I've seen people bypassing Spotify's widevine, so it's definitely possible (albeit illegal)
Oh word? How does one even do that? Wouldn't be something someone trying to make a public bot should do
flaze can you help me
One message removed from a suspended account.
One message removed from a suspended account.
السلام عليكم .. احتاج مساعدة بخصوص توثيق البوت في حال احد يعرف يتكلم عربي ويعرف كيف يفعل ميزة Presence Intent ووش الإجرائات المطلوبه يتواصل معاي
Everything in my bot works , but it doesnt have a role of it's own by default but why?
if i remember correctly, bots get a role if they have their permissions defined on the invite link
If their invite has any permission overrides that get allowed, then it gets a role
can I make these </command:123456789> links and have them prefilled with some arguments?
nope
discord ditched that part of the feature
e
Hi guys anyone has already use TRPC?
what about it
for people trying to get their bots verified in #mod-logs , please make sure your bot is only and active, you can do this through the use of a paid VPS or Hosting it on your local device.
Yes way, also why do you look familiar
Weird bc my brother had his bot verified before he got banned and it was local hosted 😂
As long as it's online at all it can be verified
Exactly
Still better than hosting discord bot on phone

hosting locally doesnt imply hosting on a pc
In 99% of cases it just means that someone runs the bot on their computer and prays that it is checked by top.gg reviewers
a lot of people host their bots on an old android phone using termux
if you're not getting in sharding territory i'd say it works well, but never tried it myself
These must be very small or very simple bots
Running a discord bot isnt that cpu/ram intensive
It depends on what kind of bot you want to run, you probably won't run a music bot on your phone this way
Although maybe by some miracle
is it possible to have vs code always open my sh file (custom shell commands) whenever i open new shell
You could create a custom startup script
@earnest phoenix does node use skip-lists for strings?
its an interesting data structure
how
Nope
We use ropes
How do people invent data structures like that
I’m too dumb to even understand them 💀
because of people wanting to optimize the fuck out of everything
Yeah but still how do you come up with ideas like ropes
a rope can be implemented with linked lists
and a skip list is apparently really good at it
check this out https://crates.io/crates/jumprope
a bit
huge brain me is trying to connect 2 subnets within a docker container together
pain
good
Well yes but there are major downsides to using a skip list
- It requires more memory than a balanced tree, this is due to the additional memory required to store additional nodes in all layers
- Reverse searching is disallowed, this is because skip lists are fully undirectional
- The skip list searches the nodes much slower than a linked list, this is because they can't leverage the locality of reference
yeah i guess nothing beats the flexibility of b-trees
things are rarely purpose-specific these days, everything is multipurpose in high-level langs
Just like 98% of all Discord bots 
Does somebody know why this isnt working, I'm trying to make an invite tracker but it gives an error which says: member.guild.fetchInvites isn't a function
what version of djs?
yep
but i dont know how i can make it the v14 way
on v14 its guild.invites.fetch()
okay
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
What tutorial are you following?
Hey there please hit that red juicy subscribe buttoooonnnnn
it really helps me out :))).
anyways here are da links
discord: https://reconlx.js.org/#/discord
Source: https://github.com/reconlx/discord.js-tutorials/blob/%2332-Invite-Tracker-System
github: https://github.com/reconlx
Love YALLLLLL 👋
tbh
youtube tutorials should use raw api
it would be more guaranteed to work in the future
but then again
I'd highly recommend that you not follow YouTube tutorials like that, 99% of the time they're outdated
console says it cannot read properties of undefined reading 'guild'
so i tried changing this to bot.on("guildMemberAdd", async (guild, member) => {
but that didnt work either
you mean the pic is correct
from the pics you sent, the second one is correct
i only sent one pic
ah yes, the first one is text
one is a codeblock the other one with the colours is a pic
The tutorial you're following is very outdated, you'll run into many issues like that
so the pic is correct
oh okaybut how do i fix that error then
show the error
Either find a more up-to-date tutorial, or write the thing yourself by following the implementation details of the tutorial
yea
Change async member => to async (...args) => and run console.log(...args); in the event listener callback
See what gets logged
are you using some kind of framework or modified client?
do i have something to do with the . . . or keep that how it is
Keep it as-is
GuildMember {
guild: <ref *1> Guild {
id: '1016802330814988328',
name: 'Mic',
icon: null,
features: [ 'AUTO_MODERATION' ],
commands: GuildApplicationCommandManager {
permissions: [ApplicationCommandPermissionsManager],
guild: [Circular *1]
},
members: GuildMemberManager { guild: [Circular *1] },
channels: GuildChannelManager { guild: [Circular *1] },
bans: GuildBanManager { guild: [Circular *1] },
roles: RoleManager { guild: [Circular *1] },
presences: PresenceManager {},
voiceStates: VoiceStateManager { guild: [Circular *1] },
stageInstances: StageInstanceManager { guild: [Circular *1] },
invites: GuildInviteManager { guild: [Circular *1] },
scheduledEvents: GuildScheduledEventManager { guild: [Circular *1] },
autoModerationRules: AutoModerationRuleManager { guild: [Circular *1] },
available: true,
shardId: 0,
splash: null,
banner: null,
description: null,
verificationLevel: 0,
vanityURLCode: null,
nsfwLevel: 0,
premiumSubscriptionCount: 0,
discoverySplash: null,
memberCount: 11,
large: false,
premiumProgressBarEnabled: false,
applicationId: null,
afkTimeout: 300,
afkChannelId: null,
systemChannelId: null,
premiumTier: 0,
widgetEnabled: null,
widgetChannelId: null,
explicitContentFilter: 0,
mfaLevel: 0,
joinedTimestamp: 1680900006376,
defaultMessageNotifications: 0,
systemChannelFlags: SystemChannelFlagsBitField { bitfield: 0 },
maximumMembers: 500000,
maximumPresences: null,
maxVideoChannelUsers: 25,
approximateMemberCount: null,
approximatePresenceCount: null,
vanityURLUses: null,
rulesChannelId: null,
publicUpdatesChannelId: null,
preferredLocale: 'en-US',
ownerId: '817282394763558943',
emojis: GuildEmojiManager { guild: [Circular *1] },
stickers: GuildStickerManager { guild: [Circular *1] }
},
joinedTimestamp: 1694953779112,
premiumSinceTimestamp: null,
nickname: null,
pending: false,
communicationDisabledUntilTimestamp: null,
_roles: [ '1152944456228687904' ],
user: User {
id: '557628352828014614',
bot: true,
system: false,
flags: UserFlagsBitField { bitfield: 65536 },
username: 'Ticket Tool',
discriminator: '4843',
avatar: 'ba5ef012585bb2f9c72a655b28d7aa5f',
banner: undefined,
accentColor: undefined
},
avatar: null,
flags: GuildMemberFlagsBitField { bitfield: 1 }
}
@earnest phoenix
Is that the only thing that gets logged, no undefined or anything?
Can you show an screenshot of the console?
I'm trying to see what arguments are being passed to the event listener callback in your code, because clearly the member argument is undefined according to the error for you
So it would be better for you to take screenshots of the first part of where those things got logged to the console
Hello,
I currently am in a team of discord bot developers and I'm trying to make some tests with the top-gg API and webhook features. The problem is that the bot we are building is online and already uses top-gg webhooks. So I'm searching how I could register a development bot application quickly and easily on top-gg that would not be visible by regular, or at least not searchable on the website. Is it possible to do that ?
That is weird, what gets logged when you change it back to async member => and run console.log(member);?
(should I ask this in the #support channel instead of here ?)
exact same
Then that code should work, what about console.log(member.guild.id);?
albumLengths: AlbumnLength[] = {
"a1": 12
}
What is the typescript type for this?
What do you mean?
That is so unspecific
You’ve annotated it as AlbumnLength[] but it is not an array and I have a feeling that type doesn’t exist given that it’s misspelled
albumLengths: Record<string, number> = {
"a1": 12
}
``` if you want to be able to add/remove random albums without knowing the exact names
you can shorten this to Record<string, number> like tim said
bun is nice but for some reason hallucinating
question regarding DNS (and possibly wireguard)
Is there a way for me to prioritize a certain DNS Server? Let's say I run a wireguard VPN on my computer, and on the vpn network, a DNS server for intranet-like domains. Though that dns on that VPN server seems so slow ngl
I want to access the localStorage in my layout.tsx, how can I do that? I'm using nextjs 13 and reactjs..
You'd have to use it in a useEffect
there's supposed to be a version number after that _
even when selecting a number it gives me the same error
THIS IS THE ISSUE
oops srry for caps
i am following their official thingy
try looking in this file
permissions denied
sudo
sudo isn't found either?
command not found
when i use sudo /etc/apt/sources.list.d/nodesource.list
you wanna see the contents/use an editor
use nano for instance sudo nano /etc/apt/sources.list.d/nodesource.list
make sure it says node_18.x or your version and save
Hey guys - applying for for verification, our admin commands are prefix commands, but we're not being accepted for message intents, so we need to convert our admin commands to app commands.
Can you hide app commands from everybody but (staff or whatever)?
obviously we don't want people even seeing admin commands when they do /
yes, you can restrict commands by user permission
Basically
if(interaction.member.permissions.has('ManageChannels') //do the admin command
//or
if(interaction.user.id === 'idHere') //if locked to a specific user
is a good way of handling it.
I don't think there's a really good way of hiding the commands itself from the public eye but they wont run.
Is there a reason you're using NodeSource instead of nvm?
if you set dm_permission to false (to prevent the command from being run in DMs) and default_member_permissions to any valid permission for your mods, normal members wouldn't be able to see them
Oh so there is a way just hiding the command. Good to know about that.
Yeah, we want to hide the command entirely.
Nothing worse then a user doing / and being face punched with 15 admin commands
I technically do have that setup on my bot, but since its a single server bot, I dont really need to hide it, but what Flaze is saying is change this depending on how you have your command structure setup.
name: "giveaway",
category: "Admin",
description: "Start a new giveaway",
usage: [`/giveaway`],
example: [`/giveaway`],
type: 1,
options: [
{
name: 'channel',
description: 'The channel you want the giveaway posted in.',
type: 7,
required: true
},
],
permissions: {
DEFAULT_MEMBER_PERMISSIONS: "SendMessages" //here
},
You can also deploy them only on one server
Well you can just hide application commands on the intergrations panel if it'a single server bot
To be 100% sure that they will only be on one server
Oooh okay, this sounds like what we need, as we can just setup an admin server.
Any chance u can send some docs?
I can send you discordjs.guide about this
not so helpful as we use .py 😄
https://discord.com/developers/docs/interactions/application-commands#making-a-guild-command if you want discord docs
you can find appropriate methods in your lib
Oh, so it's gonna be harder i think
Ah then my code above is not what u needed anyways since its also js 🤣
So you are using discord.py or some other framework
yeah discord.py, but dw we'll sort it. for the time being we will just turn off the intents, and manage without admin commands.
It's mainly stuff like mass editing database etc
we've been sat @ 100 servers for 4 weeks because discord are morons, so we'll turn off intents for now and worry about admin commands later
Now that's a different error
The error is quite clear about what's wrong
You should learn that and also check the discord.js documentation about what properties there are, how to use certain methods and whatnot
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
it redirected me to nodesource
apparently their normal setup packages are deprecated and they moved all their installers to the nodesource for ubuntu and linux based distri's
Nope, not at all
nvm is standalone, it uses Node.js' own download registry
Uninstall your current Node.js installations, follow nvm's installation guide, and run nvm install --lts to install the latest LTS release (or nvm install to install the latest non-LTS release, you can also install a specific version with nvm install <version>)
so what should i do now
The predicate you're providing to the gInvites.find() (Collection.prototype.find()) method ((inv) => invites.get(inv.code).uses < inv.uses)) evaluates to false so it returns undefined, meaning that none of the values in the collection passed the conditions you provided
Either check if your conditions are correct, and fix them if they're not, or handle the case if only undefined is returned
In code how do I get out of this >>> cuz if I use \n it just keeps the indentation
in what REPL
node?
either Ctrl + C, Ctrl + D, exit, exit(), quit, q will work (idk what REPL you are using)
no
I meant discord
haha
if you do
it creates this block
and for every new line it makes the block longer
but I wanna escape it
in my embed
\>
did not work
\n\>\n\n*Press the button below to reroll the reforge.*
Once you do >>> you can't escape it. You should use > on each line you want the quote to be on
mmmh, unlucky
I think they're trying to end the blockquote, but that's not possible. I assume they dont want the "Press the button..." message to be in the quote
I love making my own dependencies to prevent hard coding
@clear plinth the hidden message thats likely a spammer ^
sup, I'm having an issue where one of my new applications(bot) isn't getting slash support
I have invited it with both of the scopes, bot, application.commands
and have a slash command in the project
I also made a global slash command
but still didnt get it.
enabled in-app authorization too, to see if that makes any changes
but nope
tried djsv13 and 14 both
Hello, I am looking to make a library of clips and text explanations for a game, any suggestions on how to structure it? I am thinking of having a "backend" discord server that i can pull info out of to main server and people can react to an embed which contains menu of things they can look up. thoughts?
also are any of you using gpt4? i made a bunch of stuff with it
Hey missed that, what is it
@rustic nova I need help
It's applications.commands
Plus show code
I'm not sure if I understand your question, what do you mean by a library of clips and text explanations? A selection of them or a library that makes them?
And the second part, are you trying to pull those from a different server to the main server based on what people react to?
Better to rephrase your question
Well ask your question and wait for someone who can help
How can we show our server in top?
By vote?
forgot the s ig but still doesn't work
You're not registering the slash-commands in any way
In the Events.Ready event, call <Client>.application.commands.set() by passing your slash-commands' data from your custom <Client>.commands collection
(This can also be done outside the ready event)
oh
wait I'll try
still no slash support
reinvited the bot too
?
You're supposed to register the commands once when your bot starts up, but in that screenshot (the one before the latest) it would register them every time an interaction is received
Plus you have to pass your slash-commands' data to the <Client>.application.commands.set() method
That's also a correct way of doing it, though unnecessarily more complicated and abstracted than just using <Client>.application.commands.set()
Also keep in mind that it's only for one guild
<Client>.guilds.cache.get(<ID>).commands.set(<commands>)
If you only want the slash command(s) to be registered in one specific guild then use #development message
and this for all guilds?
Yes
like what I did here
Correct
I see
still not getting slash supprt 😦
55
What is the value of the data variable?
Then you're passing an empty array
It's "loading" to a collection, not registering them
Show the whole code, not small parts of it
too big for 1 pic tho
You can send it as plain text or file on discord
You're supposed to pass the slash command data to the method from your <Client>.commands collection
You can simply map your slash command collection to an array of slash command data using the <Collection>.map() method
After loading all your slash commands to the collection
eeh?
cant I just data.push()?
Sigh, <Client>.commands is a collection that you assigned, you're loading your slash commands to it, after that map the slash commands to their data using <Collection>.map() and pass it to the <Client>.application.commamds.set() method
<Client>.commands.map((command) => command.data)
Pass that to the <Client>.application.commands.set() method
for me 💀
lemme check if it worked
@earnest phoenix

man it wasnt such an issue in djsv13
It was the exact same thing in v13
eeee
One message will be considered a book - as it will contain text explaining clip and clip will be a link as it will be hosted on youtube. Many of these messages will be within a channel within a category.
Yes for second part I'm thinking of using another discord server as a database - because why not, that's why i'm asking if there would be something more appropriate with free hosting and ease of access. I will be indexing messages with a number so I can easily rewrite or swap things around if I need to(obviously a bot will handle larger cases).
UI would be an embed + reaction and maybe even command I'll see how big things get.
This is probably even worse than using json files as a database
well yes i'm kinda new out of necessity so help a bruda out :D hence why i'm asking kinda difficult to find these answers
and also why would it be bad
Managing a Discord server that acts as a database for your stuff is 10x harder and very inefficient because of the Discord API limitations, rate limits, downtimes, and whatnot
Use a real database like PostgreSQL, MariaDB, MongoDB, etc etc
ah ok ty
anybody knows how i can calculate how many users are in the server thats interacted and add 1000ms to every member, its for a massrole command
Generally, this can be done in two ways, one is to use the cache but then not everyone will probably get this role or to use .fetch() which takes information about members straight from the API
The second method may cause a rate limit
So it depends on how many servers this bot should work on
If on one server, the second method is more reliable, but in the case of a public bot, it is better to use the cache
i hate react
Use flutter c:
that's usually a fairly bad idea
first because the user that's trying to use the command will hardly wait for it to finish
we're talking about 1min per 60 users, in a server with measly 6000 users that's 1 hour and 40 minutes
second because unless you lock the command while it's still running, that user is very likely to use it multiple times, thus compounding the issue
a good alternative is giving the role(s) the moment a user writes something, this way you ignore inactive ghosts and prevents spamming the api
wdym ipa
One message removed from a suspended account.
im guessing you mean API
One message removed from a suspended account.
One message removed from a suspended account.
my fav
One message removed from a suspended account.
yes
get drunk on capybeer
is for free or not
ty bro
why would it be paid
This look so cursed, i don't know why
i want if some one vote for bot the bot send to hem msg in dm and gev hem i use 2000-2500 coins mongo database ??
One message removed from a suspended account.
One message removed from a suspended account.
can you help me
please
One message removed from a suspended account.
discord.js v13
One message removed from a suspended account.
can you help me
One message removed from a suspended account.
const { MessageEmbed, MessageActionRow, MessageButton } = require('discord.js');
const User = require('../../models/user');
module.exports = {
name: 'vote',
description: '',
category: 'utilities',
async execute(message, args, settings, client, Discord) {
const row = new MessageActionRow()
.addComponents(
new MessageButton()
.setLabel('Vote Now!')
.setStyle('LINK')
.setURL('https://top.gg/bot/1131780123956363375/vote')
);
const embed = new MessageEmbed()
.setColor('RANDOM')
.setTitle('Vote for Dynasty')
.setURL('https://discord.gg/gXbPRYzbaf')
.setThumbnail(message.author.displayAvatarURL())
.setDescription(
`Dear <@${message.author.id}> \n\n`+
'*__By voting for my bot, you will receive the following benefits:__*\n\n' +
'> - Earn 2000-2500 coins \n' +
'> - Unlock a special role \n' +
'> - Some Premium Commands \n\n' +
'*__Click the button below to vote for my bot on top.gg!__*'
)
.setFooter('Thank you for your support!');
message.channel.send({ embeds: [embed], components: [row] });
}
}
this is comand if he vote in top.gg send to hes dm thanks msg
please
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
ho i can gite my top gg token for bot
One message removed from a suspended account.
dn
One message removed from a suspended account.
One message removed from a suspended account.

🤓
One message removed from a suspended account.
Hello.
One message removed from a suspended account.
TOPGG_API_KEY ??
I am here to help you with my skills and rich experiences in building web and blockchain applications.
As developer
One message removed from a suspended account.
One message removed from a suspended account.
🤔
Christ
Would you like to see some of my past projects?
No
Nah
@crude orchid once again
this server is not a recruiting server
offer your service on platforms such as freelancer or fiverr
hi i need if some one vote for bot automatically bot send to him msg in dm
can you help me
Being plagued by
Error: Text content does not match server-rendered HTML.
Warning: Text content did not match. Server: "socket.connecting..." Client: "Connecting..."
react/next, i18n
socket.connecting = key
Connecting... = value
#topgg-api is your place to ask, providing:
- what have you done already
- whats your approach
- do you have any ideas you could implement
and wait for someone who can help
If no one can help me with this,
How can I make a module that stores the language strings
Looks at the current navigator language and returns the strings for that language?
Adding the language strings server side, accessing them client side all through a module
It's more efficient if you download the locale assets at once and access clientside
But well, implementing i18n is fundamentally simple, but becomes much more difficult the older a project is
All you need is a file containing only the strings, in whatever format you like (I prefer properties format)
i keep getting this error
Then name it in a standardized way (for example locale_en, where en is the locale code)
Inside that file, and all other locale files, have the exact same keys (value doesn't matter) so you can seamlessly retrieve from the files by simply changing the filename
The rest would be replacing all hardcoded strings with the i18n acessor (eg. let str = "here is a string" to let str = locale.get("some_str")
error says it all
trackerCh is undefined
Where did u define it?
Channels aren't guaranteed to be cached at any moment
You need to fetch it
Also you don't need to await a cache operation
how
See the docs, I don't remember it from the top of the head
Also there’s no need to do a find from cache when you have the key of the channel
People gotta stop using this shit 😭
You can do <Guild>.channels.fetch or <Client>.channels.fetch (I think this is still a thing)
They are if you have the Guilds intent in discord.js (except for thread channels)
Or if you're sharding and trying to get a channel from another shard
That’s dumb for any channel to be guaranteed to cache
That’d take a bit of time to do if your bots in numerous guilds
In my opinion caching should only be done if you fetch the channel/member/guild
All you realistically need is an id
is there like a not crappy way to get a list of mutual servers between the bot and user? Considering discord has a built in mutual servers thing for users I'm a little surprised there's not an option for bots
i could keep track of it via database and add/leave guildMember events but that seems like a hassle
you'd need to use oauth2 first of all
right but I didn't want a popup ;-;
second of all, you would then need to access the guilds through oauth2 and you can map out guilds that have the bot's id in them
Its impossible to do this without oauth2
Well I guess not impossible
You could try doing the opposite and using the user's id to map all users in the guilds the bot is in
except going through all the servers and checking for the user
hmm? I don't understand
you mean take all the servers the bot is in and filter for ones that have the user's id?
yeah that's what I meant from my message previously but it seems not good to be doing especially with lots of servers/ users
yea
that's true, I think that's what I did for my dashboard
Its just with oauth2 you already get all the guilds the bot and user share iirc
but doesn't oauth2 require the popup?
tho I might be wrong on that so :p
Oauth2 will always require the user to consent
So yea a pop up would be required
right so this will happen when the user levels up, I just want to send a rank up message to the servers the user is in (with a notification channel enabled)
right now it just happens in the server they did the thing to level up in but it's a global xp system so I wanted it to display in every server they're in
<Client>.guilds.map(guild => guild.members.filter(m => m.id === user.id))
or smth
been a while since I used js
guilds.cache.map
right
yeah that looks about right
forgot about the whole caching thing
but you don't have to fetch users?
wait huh what are you trying to do here
mutual servers
how many guilds will your bot be in if you estimate
Its supposed to filter all servers the bot has cached and look for the servers where the user also exist in it
its in 600 rn but my goal is lots
ok so it definitely wont be suitable
just use oauth
and check for servers the user is in
well I can't do the popup every time. So I may resort to using a database after all
refresh tokens exist
With the oauth2 approach I would check the servers the bot is in, as oauth2 gives you all servers the user is in, so you really only need the bot id to get mutal servers.
You won't need a popup every time
oh?
The way oauth2 works is it gives you an access_token and a refresh_token, an access_token allows you to fetch stuff on behalf of the user (so long as they don't deny your application), a refresh token essentially allows you to infinitely get a new access_toekn (again so long as they don't deny your application later)
So really it will only ask them to re-confirm if they A deny your application or B you fuck up and the access token was never refreshed/revoked
Now note you'd wanna go for authorization code flow over the other 2 for this to work the best
no better tutorial than the discord docs ngl
its a bit of a reader but all the tutorials out there typically have you use passport (ew)
i gotcha
https://discord.com/developers/docs/topics/oauth2
https://discord.com/developers/docs/topics/oauth2#authorization-code-grant
These 2 are what you'll likely need
but do take a look at the other 2 methods of oauth2 and see if its better for ya
You motivated me to work on a project related to oauth2 thanks :p
I have zero motivation to fix my bot lol
ok
what do i do with this information
not be a dick :p
Fun fact, you don’t need to filter this at all
fair enough
It’s wasteful to use a filter
Very wasteful, you’ll loop through all members
Of every server
Right cause maping the guilds is already 1 loop, filtering would be 2 loops
This way it’s a little faster at scale. Still not ideal but eh
😔
Give me motivation lol
Honestlly forgor .get was a thing
yea don't expect battleless to give you anything but a headache
There’s also .has which is the same idea, just does the check for you
My favorite data structure is a hashmap 😎
Yes
Do you think its possible to make a central panel to manage all bots in a guild? (It would require somehow allowing bot devs to integrate into it, but then again why would they do that when their own would bring more traffic which is money in their pocket)
Indeed
What do you mean by manage though?
And likely not useful at all
Like specific features and such of each bot?
Being able to do what each indivual bot's panel would od but in one place
so they dont gotta visit multiple bot's websites
I don’t mean to put down your idea but… That sounds like a pain in the ass for bot devs to implement, and also I don’t see the incentive for them to do that
It would be great for users but I just don’t see devs hopping on that idea
Exactly, what I was thinking, but it would be something that bot devs would likely never agree with
As it takes traffic away from their site
Centralized dashboard might give more discoverability to some bots, but that means less traffic to their site and therefore less ad revenue
Yea
what should i do
Hm?
I haven't used go in ages
Actually, better yet
Last time i used go I made a discord bot that translates different languages and other things like morse code

Do this
But use Go
Honestly the perfect starter project if you’re trying to learn
It’s super fun
I learned so much about Go in a matter of a couple days with this
Just in spare time in between classes
Are they teaching you go at uni 
Nope
Ic
C++ is the only language I’m being taught
I’m learning Go because I joined a student organization that maintains a ton of open source software for data and such about the university in Go
Not a ton. Discrete math is completely new so I’m learning there but my CS class isn’t super interesting yet
We just learned about pointers today
Though to be fair it feels like I’m filling in the holes in knowledge I have from being self taught for the majority of my programming career
That's good
Like how program memory looks in windows and linux, the stack grows down and heap grows up in one of them (can’t remember which)
It’s nice to solidify
I imagine I won’t be learning a TON until 2nd semester when I get my intro classes out of the way
Fair enough, but at least you are learning some :p
I would be in college rn but money me no have
Is there no colleges near u that would offer significant financial aid?
My uni promises full tuition to anyone making 65k or under
(Hence why I don’t have to pay)
I haven't done too much research to be fair
but the ones i've been offered tutelage at have enormous tuition prices
Im not smart enough to get scholarships so a lot if will be dependent on how much financial aid i'm given
Even public ones?
Yea, washington has some pretty high prices unis
All the ones that have sent me offers are like 65k a year
you guys pay for uni? :^)
being a dropout works everywhere :^)
I imagine that you’d get financial aid if you don’t have a lot of income as well
Pell grant and such
I got like 8k from the federal Pell grant because I’m broke
I haven't even checked on my financial aid since I applied for it
Bruh 😭
I didn't think I would go to college 
I know i got approved for smth but never checked how much
Usually it’s not given directly to you
Usually the amount is determined by the school based on the recommendations of the FAFSA
yea
So it varies from school to school
One school approved me for 6k
Private or public
Ouchies
I got roughly 16k in aid total from UTD
Got lucky that Texas has really good public universities
Did you / are going to texas?
I've been looking into good (affordable) online colleges for Computer Science, I have a few jotted down. I almost went with a private university until I got their pricing. It was pretty yikers.
Univerity of Arizona
Univerity of North Texas
Southern New Hampshire University
Guess I'll consult good ol google.
Going in person for UTD is the way to do it if you can afford it
I’m assuming you’re out of state though so that would be pricey which defeats the purpose
Yeah, where I am in Oklahoma the cloestest afforable school is like an hour away and I'm not bout to be driving that much.
The closest school is the private one, costing 15+ per semester.
Texas has great public universities, out of state tuition for any college is gonna be rough though
I'd for sure rather do it in person. But with me living with the girly, I'd rather us not be moving around just for school. So I figured, fuck it, online can be just as well potenatially...
Do you/your family make under 65k a year? If so, you might qualify for UTD to pay for your tuition
I’m not entirely sure how it works for out of state students though
Oklahoma has a thing with people who qualify as residents. It's like 1 year +, I bet that would be similar with Texas
I will warn you though, UTD dorms are pricey. 4.5k per semester for the standard dorm (I don’t think there’s a different option)
Nah I'm not really considering in person as an option anyways.
If i were single, for sure.
How has their CS program been for you? Do you think its a good program they offer? I know the private school when I toured them was offering mainly Java w/ some game design.
I’m not sure how good UNT is for CS in terms of their online program. My dad did (mostly) online for his entire masters degree, but that was for a way different major
It’s been pretty good
I’m doing an accelerated degree plan so I can graduate in 4 years with a masters
The campus is really nice, it’s clean, the community seems to actually care about one another
I couldn't imagine balancing a work life with something like that, even if a part time job.
Only complaint is the parking since it’s a commuter school
Yeah I’m quite busy
Part time job, school, open source org, startup with my friends, personal life with gf, etc
But I can handle it for this semester because most of my classes are the mandatory intro classes
My assignment for this week for one of my classes was literally to attend a CS focused event
Simple enough.
Thing I'm dreading as a new comer to college life is the classes that mean nothing to the CS life.
Yeah
It sucks but it is what it is
If you need a decent bit of general credits, go to community college first
Super cheap, lots of them have online options, and you don’t end up wasting money on valuable tuition in a higher end university
I've heard that doing community first then transfer is recommended. But for simplistic sake I just thought about going balls deep into everything at one place.
But ya, I'll have to visit our local community college about that.
If you can afford it then for sure it’s fine
But if money is a concern I’d definitely go with community college first
Yea but not every college accepts transfer credits from just any college no?
That is also something I've heard.
(Not gonna lie, my local community college has been doing more than UTD so far, my gf is going there rn)
Most of them accept it as long as it’s from an accredited community college
I believe public schools in Texas are legally required to accept almost all transfer credits for the corresponding classes from Texas community colleges
She’s doing a business degree, she wants to get into real estate
Ah
Thats where the money is at
I don't really know what I want to do tbh so good on both of ya for pursuing a thing you want

I think it’s wrong to feed the idea to people that you need to go to college to be successful
If it’s what helps you achieve your goals then you should do it
If it’s a waste of time to reaching your goals then don’t go to college just to please society
One of my goals in life is to get a graduate degree, so that’s what I’m doing
Yeah, I've always been interested in coding for quite some time and self taught myself things, I'm the typa person who struggles to grasp onto more difficault things alone. I do want to branch out and college atleast I think will help me get there. Plus the fancy peice of paper is handy.
I mean I know I will need college eventually
I just don't know what I want to pursue since I have so many intrests thanks to my school's abundance of career oriented classes
That’s the beauty of community college
It gives you time to figure out what you want to do
And it gives you relatively inexpensive classes to try out
Since most programs require the same general classes.
Plus I find that a lot of community college professors are people that used to work in their industry field and have a passion for it
I guess I will start with looking at community colleges
My uncle is a community college professor for calc, he used to write code for Raytheon in the 90s-early 2000s
Big passion for it
icic
Wew
There's actually quite a bit of cc's in washington
cheap to
6k for in state
Thats just one of them
Okay wow there are surprisngly a lot of community colleges where I live
ouchies that’s kinda pricey for community college
Usually they just charge per credit hour, do they have tuition as well?
My local one charges like 60 or 70 bucks per credit hour
Which with 15 hours a semester + books comes out to roughly 2.3-2.7k per year
Which is easily affordable with a part time job (as long as you’re not paying your own living expenses and such)
Honestly no idea, reading websites for colleges is confusing especially anything related to payment
you make music?
this is my biggest issue about it ya. I get easily overwhelmed.
Nah but I have an interest
you do have a good singing voice tho

@dense flame can confirm
Cause cosmic is hardly around 
Meh it’s unrefined so it’s not that good
dm /s
I never dm a recording tho!
My voice in recording sounds horrid no thanks
then move to general
everything in njs is a dependency
one day they'll even make a dependency for booleans
2 other projects in the npm registry using true.

Can someone actually explain
return.js depends on true.js
But why does this exist
because js™️
Hey guys, I invited my bot over to my community server and it asked me for access to my account, is that normal?
Depends on the bot
No
Actually yes. I think it has something to do with the acc having 2auth.
Ahh
All of my bots have administrative and never had access to my account
If the bot has a dash or something then it would
what's the full text?
"Access to your account" or "Access to your account information"?
why is the chromium src ~40gb
can someone reduce unoptimized code rq (delete everything)
"reduce unoptimized code"?
I believe whatever was noticeably unoptimized was already optimized by like, the biggest corpos to date
also sources are big, they are supposed to be
what i believe in, is that they removed one comment and called it optimized 🗣️ 💯
thats the joke...
its literally a joke module
oh ok
mfw I'm thinking about buying 5-10 rpis with LED hats and just doing dumb shit
https://www.npmjs.com/package/@bluesmurfcat/bluesmurfcat
feel free to make prs
missing a "sound" url
I hate you
thanks
this is not good for the npm population
do it yourself and make a pr ❤️
no ty
I think I added it
can you check
The docs should mention it on the markdown section
Can tell me how ?
What's the ratelimit on message edits?
actually, no, that url is pretty useless
I mean, well, it does say ratelimit is variable and u should never hardcode it
I'd say it's probably close to message send ratelimits
message edits share rate limits with sending messages
which is usualy about 5 per 5 seconds per channel
so 2 edits + 3 sends in under 5 seconds in the same channel = limit
Does the wool welcome bot encounter a problem if more than 100 servers join at the same time?
is this the right way to structure a basic database for this? I'm not sure how to properly handle relating tables to one another
Basically each item has a modifier group, which then has individual modifiers for each item within the group
Wool welcome bot?
can an item have modifiers from different groups?
It can have multiple modifier groups yes
then make item have an array of modifiers
and have each modifier have the group id
Well
Why?
Each modifier rests within a modifier group, then an item can have a modifier from the groups it has
Like for example, a burger could have 2 modifier groups. Condiments, and bun type (for the sake of simplicity). You can choose any option(s) from the condiment group to put on the item. You can choose any option from the bun type group to put on the item (I'll handle which ones to make like "select one only" and such)
so its more like an options thing
i was thinking more of like an rpg item with enhancements
where the item could have like a +10att modifier, from a stats modifier group, and a fire element modifier, from an effects modifier group
so it depends on what you wanna do
yeah I'm just trying to model options for an item
the api I'm using just calls them "modifiers" for whatever reason, so I'm just trying to stay consistent to avoid confusion for anyone that eventually works on this in the future (if anyone)
think about how you would do it in json
I was just wondering if that's the correct way to model relations from one table to another
item = {
name: "abc",
modifiers: [
{ type: "stats", effect: "str", value: 10 },
{ type: "magic", effect: "fire", value: 30 }
]
}
vs
item = {
name: "abc",
modifiers: {
stats: [
{ type: "str", value: 10 }
],
magic: [
{ type: "fire", value: 30 }
]
}
}
{
"item": {
"name": "something",
"price": 150
"category": "A"
"modifiers": [
{
"group_name": "Toppings",
"price": 50,
"name": "Boba"
},
{ "other items etc": "", },
]
}
Something like that
But I figured that modeling it directly within the item itself is a bad idea and I should have separate tables for the groups and the items they store
And then have the items point to the IDs
yes, if the price and name of the modifiers are unique per item, they need their own table
👍
if all of your items in the table are unique per user, and all modifiers are unique per item, your tables would be:
items table
owner id
name string
price number
category string
modifiers
item id
group id
price number
name string
groups
group id
sharedgroupprops ??
tabular data usually prefers inverting the ownership of the tables, so instead of arrays of ids, you have a table with ids that point back to the item that owns it
ah
so you would query by SELECT modifiers WHERE item = itemid
and SELECT items WHERE owner = userid
That adds a little complexity on my end but I see how it's useful
I'll do that
What should I do about the fact that items can have multiple modifier groups and modifier groups can apply to multiple items?
Wouldn’t I have to have an array of IDs on at least one of those?
if modifier groups are sets of data that is always shared, and not something that is created and deleted at will, then yeah you would use an array there
or keep them in a json file
:^)
I’m building an API backend for a mobile application, but I’m trying to sort of be the “middleman” between the Clover API (for ordering) and my application so it’s more secure and returned in a format that fits my needs better
But basically I’m just grabbing data from their API, doing some processing, and storing it for future use for my application to fetch from
Reduces the API calls to outside programs and allows me to handle ratelimits easier and such
if modifier A and modifier B have the same groups but the group for modifier A has slightly different data than the group from modifier B, use a separate table the same way its done with items and modifiers
if modifier A and modifier B have the same groups but those same groups ALWAYS have identical data no matter how modifiers use them, then each modifier should have a list of groups they are associated with
(Also if anyone knows how mobile apps securely store credit card information to use for future purchases, let me know. I don’t want to be storing anything super sensitive server side, but I’m sure there’s a way to do it without that)
afaik whatever payment gateway you use (ie stripe) should have their own system for that
^
otherwise idk
btw, regarding the mod thing, it's a wiser option to have a mod pool than 1-to-1 mod relationship to items, else that table will bloat quickly
just make some mods with a roll range, then grab a random value of that roll using the item seed
like Deals (1-10) extra damage, rolling between 1 and 10 for a given item
but then the same seed would affect all mods
and if you want to reroll them by changing the seed, everything will be rerolled
its a good idea tho, if those limiations are fine for you
tbh never saw a game where rerolling mod values affected only the rolled value
aw damn
well, a way to do it with separate rolls would be to have a long seed (perhaps a hash) and substring it for every mod
items in maplestoy have 3 types of rollable enchancementes, each type is rerolled independently
like, 1234-5678-9012-3456, then use each section for individual mods
and reroll only that specific section
yeah thats where bitwise can also come in
a 64 bit int can have 2 32bit seeds or 4 16bit seeds
or 8 8bit
8 bit would risk running out of possibilities if you have too many mods
even 16bit might run out at some point
if putting all possible values of all possible mods together exceeds 64k possibilities
mods would roll their specific section of the seed, so 8 mods would each have 255 possible rolls
not necessarily rolling the remaining mods
could even dynamically split the seed based on mod count
most games ive played never went above 6 mods
joining all mods in the same seed is more space efficient
ie, instead of 0-255 for a mod 1 that can only get 0-10 values, and another 0-255 for mod 2 that can only get 0-20 values
you use one 0-255 that contains all possibilities for both mods together
which is 10*20 = 200 possibilities
yes, I meant fragmenting a single 64bit number
like 0xFF FF FF FF FF FF FF FF
where each FF would be a separate mod roll
but you dont need to fragment if muitple mods fit inside a single fragment
its basically compressing them together instead of fragmenting
ah yes, that's an option too
who can help me use spotifys secret api
why are you so eager to break tos
Contact Spotify Support and ask how much it costs to use it without breaking their ToS 
i'm not breaking tos
it's not breaking tos
fairly sure using undocumented apis is against their tos
It is because using it without Spotify's permission is prohibited, if you can even access and use it in the first place
well sir
is it my fault spotify doesn't provide that information in their public api?
not all apis are public
Dont you need an auth key to access the spotify api?
???
i'm not doing any of that
i want stream counts and monthly listeners of artist
spotify public api does not provide i don't think it's too unethical to use their secret api
stop calling it secret api, it's not like some kind of easter egg
all in all, you still need a token to access the api, they'll know if you use unauthorized endpoints
i don’t
flaze showed me how to use it earlier
but his provided example didn’t work for me
^







