#development
1 messages ยท Page 1868 of 1
ok
@lyric mountain Look
I want to set the channel
then in another code i get this channel
But i don't know why not working
const channel = args[0]
let data;
try {
data = await schema.findOne({
GuildID: message.guild.id,
ChannelID: channel
})
if(!data) {
data = await schema.create({
GuildID: message.guild.id,
ChannelID: channel
})
}
} catch (error) {
console.log(error)
}
await data.save()
return message.channel.send({content: `set the channel to <#${channel}>`})
}
To set the channel
try {
let GuildData = await schema.findOne({
GuildID: message.guild.id,
ChannelID: message.channel
})
if(!GuildData) {
GuildData = await schema.create({
GuildID: message.guild.id,
ChannelID: channel
})
if(GuildData.ChannelID) return message.channel.send({ content: `Current channel is <#${GuildData.ChannelID}>`})
}
} catch (error) {
console.log(error)
}
to know the channel
@quartz kindle It must be already set here
So it should defined as channel
Hi there;
Well, I'm still stuck at the same part, haven't figured out a way to check if a user reacted to a message for the second time.. If it's the second time the user reacts to the message, the bot should remove the user's first reaction and leave the second one
Could someone help me, please?
d.js btw
?
reaction.users.remove(message.author.id)
to remove the reaction from message author
that was my bad wait
try {
let GuildData = await schema.findOne({
GuildID: message.guild.id,
ChannelID: channel
})
if(!GuildData) {
GuildData = await schema.create({
GuildID: message.guild.id,
ChannelID: channel
})
if(GuildData.ChannelID) return message.channel.send({ content: `Current channel is <#${GuildData.ChannelID}>`})
}
} catch (error) {
console.log(error)
}
Should i require channel ?
alright awesome, but what about checking if it's the first or second reaction the user gives to the message?
You want the channel id, do you not?
They told you to do message.channel.id to get the channel id
Yes i need channel id i set here
const channel = args[0]
let data;
try {
data = await schema.findOne({
GuildID: message.guild.id,
ChannelID: channel
})
if(!data) {
data = await schema.create({
GuildID: message.guild.id,
ChannelID: channel
})
}
} catch (error) {
console.log(error)
}
await data.save()
return message.channel.send({content: `set the channel to <#${channel}>`})
}
So
In this code
try {
let GuildData = await schema.findOne({
GuildID: message.guild.id,
ChannelID: message.channel
})
if(!GuildData) {
GuildData = await schema.create({
GuildID: message.guild.id,
ChannelID: channel
})
if(GuildData.ChannelID) return message.channel.send({ content: `Current channel is <#${GuildData.ChannelID}>`})
}
} catch (error) {
console.log(error)
}
Didnโt see that part
I should get the channel
Are you using a valid channel ID as your argument?
You can know how reacted with reaction collector
Yess
Wait lemme do it message.channel not with args
let data;
try {
data = await schema.findOne({
GuildID: message.guild.id,
ChannelID: message.channel.id
})
if(!data) {
data = await schema.create({
GuildID: message.guild.id,
ChannelID: message.channel.id
})
}
} catch (error) {
console.log(error)
}
await data.save()
return message.channel.send({content: `set the channel to <#${message.channel.id}>`})
This to set the channel ^^
now i got this
CastError: Cast to string failed for value "{
name: 'set',
aliases: [ 'Set', 'SET' ],
dmOnly: false,
guildOnly: true,
args: false,
usage: '',
cooldown: 5,
guarded: false,
execute: [AsyncFunction: execute]
}" (type Object) at path "ChannelID" for model "guildSettings"
at model.Query.exec (E:\C) Developing\Wolfy Djs-13\node_modules\mongoose\lib\query.js:4498:21)
at model.Query.Query.then (E:\C) Developing\Wolfy Djs-13\node_modules\mongoose\lib\query.js:4592:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
messageFormat: undefined,
stringValue: '"{\n' +
" name: 'set',\n" +
" aliases: [ 'Set', 'SET' ],\n" +
' dmOnly: false,\n' +
' guildOnly: true,\n' +
' args: false,\n' +
" usage: '',\n" +
' cooldown: 5,\n' +
' guarded: false,\n' +
' execute: [AsyncFunction: execute]\n' +
'}"',
kind: 'string',
value: {
name: 'set',
aliases: [ 'Set', 'SET' ],
dmOnly: false,
guildOnly: true,
args: false,
usage: '',
cooldown: 5,
guarded: false,
execute: [AsyncFunction: execute]
},
path: 'ChannelID',
reason: null,
valueType: 'Object'
}
i just told you why
Done i set it to message.channel.id
I know right, but I don't seem to be able to find the method I must use :/
const filter = (reaction, user) => {
return reaction.emoji.name === '๐' && user.id === message.author.id;
};
const collector = message.createReactionCollector({ filter, time: 15000 });
collector.on('collect', (reaction, user) => {
console.log(`Collected ${reaction.emoji.name} from ${user.tag}`);
});
collector.on('end', collected => {
console.log(`Collected ${collected.size} items`);
});
You need to react to the message first
@quartz kindle Broo
Here to set
let data;
try {
data = await schema.findOne({
GuildID: message.guild.id,
ChannelID: message.channel.id
})
if(!data) {
data = await schema.create({
GuildID: message.guild.id,
ChannelID: message.channel.id
})
}
} catch (error) {
console.log(error)
}
await data.save()
return message.channel.send({content: `set the channel to <#${message.channel.id}>`})
So i set this channel
When i go to the other code to get the data to know the channel i set before
try {
let GuildData = await schema.findOne({
GuildID: message.guild.id,
ChannelID: message.channel.id
})
if(!GuildData) {
GuildData = await schema.create({
GuildID: message.guild.id,
ChannelID: message.channel.id
})
if(GuildData.ChannelID) return message.channel.send({ content: `Current channel is <#${GuildData.ChannelID}>`})
}
} catch (error) {
console.log(error)
}
By that way it gives message.channel.id not the channel i set before
I don't think you're understanding what I need
Check the reactions already stored on the message.
I'm sorry, but after checking the docs for a while again I'm still not able to understand what I'm exactly supposed to do in my code to check the already stored reactions on the message and use it to develop the rest of the code
what exactly do you want to do?
send yes/no emojis and then have the user click them?
what do you need to detect the first reaction for?
Basically, I'd like to make it so that if the user presses reaction 1๏ธโฃ, the bot will do nothing; however, if the user then presses reaction 2๏ธโฃ, the bot will delete reaction 1๏ธโฃ and leave the second one, and so on
More than one user can use this system, so it's important for the bot to verify if the first reaction and the second reaction belong to the same user before deleting one of them
That's what should happen
Pretty basic check code wise.
Just check If the user reacted to the first reaction any time you get a reaction of the second.
you want to make the choice unique right?
a single user can only react to one emoji
so you can loop over message.reactions and check if reaction.users includes the user, and if it does, remove it
exactly, because later I'll use the .collected data, and I need to make sure that every user only chose one option as max
so loop over reactions on collect
.on("collect", ... => {
for(const reaction of message.reactions.cache.values()) {
if(reaction.users.cache.has(user.id)) { reaction.users.remove(user.id) }
}
})
but i'd actually be removing the second reaction, not the first one
you can add a skip for the current reaction
how to do that? 
if(reaction === collectedreaction) { continue }
pymongo is there something wrong with this? py DB.cards.update_one( { "card_title": card_title, "card_desc": card_desc, "col": old_col }, { "$set": { "col": new_col, } }, upsert=True )?
i want to basically replace in the cards collection the old col with the new one
app.get('/test/?name=Jp', (req, res) => {
res.send(`Welcome ${req.query.name}`)
})
not function
uhh
๐
This is not the problem with my code im pretty sure..
(node:6236) UnhandledPromiseRejectionWarning: ReferenceError: AbortController is not defined
at RequestHandler.execute (C:\My Projects\apis\chat\node_modules\discord.js\src\rest\RequestHandler.js:172:15)
at RequestHandler.execute (C:\My Projects\apis\chat\node_modules\discord.js\src\rest\RequestHandler.js:176:19)
at RequestHandler.push (C:\My Projects\apis\chat\node_modules\discord.js\src\rest\RequestHandler.js:50:25)
at async WebSocketManager.connect (C:\My Projects\apis\chat\node_modules\discord.js\src\client\websocket\WebSocketManager.js:128:9)
at async Client.login (C:\My Projects\apis\chat\node_modules\discord.js\src\client\Client.js:245:7)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:6236) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:6236) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
i mean I dont have abot controller anywhere in my code, and its in require handler in discord.js's src
update to node 16
@quartz kindle I'm pretty sure I'm doing something wrong, but I can't figure out what it is
Currently, the bot reacts to the message with the 4 reactions it's supposed to react with, all fine with it, however, when the user (in this case me) tries to press any of those reactions, the bot removes it, regardless it's the first or the second reaction the user adds to the message
for (const reactionValue of m.reactions.cache.values()) {
if (reactionValue === reaction||user.id === bot.user.id) {
continue;
}
if (reaction.users.cache.has(user.id)) {
reaction.users.remove(user.id);
}
}```
continue``` is a thing in js? whoa... never knew that
I believe you can check it by typing node -v in the console
not really sure, but I think running the install command again should update all packages
it does packages... but not node
const DBL = require("dblapi.js");
module.exports = {
/**
* Starts to post stats to DBL
* @param {object} client The Discord Client instance
*/
init(client){
if(client.config.apiKeys.dbl && client.config.apiKeys.dbl !== ""){
const stats = new DBL(client.config.apiKeys.dbl, client);
setInterval(function(){
stats.postStats(client.guilds.cache.size);
}, 60000*10); // every 10 minutes
const dbl = new DBL(client.config.apiKeys.dbl, { webhookPort: client.config.votes.port, webhookAuth: client.config.votes.password });
dbl.webhook.on("vote", async (vote) => {
const dUser = await client.users.fetch(vote.user);
const member = await client.findOrCreateMember({ id: vote.user, guildID: client.config.support.id });
member.money = member.money + 1000;
member.save();
dUser.send(client.translate("misc:VOTE_DM", {
user: dUser.tag
})).catch(() => {});
const logsChannel = client.channels.cache.get(client.config.votes.channel);
if(logsChannel){
logsChannel.send(client.translate("misc:VOTE_LOGS", {
userid: dUser.id,
usertag: dUser.tag
}));
}
});
}
}
};
how to make this webhook work?
Cause it didnt send any webhook
Because dblapi is deprecated
Take a look at the pins in #topgg-api
Use the latest library mentioned in the docs
Can i change it into top gg api?
if(!message.guild.me.hasPermission("EMBED_LINKS")) {
return message.channel.send('oh no looks like i dont have embed permission :<, for commands to work right please give me \`EMBED_LINKS\` permission to continue to use the bot')
}
am i dumb or is the permission embed_links just not working :<

Work with channel overwrites instead
Do: node -v
if it's below 16 then update it to 16
im trying to receive vote data, im currently testing my webhook
app.post("/web/vote", (req,res) => {
console.log(req.body)
})
but it logs undefined when i press test
How do I update
uninstall node from control panel
go to there website and download the latest node version
u can just install it without uninstalling
How to make vote reward with this
where is the data stored when top.gg sends vote data to my webhook? because req.body logs undefined when i tested it
app.post("/web/vote", (req,res) => {
console.log(req.body)
})
app.post("/web/vote", async (req,res) => {
console.log(req)
if(client){
const user = await client.users.fetch(req.body.user)
client.guilds.cache.get("856706638962622465").channels.cache.get("884265293193543740")
.send({
embeds: [
new Discord.MessageEmbed()
.setDescription(
`Arigatou **${user.username}**-san for upvoting me on [Top.gg](https://top.gg/bot/854652560182476800/)`
)
]
})
}
})
cannot read property user of undefined, ok req.body is undefined, how do i access the vote data if it is not in the body?
anyone here
nvm install version
Example
nvm install v16.8.0
Remember nvm not npm
are you using body parser ?
because I guess req.body will be empty unless you use that
try adding
app.use(express.json()) //This line
app.post("/blah", (req, res) => {
console.log(req.body)
})
Also you don't have to find the guild to find the channel.
Instead of client.guilds.cache.get("1001").channels.cache.get("1001") you can simply do client.channels.cache.get("1001")
And about can't read user of undefined Do you have client defined anywhere ?
OH YEA
i forgot body parser smh
it sends 3 request when i press test
hm why does it sends 3 requests
oh wait i forgot to send a response lol
Doesn't seem cloudflare supports that tld.
https://www.cloudflare.com/tld-policies/
Gq
freenom is notorious anyways
you should just buy a domain off namecheap
I know a guy who had multiple domains taken away from him by freenom and then sold
That's only common if your site gets traffic from what I understand.
Great for development and stuff, not so much for production
yup. Chewey was using it for prod
don't other registrars offer tk as a tld?
It's also possible the list isn't fully complete.
Cloudflare may just partially support some
I was wondering what makes people go from thinking that a discord bot is "ok" to thinking that is a great discord bot?
It not being a clone. Or it does something no other bot does. Or it's aesthetically pleasing like tatsu for example.
Ah
Moderation bots usually aren't that impressive to people since they all basically do the same thing. Game bots usually stand out more if they have an original idea.
I have mainly tried to make a game bot as Moderation is about the same.
Yeah. Spend some time playing around with some popular game bots like Owo, Tatsu, Mimu, Dank Memer etc. to figure out why they're popular.
laughs in my bot being a unique discord moderation bot
There's a bunch of popular game bots on the site which you can find easily.
Oh what does it do? Ban, mute, logs, purge messages, automod? ๐ Jk
it does AI powered NSFW filtering
although some bots do have it its not many
not even 10 bots have it as far as I know
lol
Yeah I've seen that before but it is more uncommon for sure
yeah
its still kinda unique tbh
but discord is making my bot burn to pieces atm
since I can't fetch images from discord's cdn and I still dont know why
and if I can't fetch images my bot is completely useless
๐ฌ
I asked in discord dev server but only discord staff can help
aka the ones with staff badge
but no response
so I just disabled my main & only feature of my bot completely

discord why u gotta do dis to me
So right now it's a unique moderation bot that doesn't moderate? 
What error do you get when you fetch?
Does the request require headers maybe?
I tried User-Agent header
and also without it
like they told me to in discord dev
but still the same error
Yeah that's what I was going to suggest 
This code is not working?
If it was a Cloudflare ban the response would be from Cloudflare's server.
Owh so i cannot use that?
I still use it
Someone already answered you
But how to migrate that into top.ggsdk
Look in #topgg-api and pins there
I see
I think it might be cloudflare though
there is no other possibility
Have you tried opening an issue on the discord api github?
I did make a discussion
Make an issue instead
I will just see if I still get a 403 error when trying to fetch
since it has been a while since I last tried to fetch an image
hey I have made a bot then how I can add to it
Or pixxie 

lmao
Please god save my bot
don't make me get a 403 error again
I will just shutdown my bot if the 403 status code error still persists
and the others can't help me
??
What are you trying to do?
I figured as much but can you show any code?
what part?
const route = require(`express`).Router()
const passport = require(`passport`)
route.get(`/`,passport.authenticate(`discord`))
module.exports = route
Have you put the redirect url in the application's dashboard?
yes
Are you sure they're exactly the same? Have you tried logging your oauth url?
lemme see
I've only ever done discord oauth in php so I won't be of much help ๐
client.on('guildMemberAdd', (member) => {
const embed = new Discord.MessageEmbed()
.setDescription(member.user.tag + 'has joined the server welcome!')
console.log('User' + member.user.tag + 'has joined the server!');
var role = member.guild.roles.find(r => r.id === '884081521839976498')
const chnl = member.guild.channels.cache.get('884079613205155900')
chnl.send(embed)
setTimeout(function(){
member.addRole(role);
}, 10000);
});
member.guild.roles.find is not a function
help
thanks for your bot's source code lmao
help also
?
no?
oof i have your bot's source
๐
my bots source requires somethings that the person forked it(u) doesn't know about
halp
Have you tried logging your oauth url? Does the redirect uri match that exactly (including whatever might be after the replit.co)?
yes
And you're still getting that error?
yep
How are you putting the redirect uri in when you make the request. Where's that in your code?
u mean this code?
const route = require(`express`).Router()
const passport = require(`passport`)
route.get(`/`,passport.authenticate(`discord`))
route.get(`/redirect`,passport.authenticate(`discord`,{
failureRedirect: `/forbidden`
}),(req,res)=>{
res.send("hi")
})
module.exports = route
And do you know where that router wants to redirect to?
app.js
const express = require(`express`)
const auth = require(`./routes/auth.js`)
const passport = require(`passport`)
const session = require(`express-session`)
const discordStart = require(`./strategy/discord.js`)
const app = express()
app.use(session({
secret: process.env.session_secret,
cookie: {
maxAge: 1000*60*60*24
},
saveUninitialized: false
}))
app.use(passport.initialize())
app.use(passport.session())
app.listen(2000)
//app.use(express.json())
app.use(`/auth/`,auth)
app.get(`/`,(req,res)=>{
res.send(`hey`)
})
Hmm... I can't really help much more than that.

whats the problem
did you put the correct redirect url?
including the path /auth/redirect as well?
yes
i even made /auth/idk path to see if it works, and it does
ive spent the last hour on this and still wont work 
?
How to make the vote rewards with topgg api sdk?
???
do you have a link pls ? @pale vessel
uhh help?
when my server has 8 cores and 16 threads, does that mean that total threads is 128 (8x16)?
What?
I only know there is hyper threading which does make sense for your case
Correct me if I am wrong because it was a while back when I studied this
how do i "queue" my request for an api?
const strat = require(`passport-discord`).Strategy
const passport = require(`passport`)
const scopes = ["identify","guilds"]
passport.use(new strat({
clientID: process.env.client_id,
clientSecret: process.env.client_secret,
callbackURL: process.env.client_url,
scope: scopes
},(acessToken,refreshToken,profile,done)=>{
console.log(done)
}))
what does accessToken, refreshToken and done do?
will you be sending the requests or receiving them ?
receiving
try this
https://www.npmjs.com/package/p-queue
It should work with Express
?
is that for my question about "how to queue request for an api"
why can't you use that? It's the right way of doing it
Yeah, DMChannels don't have a name
use as
make sure name is in the object
?
(message.channel as TextChannel).name
"name" in msg.channel
wait i didn't see the msg u were replying to sorry,
its actually sending
:misosface:
im getting this error on discord oauth2
"unsupported_grant_type"

const data = {
client_id: discord.clientId,
client_secret: discord.clientSecret,
grant_type: "authorization_code",
code: request.query.code,
redirect_uri: discord.redirect,
};
const headers = {
"content-type": "application/x-www-form-urlencoded",
};
const result = await fetch(`${discord.endpoint}/oauth2/token`, {
headers: headers,
data: new URLSearchParams(data).toString(),
method: "POST",
});
const text = await result.json();
return response.json(text);
},```
can anybody help?
halp
you're just bypassing TS typechecking lol. Using as is fine if you make sure the object has the name property beforehand
what's the error ?
unsupported grant type
TS tries to fuck up
We fuck ts back
i guess its not getting the data
so how do i do that 
?
I did this in my code and it worked
fetch(
"https://discord.com/api/oauth2/token",
{
method: "POST",
body: new URLSearchParams({
client_id: clientID,
client_secret: clientSecret,
code: code,
grant_type: "authorization_code",
redirect_uri: URL,
scope: "identify guilds",
}),
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
}
)
(Don't mind the formatting)
I searched like half of the Google results and at this point you should probably consider making your own package/mudule for that
All of them are either outdated (uses request) or uses callback
is there an example i could based on?
and also?
See these two
You might be able to implement the first one
https://github.com/jhurliman/node-rate-limiter
https://www.npmjs.com/package/async-await-queue
const express = require('express')
const { Webhook } = require('@top-gg/sdk')
const wh = new Webhook('akuanakganteng')
const app = express()
app.post('/webhook', wh.listener((vote) => {
const dUser = await client.users.fetch(vote.user);
const member = await client.findOrCreateMember({ id: vote.user, guildID: client.config.support.id });
member.money = member.money + 1000;
member.save();
dUser.send(client.translate("misc:VOTE_DM", {
user: dUser.tag
})).catch(() => {});
const logsChannel = client.channels.cache.get(client.config.votes.channel);
if(logsChannel){
logsChannel.send(client.translate("misc:VOTE_LOGS", {
userid: dUser.id,
usertag: dUser.tag
}));
}
}
))
app.listen(3000)```
Is this code right?
TypeError: can't read value users of null
please expand request
so how to fix that?
?
You don't know what accesToken and refreashtoken are ?
just done
it's a passport thing
when you're done with work you call return done()
what user?
I'm saying you didn't define client
ah
should i make const discord?
What were the errors it was showing ?
actually whats refreshToken
is it the same thing as accessToken?
or how about this
const express = require('express')
const { Webhook } = require('@top-gg/sdk')
const wh = new Webhook('apikey')
const app = express()
app.post('/webhook', wh.listener((vote) => {
const dUser = await this.client.users.fetch(vote.user);
const member = await this.client.findOrCreateMember({ id: vote.user, guildID: this.client.config.support.id });
member.money = member.money + 1000;
member.save();
dUser.send(client.translate("misc:VOTE_DM", {
user: dUser.tag
})).catch(() => {});
const logsChannel = this.client.channels.cache.get(this.client.config.votes.channel);
if(logsChannel){
logsChannel.send(client.translate("misc:VOTE_LOGS", {
userid: dUser.id,
usertag: dUser.tag
}));
}
}
))
app.listen(3000)```

how could u use this when ur not working with classes
these are discord things
ah any docs about it?
oh yeah i forget its for my command code xD
no error but the webhook didnt run
lemme find one
anyway accesToken is the token you use to fetch data from the api (like bot token)
refreshToken is used to regenerate the token (In case it becomes invalid / exposed)
how can the accessToken be invalid
can i run webhook same host with dashboard? @near stratus
It has a validity
Normally you get a response like this from the api
{
"access_token": "6qrZcUqja7812RVdnEKjpzOL4CvHBFG",
"token_type": "Bearer",
"expires_in": 604800,
"scope": "identify connections"
}
After the time in "expires_in" you have to regenerate the token.
its 7 days
after 7 days they can simply relogin
it doesnt give me that response tho
what module are u using?
passport?
ow, so i cant help
so what about the refreshToken 
Does it give this ?
{
"access_token": "zMndOe7jFLXGawdlxMOdNvXjjOce5X",
"scope": "guilds",
"expires_in": 604800,
"refresh_token": "mgp8qnvBwJcmadwgCYKyYD5CAzGAX4"
}
You refresh the token with it
ah
what happens if i store invalid characters in json keys
@errant flax here is the refresh token docs
https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-refresh-token-exchange-example
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
for some reason it's in python
but anyway
Error
it's in python because that's what the most used language for botums is
not really
you can store anything as a key in a js object unless it's an actual object
do i put that in the params object?
im using axios for this
not here in top.gg
we code in Assembly
top.gg is written in php
evidence: #site-status is full of errrrorrrs
meanwhile xetra: 
111 total messages
51 messages with the word issues
how do you put json as a url param 
akio why did you give discord docs to the poor guy
URLSearchparams
Why my webhook didnt run?
webhooks cannot walk
are you using the node sdk
or maybe you set it up wrongly
he used axios and not node-fetch
He deserved that
yes
lmfao
topgg sdk
meanwhile deno gang has almost every single weeb api built in so no need for deno fetch 
yes, all the weeb apis
#WeebGang
But my question can i run webhook same place with dashbaord?
including weebassembly
leaked footage of captain america saying weebs, assemble when
you could use the example, on the github repo though https://github.com/top-gg/node-sdk and then extend your shit to what you want
Typescript?
@earnest phoenix window is built in deno
So can't they just do window.fetch() ???
somebody make a deno port
the problem was that i was using fetch@2.6.0 and it was messing with url encoded, i switched to axios, and everything is fine now
yeah that is possible
isnt the deno lib better than detritus already?
you don't need the window. part cuz it's a global object
if you're using javascript with the typescript written wrapper, it doesn't matter. Typescript compiles to javascript
pings erwin
:^)
const express = require('express')
const { Webhook } = require('@top-gg/sdk')
const wh = new Webhook('key')
const app = express()
app.post('/webhook', wh.listener((vote) => {
const dUser = await client.users.fetch(vote.user);
const member = await client.findOrCreateMember({ id: vote.user, guildID: client.config.support.id });
member.money = member.money + 1000;
member.save();
dUser.send(client.translate("misc:VOTE_DM", {
user: dUser.tag
})).catch(() => {});
const logsChannel = client.channels.cache.get(client.config.votes.channel);
if(logsChannel){
logsChannel.send(client.translate("misc:VOTE_LOGS", {
userid: dUser.id,
usertag: dUser.tag
}));
}
}
))
app.listen(3000)
``` How about this?
it should be working man
is there a way to synchronously use dynamic imports
or should I just use Promise.all for my command folder imports
nope
await import(...) ``` is something I guess
oh wait
yes
nodejs doesn't have top level await
I read it wrong
import().then()
should i add /webhook in webhook url too?
that actually works yes
it does if you use ESM
nice
can i use top level await inside a for loop
so https://example.co/webhook like this?
sure
nice
how can i test that if it work?
so
var commands = fs.readdirSync("./commands")
.map(file => require(`./commands/${file}`));
I can use this as:
var commands = fs.readdirSync("./commands")
.map(file => await import(path.join(import.meta.url, `./commands/${file}`)));
It should send a message right?
under the webhook panel in your bot
im using var because ill mutate the array later im not dumb
Didnt work it doesnt send everything
yes but, why import.meta.url joined with ./ path
idk
it would be
path.join(import.meta.url, `/commands/${file}`) ```
I guess
does dynamic import work with relative paths?
Not a js guy, but I guess
yup didnt send anything
Is your firewall blocking it ?
no but just information i run dashboard too
it shouldn't be a problem tbh
by any chance are you using nginx or Apache ?
can break... use __dirname or ask user to enter the whole path
@earnest phoenix yes import.meta.url sends an absolute path
alr
nope
ill use path.join for imports
dynamic imports are relative to the cwd
I use VPS
if you use an absolute path, I guess it wouldn't do the job
ยฏ_(ใ)_/ยฏ
Hhmm is this code is for index.js? or what
path.join with import.meta seems like it should work
or create another file
according to google, dynamic imports work the same as require for dynamic, absolute and bare imports
imma try it and see
This Video Is The First Episode Of Bully Next Episode Is Coming Soon.....
Please Subscribe Our Channel....
Thanks For Watching....
then do me a favour and run a console.log(anything) at the beginning of the app.post() to check even you're receiving the request
memes and media is not the ads channel
Well he didn't say anything about subscribing to his channel
so can't ping mods
Hey guys this is my YouTube channel https://youtube.com/user/PewDiePie
Please subscribe UwU
Let's try and keep this channel on topic guys 
const express = require('express')
const { Webhook } = require('@top-gg/sdk')
const wh = new Webhook('akuanakganteng')
const app = express()
app.post('/webhook', wh.listener((vote) => {
wh.webhook.on("vote", async (vote) => {
const dUser = await client.users.fetch(vote.user);
const member = await client.findOrCreateMember({ id: vote.user, guildID: client.config.support.id });
member.money = member.money + 40;
member.save();
dUser.send(client.translate("misc:VOTE_DM", {
user: dUser.tag
})).catch(() => {});
const logsChannel = client.channels.cache.get(client.config.votes.channel);
if(logsChannel){
logsChannel.send(client.translate("misc:VOTE_LOGS", {
userid: dUser.id,
usertag: dUser.tag
}));
}
});
}
}
app.listen(3000)```
Because in that code i didnt add async
cleaner like this
var commands = await Promise.all(fs.readdirSync("./commands").map(file => import(file)))
also faster
noice
why do you have event listeners inside event listeners
thats a big nono
tim how do you debug code so fast
u mean
app.post('/webhook', wh.listener((vote) => {
wh.webhook.on("vote", async (vote) => {```?
yes
await require async function right?
yes but thats not the point
for every webhook you receive, you create a new vote listener
Im so confused xD
you don't need the wh.webhook.on thing
and how about the async?
first webhook, vote runs 0 times
second webhook, vote runs 1 times
third webhook, vote runs 2 times at once
etc...
i mean await
wh.listener( async (vote) => {})
im caching responses from reddit.com so i don't get rate limited
what should i set as the cache time to live
anybody here willing to make a bot for payment?
command in my index.js file js if (command === 'kill'){ client.commands.get('kill').execute(message, args, Discord)}
ERROR 
^
TypeError: Cannot read property 'execute' of undefined
i mean it was the same before I messed up a little
5 per minute should be good
and it used to work
client.commands.get("kill") is undefined

my god,
you have an if else if else for a command handler where you manually put command names
Go here https://fiverr.com
i will for 1000$ 
can i put this code into my index.js?
If the code works you can put it wherever you want
But your code dosen't work
its just a simple tracker like this lol
ad yeah i need to put that code in my index.js xD
its working now
Thx
i dont know why but if i put that in event handled it doesnt running
Oh that'll be 1500$ with 1000$ extra if you want the delivery within a month
yall overprice hard
i got a vc leveling system with image manipulation for only $10
we just doin a bit of trolling
oh
i thought u were serious

i already turned down two other bot building requests
and I made a bot for free
noice
I'm broke
i need crypto
paypal bad
i have given somebody like a year of nitro for making me custom bots lol
and you're an auctions tester
so i can trust ya
hol up rq
I have crypto
I had an old gpu and I use it to mine
But it sounds like an airplane
what did you mine with it
doge
w h y
Can't mine bitcoin
so mine doge > sell doge > buy bitcoin
doge uses scrypt algo for mining which makes it even more resource intensive than pure bitcoin
mine btg
all for custom bots lol
it is designed so people with huge computers get like a 1% better chance at getting more profit
Um it's the opposite but ok
can't mine bitcoin I need a 5000$ gpu for that
the gift link is invalid
try mining bitcoin gold
if you take the picture after 48 hours it appears invalid
wait is that even a thing ?
Didn't see that when trading
why am i even asking you for proof when im not gonna make a bot for anything lol
it is
lol
there are two hard forks of bitcoin
u dont have 6 3090's
lmao
bitcoin cash: insanely low fees
bitcoin gold: insanely low resource intensive
dunno if btg is supported on exchanges though
i can always trade on tipcc
hold up lemme download a btg miner for windows
UwU
BTG is a cryptocurrency with Bitcoin fundamentals, mined on common GPUs instead of specialty ASICs.
ASICs tend to monopolize mining to a few big players, but GPU mining means anyone can mine again - restoring decentralization and independence. GPU mining rewards go to individuals worldwide, instead of mostly to ASIC warehouse owners, recreating network effects that Bitcoin used to have.
fuck doge Imma start btg
you pay for bots with nitro?
either their code is crap or you're ripping them off lol
or you can do this 
or they are from a third world country with crap economy
*india
ye man, indians will work so hard for a few bucks its insane
they deserve way more appreciation, and more money
stop before i convert this chat to politics about the prime minister
they are really good python bots made exactly how i want, but i guess he realy likes nitro
How can i list the active voice connections of a bot?
before i met him he was on discord 4 years with no nitro
in djs v13
now he got like 8 months lol
Hello your computer has virus
Pay us 50$ and we'll fix it
We only accept discord nitro codes
still thats a rip off
some of the bots he is def getting ripped off on
doubt anyone would order a bot if the price was any higher
not bad enough
We only accept XMR
(xmr cannot be tracked)
like the mee6 leveling copy but for vcs would be worth like $80-100 and i got it for 10
how long it he take to do it?
making bots is not easy
a bit over a week
either you got ripped off or they got
damn
mee6 leveling copy can be done with minimum coding using canvacord so it doesn't cost that much
a week of work is worth a few hundred bucks minimum
wtf
Upwork moment
isnt that a bit too much
people be getting ripped off left and right
How can i list the active voice connections of a bot? in djs v13
Honestly even if you earn 10$ per hour and 30 hours a week that's 300-30-20 = 250$
and thats like a bare minimum
you don't know how many hours a week though
he could've spent 30 minutes each day
that's how much my teachers earn a month
teachers are so underpaid its unfair
welcome to our country
freelancers earn waaaayyyy too much than actual jobs
freelancers have to compete with indians who charge 50 cents an hour tho
life's not easy for them
my mom earns a lot less per month
I was talking about India
and she's the most hardworking in the entire school
50 cents an hour is more than actual jobs there?
jesus
no
I was talking about the 10$ standard
ah
10$ is more paid than most of the jobs
1.5 euros here
Mac Clear your cache please, more like Mac Clear the scams please
You can put it under developer portal
Discord will show it when people invite your bot or application
gminer ain't working for mining btg
I get no device found error:
D:\GMiner>mine_btg.bat
D:\GMiner>miner.exe --algo 144_5 --pers BgoldPoW --server btg.2miners.com:4040 -
-user btg1q0ru00r6vkhd7tcjajf7xgaeuz93zg886ly7r4e --pass x
No device found
D:\GMiner>pause
Press any key to continue . . .
D:\GMiner>
oh
ill just say in the url
do command to see tos etc

@quartz kindle sorry for pingus but im trying to fix my broken ubuntu partition
the 17 GB one is where my linux was
what should i do to fix it?
fix as in recover the system? recover data? or just wipe it?
delete it
You can delete it and then expand your existing C or D partition for example
ok
and then ill create a new partition from install ubuntu and install there?
you cant expand C because its not contiguous
but you can expand D after you delete them
ah if you want to reinstall yes
ok
just delete then create inside the linux installer
you can delete the 1.7gb too
ye
now you can do the rest from the installer
Of course you can but not using diskmgmt instead diskpart
aw fuck
You canโt boot from Ubuntu any longer after deleting it lmao
now i need to wait for windows 7 to turn on
Did you change the boot priorities in your bios?
why unetbootin
ยฏ\_(ใ)_/ยฏ
@boreal iron ok i booted windows
do i need to install ubuntu from the iso again
ye but it still requires moving all the data to make the partitions contiguous
lmao i accidentally uninstalled unetbootin
u should. jk
it's working now though
i just opened the file again
have some chocolate while im installing
Alright.. uhm.. quick question.
if (channel !== 'reset') {
channel = interaction.guild.channels.cache.get((channel.match(/\d+/)[0] ?? null));
if (!channel) {
embedError.setDescription("โ The channel you entered is invalid.");
return await interaction.followUp({ embeds: [embedError] });
};
};
Yes that is valid code
The channel is defined as [#development](/guild/264445053596991498/channel/272764566411149314/)
The issue I'm facing is that if someone typed ?command L, L is not a channel causing the match method to error.
Match returns null
Yup.
?.[0]
.. then?
Why did you remove the partition in the first place?
Reinstall the OS and format the drive
channel = interaction.guild.channels.cache.get((channel.match(/\d+/)?.[0] ?? null));
The partition was unrecognised by the installer
That ?? null is unnecessary
The match method still errors though..
I want it to go to the error in the !channel.
TypeError: Cannot read property 'match' of null
That means that channel is undefined
.. but the channel is stored as a string not an object.
check if it's not undefined before doing anything
It doesn't matter what it's supposed to be, inside the channel variable there's undefined
Let me provide an example.. moment.
Same error
!modlogs <#channel> is the command, and the collector for <#channel> is a string, so it stores as a string, doesn't get the object.. so I collected the string like <#channel> but in the channel, I made it L.. but the match method fails since no number were found.
how about u use rufus for the installer, that worked for me
just when you think life couldn't get any worse, your internet breaks during installation
Are you using the latest Ubuntu installer?
Yes
20.something?
yup
lmao
any help on why tf it's trying to use the cdrom mount point
./routes/auth.js
const route = require(`express`).Router()
const passport = require(`passport`)
route.get(`/`,passport.authenticate(`discord`))
route.get(`/redirect`,passport.authenticate(`discord`,{
successRedirect: `https://discord.com`,
failureRedirect: `https://youtube.com`
}))
module.exports = route
./strat/discord.js
const strat = require(`passport-discord`).Strategy
const passport = require(`passport`)
passport.use(new strat({
clientID: process.env.client_id,
clientSecret: process.env.client_secret,
scope: ["guilds.join"],
callbackURL: process.env.client_url
},(accessToken,refreshToken,profile,done)=>{
console.log(profile.accessToken===accessToken)
done()
}))
why does it always redirect me to the failureRedirect link?
here
this is how you partition your drive
Yes away with that WD trash! 
wd > seagate
Pfff in your dreams
talking from experience
Me too
lel
type: 'GUILD_TEXT',
deleted: false,
guild: <ref *1> Guild {
id: '860913724222341220',
name: "๐ผTyrone's server",
icon: null,
features: [ 'COMMUNITY', 'NEWS' ],
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] },
deleted: false,
available: true,
shardId: 0,
splash: null,
banner: null,
description: null,
verificationLevel: 'LOW',
vanityURLCode: null,
nsfwLevel: 'DEFAULT',
discoverySplash: null,
memberCount: 4,
large: false,
applicationId: null,
afkTimeout: 300,
afkChannelId: null,
systemChannelId: null,
premiumTier: 'NONE',
premiumSubscriptionCount: 0,
explicitContentFilter: 'ALL_MEMBERS',
mfaLevel: 'NONE',
joinedTimestamp: 1629523272638,
defaultMessageNotifications: 'ALL_MESSAGES',
systemChannelFlags: SystemChannelFlags { bitfield: 3 },
maximumMembers: 250000,
maximumPresences: null,
approximateMemberCount: null,
approximatePresenceCount: null,
vanityURLUses: null,
rulesChannelId: '876085712758399036',
publicUpdatesChannelId: '876085712758399036',
preferredLocale: 'en-US',
ownerId: '551120440584699904',
emojis: GuildEmojiManager { guild: [Circular *1] },
stickers: GuildStickerManager { guild: [Circular *1] }
},
guildId: '860913724222341220',
parentId: null,
permissionOverwrites: PermissionOverwriteManager { channel: [Circular *2] },
messages: MessageManager { channel: [Circular *2] },
threads: ThreadManager { channel: [Circular *2] },
nsfw: true,
id: '876085712758399036',
name: 'general',
rawPosition: 2,
topic: null,
lastMessageId: '884395473266417664',
rateLimitPerUser: 0
}โ
nice wall of text
Iโm older than u so shut up young boy! 
how old are you again?
Like using message.channel.features
lmao
WD reds are good as well as Ironwolfs
those are not channel features
they are guild features
This is message.channel
agreed, am using wd red in my laptop
!eval message.channel
Yes we had
I agree anyways never heard something good about barracudas before
Oh nwm this is guild but how to get it with code
Guild.channel.features === COMMUNITY ? YES NO
more than half of the barracudas i installed for my clients broke within 1 year
and most of the pcs they brought in with bad disks were preinstalled seagates
this was on laptops from 2010-2015
my pc is from 2014
Very sad tho
Didnโt u ask that yesterday already?
its a guild feature, not a channel feature
you access it from the guild object, not from the channel object
message.guild.features or channel.guild.features or guild.features
also, its an array, so you can use .includes
I wanna detect these community channels
i just told you how
*our communism channels
You said how do get these result
Oh
Yes you did sorry
Thanks
is it possible to know who added the bot to a guild (guildCreate) in discord.js?
not possible in any library
anyone??
because i want to let the user who added the bot know, that the bot doesnt have the right permissions
how could i do it then?
Try to message the guild owner about missing permissions
or just check via audit logs
Or try to send a message to the channel a command of the bot with missing permissions has been executed
if the bot has perms to see it
any reason on why is this happening?
but what if
the owner has turned off messages from the server or if it was an admin, not the owner who added the bot
hmm well yeah i could do that
Well then respond to executed commands with a message about the missing permissions to run this command
No bot needs all permissions in the first place
yeah but i was thinking, what if it doesnt have read/send perms
2 possibilities, 1st donโt care as they might kick the bot again if it doesnโt work, 2nd detect if the bot is missing basic permissions like sending messages and leave the guild
hmm ok
????
Message could not be loaded
./routes/auth.js
const route = require(`express`).Router()
const passport = require(`passport`)
route.get(`/`,passport.authenticate(`discord`))
route.get(`/redirect`,passport.authenticate(`discord`,{
successRedirect: `https://discord.com`,
failureRedirect: `https://youtube.com`
}))
module.exports = route
./strat/discord.js
const strat = require(`passport-discord`).Strategy
const passport = require(`passport`)
passport.use(new strat({
clientID: process.env.client_id,
clientSecret: process.env.client_secret,
scope: ["guilds.join"],
callbackURL: process.env.client_url
},(accessToken,refreshToken,profile,done)=>{
console.log(profile.accessToken===accessToken)
done()
}))
its always redirecting me to the failureRedirect
if (!member.roles.cache.some((r) => r.name === 'Muted')) return console.log("already unmuted")
TypeError: Cannot read property 'cache' of undefined
command in DM executed? or what is member
little complicated:
const checkMute = async (con, client) => {
con.query(`SELECT * from mutes`, async (err, results) => {
results.forEach(async res => {
// console.log("Expires: " + res.expiresAt + " current date: " + new Date())
if (res.expiresAt <= new Date().toLocaleString()) {
// console.log("Mute from " + res.userId + " runs up")
let server = client.guilds.cache.find(server => server.id === res.serverId);
let user = client.users.fetch(res.userId);
let member = await server.members.fetch(user);
if (!member.roles.cache.some((r) => r.name === 'Muted')) return console.log("already unmuted")
}
})
})
}
module.exports.checkMute = checkMute;
but member is right
lel help
Oh I'm sad I missed the conversation about freelancers getting ripped off
$10 for a bot shouldn't be a thing. Your time is worth so much more than that.
?
can someone help me with a discord oauth2 :reeeee:
You're still having issues with that ?
waddya need?
./routes/auth.js
const route = require(`express`).Router()
const passport = require(`passport`)
route.get(`/`,passport.authenticate(`discord`))
route.get(`/redirect`,passport.authenticate(`discord`,{
successRedirect: `https://discord.com`,
failureRedirect: `https://youtube.com`
}))
module.exports = route
./strat/discord.js
const strat = require(`passport-discord`).Strategy
const passport = require(`passport`)
passport.use(new strat({
clientID: process.env.client_id,
clientSecret: process.env.client_secret,
scope: ["guilds.join"],
callbackURL: process.env.client_url
},(accessToken,refreshToken,profile,done)=>{
console.log(profile.accessToken===accessToken)
done()
}))
always redirects to failureRedirect link
hmmm, idk what passport is sorry

passport just provides easy ways for express apps to implement authentication
I never used it though I usually just write my own oauth handlers
wait how 
oauth isn't that hard after you understand how it works
it's just some go-here-go-there and processing some data on each step
let server = client.guilds.cache.find(server => server.id === res.serverId);
let user = client.users.fetch(res.userId);
let member = await server.members.fetch(user);
if (!member.roles.cache.some((r) => r.name === 'Muted')) return console.log("already unmuted")
TypeError: Cannot read property 'cache' of undefined
Nope
not at all
Just spend 6 hours debugging the code just to realize it accepts URLSearchparams and not json
same issue I had 
who tf uses querystring in body?
because it wasn't supposed to be accepted in the first place
discord
I'm not sure but I don't think guilds are ever cached
typical discord am I right
treating devs like dogs
@errant flax do you get redirected to the discord auth page first?
one that tells you to authorise
you're using
let users = <guild>.users.fetch(id)
Try adding await
let users = await <guild>.users.fetch(id)
wait guilds are cached on djs?
yes but you can limit them in v13
tf
.fetch() always better than .get()
thanks man

yes
are you familiar with Discord Auth and all this stuff? ๐
is there a way of changing the bots profile banner color?
Changing the pfp color iirc
guess so
can we maybe talk in DM? :)
;-;
maybe we can talk later
I have an exam in a few minutes
sure no problem^^
I try to create a role named "Muted" but the roles name is always "new role". I tried:
msg.guild.roles.create('Muted', {
data: {
color: 'GRAY',
},
reason: 'Muted - by bot',
})
and this:
msg.guild.roles.create({
data: {
name: 'Muted',
color: 'GRAY',
},
reason: 'Muted - by bot',
})
What discord.js version?
how would i select one random object each time? So right now, either sword or axe.
thats basic java script.
var randInt = Math.random() * (max - min) + min;
i started TS now, and how do you fix this error?
well not now, as i now have objects to randomize
did you try npm i discord.js
but you can order a number to an object
its works tysm
I dont understand
I want to add the role to the channel permissions and edit it:
let role = await msg.guild.roles.create({
name: 'Muted',
color: 'RED',
reason: 'Muted - by bot'
})
let edit = await msg.guild.channels.cache.forEach(r => {
r.permissionOverwrites.create([
{
id: role.id,
deny: ['SEND_MESSAGES']
}]);
})
if (!userOrRole) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role');
^
TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.
You can't use typescript with discord.js without sone heavy brainfuck
it's a typescript error not a nodejs module not found error
make an array ["sword", "axe"] (you can use Object.keys for this), select a random index (Math.floor(Math.random() * array.length)) and then just do inventory[whatever you selected]
@earnest phoenix
lmao wat
Yeah they didn't install djs
since when did djs have ts support

Guys I did my custom emojis 32x32px but they look blurry as hell, what should be the size of them?
At least 128
for (let i = 0; i < list.length; i+10) {
console.log(i)
}```
return 0, 0, 0 ....
64 could work for less detailed emojis
I'll try 128 thank you
i + 10 is not being assigned to i
so the value of i never changes
why ?
umm because you are never setting the value just calculating it?
try doing i = i + whatever
ow okay thx
Quick question to all developers out there working with larger bots, I'm looking for a way to monetize my bot. Any suggestions?
patreon
Premium features with Chargebee. Don't use Patreon, their API is a clusterfuck nightmare to work with.
don't bother monetizing your bot before it grows a decent size
Give your users a good reason to donate/upgrade to premium (most bots don't).
Isn't chargebee paid?
Chargebee is free for your first $90k or something
that's how they succeed because they make everything free initially, grow then gradually become a sellout
it's a great tactic
I've been using it since June instead of Patreon and Chargebee is perfect. So easy.
e.g. most mobile apps do that
ALL mobile apps do that
I think you need to have a registered company to be able to use Chargebee though
I can't remember when I signed up what they asked for, but I've heard some people say they ask for business details.
Mac when are you gonna send your chargebee referral
They don't have a referral system lol
oof
I'm just genuinely satisfied
I'm just gonna make my bot free and slap a donate command on it
Me personally, I like when an application only charges for what's costing them. For example, most of AniList's features are free to use but only a few are locked behind premium because they "cost" more to run.
Before, I would have a spreadsheet with people's Patreon real names, Discord usernames saved on Patreon (not updated) and Discord IDs so I could find them if I needed to, even though I had their official bot give them the roles and unlock the features for them. Their API was a nightmare and their bot was hella unreliable. Some people had stopped paying and didn't have their perks removed.
Most crypto miners only take 1% of your mining rewards and they even allow you to build from source to get everything free
Now, Chargebee does everything for me automatically. I don't need to do anything. People sign up on my site, pay and get their perks, invoices etc all automatically. When they want to cancel it cancels for them and I don't have to go and check to make sure it's done like I did with Patreon.
I would waste hours every month checking through the Patreon list and referring to my spreadsheet making sure people had the perks they paid for / had their perks removed. Patreon is 0/10 bad experience and high fees on top.
Chargebee's API is easy and their docs are very complete.
And I also don't require any unnecessary details like real name etc. All I collect is their Discord ID and email address. Whereas with Patreon it asks for their real name and doesn't give you their Discord ID on the dash so it's kinda painful when it comes to support.
Patreon just forgor to clear their cache smh
Fr
It'll show you their Discord username when they signed up. So if they change it you don't know who they are.
i smell a skill issue
I heard about Chargebee here
blame my endless Chargebee ramblings whenever someone mentions Patreon on whoever told me about it.
And tbh if you're earning $90k and you get into the paid tier, it's still hella cheap for all it does.
I wouldn't mind paying
If someone's earning 90k and call smth expensive they have a problem
Well you can be earning $90k and not making a huge profit after taxes, salaries and overheads. $90k still isn't huge in business terms.
I worked for a startup a few years ago that made over $150k in turnover in a year and the manager still couldn't afford to pay himself.
Turnover โ profit
in discord bot terms tax evasion is actually a very easy thing
well the IRS might come knocking asking how you're earning all this money but
It's easy until they catch you 
bitcoin
lovely to see how governments love to milk as much money as they can through taxes from their hard working and struggling citizens
If you get audited you'd still be stuffed. You'd have tax invoices from your payment processor you'd have to justify.
it's impossible to see who sent money to whom in xmr
"oh we just send stripe money because we like them"
"only 90k a year from my friends no biggie"
The money they tax you goes back into the stuff you use. I'd rather see them milk companies paying $0 in taxes for some loopholes.
They tax us more than they need to
pretty sure most of it goes towards politicians being able to use money as toilet paper
You don't need to pay tax if you declare a loss anyway. The #1 aim of a new company is to NOT make a profit. If you're making a profit you're doing it wrong and you should fire your accountant.
Because companies would rather pay $0 and have others clean up their mess (you!)
i don't get the you
rich getting richer poor getting poorer
discord has banned you for saying the truth about big botums
oh uh, yeah I know I made 200 billion but all I have for you is this subway sandwich
and in the uk boris is making things even worse
he should be locked up
pretty much has blood on his hands
don't even ask me about india
the bitchass prime minister modi thought removing the 500 and 1000 ruppee notes would be a good fix for tax evasion
every politician has blood on their hands
and wasting tax money forcing people to get vaccines that don't even work half the time and stupid covid19 schemes that just ended up killing people instead of helping
Now you use crypto to evade tax
modern day nazis if I say so myself
Hmm this is getting political...
chat getting real sussy rn
Should i be worried i know nothing about tax
this is development
Isnt this the dev channel ?
this got political a while ago
Yes
Same I too know nothing about tax
funny joke name one good politician

@split hazel and @earnest phoenix
Joe Mama
How to add if anyone add our bot to their server after adding the bot they will be redirected to another website that we set.
If someone understands what I am saying pls tell
Anyone?
You can
You have to use the redirect uri parameter on the invite link
Just add a redirect URI to the bot invite
It's not oauth... ๐
Dev portal
question: does the redirect work even if all you selected as the scope was bot and/or application.commands so the app doesn't really need a token
Hi! Actually do slash command, i do this for send to discord my commands but actually i was cooldown for 24 hour because he spam API. Someone can give me a solution for sent only new command to discord when my bot start ?
https://hastebin.com/idezaracam.less
@earnest phoenix see #support message
My bad
political development is a form of development :^)
jk pls no ban
(node:13248) DeprecationWarning: The message event is deprecated. Use messageCreate instead
WTF is this ๐ญ
exactly what it says
lemme see
instead of "Imessage" change to "messageCreate"
client.on("messageCreate", (message) => {
//...
});
my bot is not working
client.on('messageCreate', message => {
if(message.author.bot || !message.content.startsWith(prefix)) return;
const args = message.content.slice(prefix.length).trim().split(/ +/);
if(message.content.startsWith === `${prefix}ping`){
initiate(ping)
}
});
function initiate(command){
fs.readdir('./Commands', (err, files) => {
if(err){
console.log(err)
}
else{
files.forEach(file => {
if(!file.endsWith === '.js'){
console.log(`No command found ending with ".js"`);
}
else{
const command = require('./Commands/${command}')
client.commands.get(command).execute(message, args)
}
})
}
})
};
client.on('messageCreate', message => {
if(message.author.bot || !message.content.startsWith(prefix)) return;
const args = message.content.slice(prefix.length).trim().split(/ +/);
if(message.content.startsWith === `${prefix}ping`){
initiate("ping")
}
});โ
@sick fable
thanks
np
and btw thats what i did
lemme send ya my ping.js
const discord = require('discord.js');
module.exports = {
name: "ping",
description: "This command tells the bot ping.",
execute(message, args){
const embed = new discord.MessageEmbed()
.setTitle('Client latency:')
.setDescription(client.ws.ping)
.setColor('#FFFF');
message.channel.send('Pong!', embed)
}
}
function initiate(command, message, args){
fs.readdir('./Commands', (err, files) => {
if(err){
console.log(err)
}
else{
files.forEach(file => {
if(!file.endsWith === '.js'){
console.log(`No command found ending with ".js"`);
}
else{
const command = require('./Commands/${command}')
client.commands.get(command).execute(message, args)
}
})
}
})
};โ
I use python and discord.py
Due to a stupid mistake of mine i got a recursion error(s) (line repeated 1k times)
I want to ask is it worth that the bot be shutdown and got it fixed or the error can be ignored for a while?
(Basically is that error fatal?)
const discord = require('discord.js');
module.exports = {
name: "ping",
description: "This command tells the bot ping.",
execute(message, args){
const embed = new discord.MessageEmbed()
.setTitle('Client latency:')
.setDescription(client.ws.ping)
.setColor('#FFFF');
message.channel.send({content: 'Pong!', embeds: [embed]})
}
}โ```
@sick fable
lemme see
client.on('messageCreate', message => {
if(message.author.bot || !message.content.startsWith(prefix)) return;
const args = message.content.slice(prefix.length).trim().split(/ +/);
if(message.content.startsWith === `${prefix}ping`){
initiate("ping", message, args)
}
});โโ
I at least think that's how it works
didnt worked
if your bot is still working, then its not fatal
lemme see what i can fix in the initiate function
@quartz kindle help him '-'
in which case it depends how often the crash happens
@sick fable send error for me
this is very very bad code
ik LOL
you are reading the files again on every command
i fixed the function
lemme last try
if your bot is in 1000 servers, and people use 1000 commands, your bot will read the same file 1000x at once
Bots not facing any issues but its just noisy on my console so i keep getting worried if it would impact my bot performance, thanks!!
i meant to reply to this, sorry igor