#development
1 messages · Page 1093 of 1
someone is trying to get inside your machine
did you have fail2ban running?
ohh boy you dont secured your VPS?
can u guys give me link of upgrading codes to V12
you know that you are getting fucked if someone steals your machine
client.on("message", message => {
if(message.author.bot) return;
if(!message.content.startsWith(prefix)) return;
if(message.content === ("-serverinfo")) {
var voiceChannelCount = message.guild.channels.cache.filter(c => c.type === 'voice').size;
var TextChannelCount = message.guild.channels.cache.filter(m => m.type === 'text').size;
let embed = new Discord.MessageEmbed()
.setColor("#0012f5")
.setThumbnail(message.guild.iconURL())
.setAuthor(message.guild.name, client.user.avatarURL())
.addField("Overview:",
`Server Region: \`\`${[message.guild.region]}\`\` \n Owner: \`\`${message.guild.owner.user.username}#${message.guild.owner.user.discriminator}\`\`\n Boosts: \`\`${message.guild.premiumSubscriptionCount}/30 (Tier ${tiers.message.guild.premiumTier || 0})\`\``,
true)
.setFooter(`ID: ${message.guild.id}`)
message.channel.send(embed)
}
});
```Cannot read property 'guild' of undefined
ty @lusty quest
how much time does it usually take upgrading?
@minor kelp you have the duty to prevent others from taking controll over your hardware. if you fail it can have legal issues for you (depending on the countrie)
@weak rain depends on your skills
@weak rain depends on your skills
@lusty quest but if a begginner does then?
yea you have to follow the US law then
@weak rain idk how good are you with javascript? took me 2 days
i dont do DMs
@lusty quest okay ty
any1?
client.on("message", message => {
if(message.author.bot) return;
if(!message.content.startsWith(prefix)) return;
if(message.content === ("-serverinfo")) {
var voiceChannelCount = message.guild.channels.cache.filter(c => c.type === 'voice').size;
var TextChannelCount = message.guild.channels.cache.filter(m => m.type === 'text').size;
let embed = new Discord.MessageEmbed()
.setColor("#0012f5")
.setThumbnail(message.guild.iconURL())
.setAuthor(message.guild.name, client.user.avatarURL())
.addField("Overview:",
`Server Region: \`\`${[message.guild.region]}\`\` \n Owner: \`\`${message.guild.owner.user.username}#${message.guild.owner.user.discriminator}\`\`\n Boosts: \`\`${message.guild.premiumSubscriptionCount}/30 (Tier ${tiers.message.guild.premiumTier || 0})\`\``,
true)
.setFooter(`ID: ${message.guild.id}`)
message.channel.send(embed)
}
});
```Cannot read property 'guild' of undefined
will my bot become unsupportable of i dont update?
okay
`Server Region: \`\`${[message.guild.region]}\
comment out the field and make a console.log(message)
@earnest phoenix mentions.users.first()
@minor kelp this is concerning
someone is attacking your machine.
@earnest phoenix mentions.users.first()
@lusty quest read https://hastebin.com/bejejuyena.js
please
change your SSH port and install fail2ban
How do I check if a bot can dm a user discord.js
comment out the field and make a console.log(message)
@lusty quest i did message.guild
message is not defined
@minor kelp have fun when your Bot ends in a Botnet
also if you use Linux
run sudo apt install fail2ban
fail2ban will lock out IPs that fail 3 times to login
but can be configured
you get a initial config that is already better than nothing
you can keep the config and just keep it running
your server sees the IP
rhost in your logs
its every time a different IP
@viral iris you got a wired ass error there
which is the stable version for V12?
latest
@viral iris you got a wired ass error there
@lusty quest ik lol
just remove discord.js and install it with npm i discord.js --save
it was working
@minor kelp i know that i could get a fine here if i just ignore it
but i added a line on it
can u tell me name
@viral iris did you do some stuff with caching?
(Tier ${tiers.message.guild.premiumTier || 0}
yea
added this line
what is tiers?
var tiers = {
0: "0",
1: "1",
2: "2",
3: "3"
};
bcs you have to protect your Hardware as user of it. If you Fail you have to deal with the Consequences if it ends in a Botnet
@viral iris this is a invalid query
well you are probably booted
@viral iris this is a invalid query
@lusty quest can u tell me wat's the right ?
the var ?
well hope they didnt made a Grab n Run thing
or in the line ?
@viral iris yes bcs the script tryes to access inside your tiers var message.guild.premiumTier
504 is gateway timeout
hello
how you make bot private
from someone inviting it?
where i go
for that
so turn this off right
thanks
its one step
but would also change the SSH port just to give them a new attempt with finding the right port
did you run a firewall?
anyone can use mentions.users.first() ?? in discord.js
How can I fixed it
version
sharding manager or Internal Sharding?
hmm did you made some external settings? for some reason no websocket spawns
No
how did you configured internal sharding? manual shard or auto?
Auto
Ok
How do i customize values for specific guilds?
For example : No. of warnings to automatically mute a member
store the warnings per guild and add the userid of the member as a key for identifying
then check on warn how many Warns the user already got. if the set number is reached mute the user
yea how do i do that
i wanna know how to store constants per guild
that was just an example
@mild flower use a database
🇦

Sorry for the persistent questions but this is my last one i swear.
When making a warn command i wanted to send a dm to the user saying they had been warned.
The warned users constant : const warn = message.users.mentions.first();
I tried doing message.send.warn(xyz) (dont judge)
message.mentions.users.first() @mild flower
then just warn.send()
or
message.mentions.users.first().send()
its nothing bad to ask. we just wont give you entire code for stuff only pointers
operand, not int
@restive lily str(thing) to get string operand.
idk what operand is or means
learn basic python then.
Hello. Help me please.
hello. do you know what you're doing
^
if (!message.member.id === "349095859859881984") return;
```is it wrong ?
I got ghost pinged...
help, i can't figure out how to get the clear interval working
code: https://hastebin.com/yipogasezu.js
you know this command is API Abuse
import express from "express";
import fs from "fs";
import Handler from "./API/handler";
const app: express.Application = express();
const Routes = Handler();
for (const file of Routes) {
const route = require(`${__dirname}/Routes/${file}`);
app[route.method](route.endpoint, route.run)
}
``` I am trying to make an express server in typescript but this keeps giving me an error:
`Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'Application'.`
and I'm confused as to why this happens, can I have any help?
import { readdirSync } from "fs";
import { join } from "path";
export = () => {
return readdirSync(join(__dirname, `Routes`));
}```This is API/handler.ts
import { Request, Response } from "express"
export = {
endpoint: "/",
method: "get",
run: async (req: Request, res: Response) => {
}
}```This is API/main.ts
you know this command is API Abuse
i know i already chaneged it
why not remove done ?
await message.channel.bulkDelete(mes_count).catch(WoW => {});
message.channel.send("**done**")
.then(message => {
message.delete(10000
guys i need help with writing an okcupid bot
i plan to code it in javascript and the main thing will be that if the match percentage is below 85, the bot will automatically swipe left
Swipe left?
oops i used the wrong term
if it's lower than 85, it will pass th person
and if it is >=85 then it will stop untill i decide for myself and restart the bot
I don't really understand your idea
https://discordapp.com/channels/264445053596991498/272764566411149314/737578213152391248
if (message.author.id !== "349095859859881984") return;
hi
No idea what okcupid is
https://discordapp.com/channels/264445053596991498/272764566411149314/737592983435739242
message.channel.bulkDelete(mes_count)
message.channel.send("**done**").then(msg => msg.delete({timeout: 10000}))
@viral iris 🙂
who haves log bot
Logs for?
Logs for?
@pure lion log bot codes
What
https://top.gg/bot/dyno
@void vale not like this codes
Pay me and I'll write logging stuff
$5 but I'll negotiate
hey bro
Depends how much you want
hm
free
Asking for money?
For what?
Idk coding

commands to make a log bot
,
Ideas or actual code?
You have MEE6 and Dyno that have audit logs, why would you pay
^^^
You have MEE6 and Dyno that have audit logs, why would you pay
@ionic dawn ı dont like these bot


I can do it for free, but I'm a beginner
delete mesagges and se
I can do it for free, but I'm a beginner
@void vale no problem
Why don't you hire a JS programmer or something
but ı cant do the log bot codes

is anyone able to tell me the code for messageembed to have a text as a url not as a title tho
just don't put anything in the url field
discord.js v12?
@sinful belfry i use v12 and 11.5
@ionic dawn in what " " ' ' or ``
doesn't matter
Either
cheers ill test it now
@viral iris 🙂
@void vale thx
Anyhow remember that ` is used to add vars inside the string, well not just vars, all kind of stuff
fs or photo-collage package is supported in heroku ??
@earnest phoenix you can't put a url in the field title tho
@sinful belfry @ionic dawn still dont work
fs is I think
@ionic dawn yes or no ?
@earnest phoenix you can't put a url in the field title tho
oops
that pinged u lol
ye lol
@ionic dawn i dont want it in the title
you need to do .addField("FIELD TITLE HERE (urls are not supported here)", "field body [you can](embed links)");
^
@earnest phoenix ```js
.setImage(" ")
@viral iris not a image
gif ?
trying to embed links in text think ive found it now
if it gif it works 2
@viral iris pretty sure it should be supported
That ref?
Vo1d ive done it now cheers tho
it is a standard node module
@sinful belfry what about photo-collage
try it and see i guess
No idea on that ^
im sure it'll work if it is just an npm package
Hello, I don’t know if it belongs here but do you guys have also problems with playing music? My bot runs into an error and gives me “Unsupported JS expression” as an output
where are you hosting
im trying to do const { Util } = require(Discord) and discord and discord.js it says ReferenceError: Discord is not defined i have discord.js installed in this dir why is it doing this
what are you using to play music
youtube-dl you mean?
that's weird, i would've expected that error to come from web js or something 
ah yes i am dumb
npm install discord.py
I tried to look it up but all they give me is “update it” / “yes, same error” etc.
lol
it's js not python
`
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
engines.node (package.json): 12.x
engines.npm (package.json): unspecified (use default)
Resolving node version 12.x...
Downloading and installing node 12.18.3
Using default npm version: 6.14.6
-----> Restoring cache
- node_modules
-----> Installing dependencies
Installing node modules (package.json)
npm ERR! code ETARGET
npm ERR! notarget No matching version found for fs@^0.0.1.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'build_6529d9a1_'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.HPF9u/_logs/2020-07-28T10_14_05_096Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
`
what is that mean ?
@tight plinth i just added require('discord.js') and changed it to discord.js and it says the same thing
heroku rip ?
do you know how to use js
"notarget No matching version found for fs@^0.0.1."
well no
the package version doesn't exist
discord.js
npm install discord.py
in which universe does this make sense?
learn basic js please
I have created a discord bot with Hypixel API, for u is good? (sorry for my english)
i know basic js
it's js not python
:O really?
"notarget No matching version found for fs@^0.0.1."
@fast zenith u know what's the current version ?
learn basic and js you say? uWu oWu
there should be no reason why its saying discord.js is not defined
show code
ugh over 2k letters
any1 know fs version ?
fs comes with node's core modules
Dude bin it
ugh why
Preparing to connect to the gateway...
[WS => Manager] Manager was destroyed. Called by:
Error: MANAGER_DESTROYED
at WebSocketManager.destroy (C:\Users\Harjap\Downloads\accurate-thin-mango-2020-07-25_134817 (extract.me)\app\node_modules\discord.js\src\client\websocket\WebSocketManager.js:335:54)
at Client.destroy (C:\Users\Harjap\Downloads\accurate-thin-mango-2020-07-25_134817 (extract.me)\app\node_modules\discord.js\src\client\Client.js:235:13)
at Client.login (C:\Users\Harjap\Downloads\accurate-thin-mango-2020-07-25_134817 (extract.me)\app\node_modules\discord.js\src\client\Client.js:224:12)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:16348) UnhandledPromiseRejectionWarning: Error [TOKEN_INVALID]: An invalid token was provided.
at WebSocketManager.connect (C:\Users\Harjap\Downloads\accurate-thin-mango-2020-07-25_134817 (extract.me)\app\node_modules\discord.js\src\client\websocket\WebSocketManager.js:135:26)
at Client.login (C:\Users\Harjap\Downloads\accurate-thin-mango-2020-07-25_134817 (extract.me)\app\node_modules\discord.js\src\client\Client.js:221:21)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:16348) 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: 1)
(node:16348) [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.```
just send the part with the error
You don't need to install it separately
i get this error
like the error in the console
@viral iris https://nodejs.org/api/fs.html Just remove it from your package.json, It is apart of Node.JS by default
and the line of code with the problem yeah
ok
console message
const { Util } = require(discord.js)
^
ReferenceError: discord is not defined
at Object.<anonymous> (/home/juliefilm/Music_Bot/commands/play.js:2:26)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Module.require (internal/modules/cjs/loader.js:1019:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (/home/juliefilm/Music_Bot/music_bot.js:26:21)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
and in my top part
const { Util } = require(discord.js)
const { YOUTUBE_API_KEY } = require("../config.json")
const ytdl = require("ytdl-core")
const YoutubeAPI = require("simple=youtube-api")
const youtube = new YoutubeAPI(YOUTUBE_API_KEY)
const { play } = require("../system/music")
erm
um
you have strings everywhere between your require
but you can't put one on this one
are you blind or smth
H m
wrap discord.js in apostrophes
and you don't need the first line
Has anyone a idea how go through a Mongo Database Collection and log that or sth?
Javascript
For each is not a Function
yes it was the apostrophes i am very stupid
I tried foreach and it says its not a function
forEach?
(node:8828) UnhandledPromiseRejectionWarning: TypeError: queue.forEach is not a function
schema.forEach(s => console.log(s.<property>))
is photo-collage not supported or what ?
If you use find to to fetch the records then you can use the callback to do forEach I believe
@sterile minnow why are you using mongodb to hold your music queue?
I dont?
Oh
If you use find to to fetch the records then you can use the callback to do forEach I believe
@fast zenith yes in error something like callback
What's the queue?
A Queue for Bots
Oh
I'm staff in a Bot list
idk how i do that lel
@restive notch
const { Util, Discord } = require('discord.js')
Hey, so I have a discord bot. I have transferred files to vps but I want it to run 24/7
Can I have some help please.
download pm2
@sterile minnow schema.map(s => s.timeStamp)
Works the Best
npm i pm2
me?
pm2 start index.js
What is pm2?
yes
a process manager
I am py..
😦
in cmd?
putty
I suggest going through this https://www.npmjs.com/package/pm2
queue.map is not a function
Yes I have putty
@sterile minnow show the def of queue
const queue = this.client.mongo.db("main").collection("queue")
I'm just developing lel
Acess Denied wtf
i didnt do that
Did you copy and paste code?
Ok I am in
Does it actually write to your dB??
Show me your mongodb connection
const MongoClient = require('mongodb').MongoClient;
const client = new MongoClient('mongodb://ip:port', { useUnifiedTopology: true });
client.connect(async function(err) {
const db = client.db('mydb');
const _mycoll = db.collection('mycoll');
})
npm i pm2
Yee thats how it works
Eyy I'm in the ss
Like hiteke said thats how i access it
Also why not use mongoose it's so much easier (idk mongodb sorry)
I'm just a dev i didnt do that shit
//MongoDB
var data = await _mycoll.find({'id': msg.author.id}).toArray(); data = data[0];
Isn't mongodb not async?
and how do i like do without find like list everything
Promise
Map it from the schema
Why is it saying not found when I have done apt install npm like 100 times
not supported photo-collage ?
Please don't use heroku
I know any free host?
Dm me
- Run the code on your computer
- Add packages
Can't
@viral iris I can host your bot if you want
Cuz I have problem with package.json it tells me that it should be JSON file no js and it's already json
Check dm
@viral iris I can host your bot if you want
@void vale where?
if the bot is small you can just use AWS with their free tier
@viral iris check your dms
Sounds like something we don't encourage
👀
No
this.client.mongo.db("main").collection("queue").find({}).toArray(function(err, docs) {
assert.equal(err, null);
try{
docs.forEach(bot =>{
try{
num++
let testing = bot.tester
? `**Currently Tested By:** <@${bot.tester}>`
: `**Currently not being tested. [Click Here]() to start testing.**`;
embed.addField(`${num}. (${bot.name})[${bot.id}}]`,`Owned by: <@${bot.owner}>\n${testing}`)
}catch(err){
console.log(err)
}
})
}catch(err){
console.log(err)
}
});
Has anyone a idea why it doesnt add a Field?
(if i log it it works tho)
I did
he did
to make it JS format
it is already
On phone its not visible
Don't see how it's supposed to work when you haven't even tried sending the message and the embed isn't defined? or is that elsewhere?
yes
there is no Embed Constructor
Don't see how it's supposed to work when you haven't even tried sending the message and the embed isn't defined? or is that elsewhere?
@fast zenith The embed is Defined and it sends it
you don't happen to get any errors when it doesn't send?
i would laught if he makes a bot for a other Botlist website
What's the problem?
Im trying to make sure my bot runs 24/7
I have transffered files
and got putty open
install python on the vps
sudo apt install nodejs (assuming you were trying to install pm2 from before)
npm install pm2
you can use that or use a service etc
So it sends the embed it just doesnt add Fields and doesnt give me a error but if i try to Log it it works completely fine
npm not found
install nodejs
pm2 doesnt work with py i think
no it doesnt
It does
where are you getting the vps @earnest phoenix
galaxy gate
how would I download it to the vps?
and if you are trying to use different language scripts you will need to use the --interpreter python3 param e.g for python
@quartz kindle he uses python
how would I download it to the vps?
@earnest phoenix npm install -g pm2
best way is to install nvm, then install node
then you can install pm2
and then you can run your python script with pm2
yes ofc
you can install nvm using wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
then run nvm install node
then run npm install -g pm2
after you install nvm you need to either run source ~/.nvm/nvm.sh or restart the ssh session otherwise it will say nvm doesn't exist 🙂
sudo apt-get install npm
npm install pm2@latest -g
pm2 start app.py --watch
yes but apt repos are usually outdated for node and npm
for example ubuntu 18 is still on node 8
i install usually straight from node.js site (on my ubuntu)
depends on the distro & os version as each have there own repos, Ubuntu 18 which is still widely used installed 8.0 and as of right now and 14.6 is the most recent stable version.
are you using the official repository for apt?
deb http://archive.ubuntu.com/ubuntu bionic main
deb http://archive.ubuntu.com/ubuntu bionic-security main
deb http://archive.ubuntu.com/ubuntu bionic-updates main
deb http://us.archive.ubuntu.com/ubuntu saucy main universe
deb [arch=amd64] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse
https://packages.ubuntu.com/bionic/nodejs (18.04/18.10 both only goto NodeJS 8.10)
https://packages.ubuntu.com/groovy/nodejs (the new 20.10 release planned for Octobers Repo only goes to NodeJS 10.19)
nvm is the easiest way to update to the latest or even the LTS release.
guys you have any clue about how to fetch message by id? in js
@earnest phoenix
var x = await msg.channel.messages.fetch('id');
console.log(x);
ok
nvm ty
what can i use to play spotify songs with shoukaku
oof
Who needs help with discord.js?
did someone know what permission is needed for deleting messages?
manage_messages
thx
Anyone know deno here?
yes
i know what deno is
https://deno.land/ @void vale
like node
but not node
made by the same guy though
thx
anyone know the code to make the bot edit a voice channel name ?
check docs
docs ?
....
we dont spoonfeed here
lol you say docs like i know what your talking about
get a channel and change the name
what lib are you using
js or py?
we can redirect you to the right docs
ok I think I finally did it
@earnest phoenix you need to install discord
i did
what lib do you use @golden bear
You mean
Js
but what lib
discord.js
assuming discord.js
btw you should learn js before making bots
guessing by your confusion you havent used it before
They first do, and then teach, and then do
btw @golden bear how old are you?
yes
never knew it to be so hard to make a bot update a channel name every time to bot joins a server it displays how many servers its in
@honest perch 13
@earnest phoenix easy
but I did
dont seem like it i can do text channels but i want it to be voice
does anyone know how i can install a linter for deno
https://cdn.discordapp.com/attachments/733651993205145610/737637402834894908/unknown.png
@earnest phoenix
trypython -m pip install -U discord.py
Also make sure its installed on the python version that you're using, not another
do python --version
in my bot I use, and it works
import discord
Heya.
Its my first time using mongo db! so dont judge
But does anyone know how i set sth in the db?
i'm using this npm package https://www.npmjs.com/package/mongodb
But i dont really understand the docs lel
f.e.
Name from "John" to "John wick"
Like i said i dont really understand the Guide. I want to know how i f.e. set user.name from "John" to "Tom"
ok
The thing is idk how to use .updateOne
collection.updateOne({ 'user.name' : "John" }, { $set: { 'user.name' : "Tom" }})
f.e. i have found one user and i want to update him is user.updateOne still aviable to use?
I don't understand English very well
What language do you speak?
I can try to translate it
now it says thst
@earnest phoenix Async is not a valid syntax
u set it wrong i think
u can use Schema.updateOne too
Okay ty
const model = whatever
const something = await model.findOne({ key: 'value' });
something.updateOne({ key: 'value2' });
@sterile minnow ^
ty i will try it
.updateOne is not a function
show ur code
code
Okay
Thats defined i just send it to you with <model>
const MongoClient = require('mongodb').MongoClient;
const client = new MongoClient('mongodb://', { useUnifiedTopology: true });
client.connect(async function(err) {
const db = client.db('db_name');
const model = db.collection('collection_name');
const something = await model.findOne({ key: 'value' });
something.updateOne({key : 'value2'})
})
Still not a function
full code
if I code js, should I use single or double quote
let user = await this.client.mongo.db("main").collection("users").findOne({id: userID})
user.updateOne({certification:"false"}, {certification : "true"})
i tried it with quotes too
Show all the code
Send it to me in DM
Thats all
You didn't connect the database
It is connected
It is connected
my god friend sorted it for me
it gets info etc it just doesnt set it
@sterile minnow Are you using the discord.js in the code?
yes
const client = new Discord.Client();
??
why use db when you have json
ew JSON is slow af
const client = new Discord.Client();??
@void vale I'm coding the commands etc in different files
I just wanna know why the Bot says that
JSON isnt a database
technically is, but just not a good one*
it can only do one operation at a time, it corrupts easily and its slow
so is a txt. file

JSON is just a thing to like store token or sth but not thousands of Users
its not even the thousands of users
if you issue 2 operations simultaneously, good luck recovering your corrupted shit
(node:5920) UnhandledPromiseRejectionWarning: TypeError: client.guilds.get is no
t a function
read docs
I understand why it doesn't work, I have the v12
😆
I checked the code for v11, and I have v12
for v12
client.guilds.cache.get('id')
How can you detect when someone upvotes your bot?
I wanna give ppl reward of some komd
Kind
"official" not really
Spice up your Discord experience with our diverse range of Discord bots
the official one is dblabi.js
no
what
I don't know why it doesn't work for you. You're doing something wrong
require("./util/eventLoader")(client);
client.login(ayarlar.token);
client.commands = new Discord.Collection();
client.aliases = new Discord.Collection();
fs.readdir("./komutlar/", (err, files) => {
if (err) console.error(err);
log(`${files.length} komut yüklenecek.`);
files.forEach(f => {
let props = require(`./komutlar/${f}`);
log(`Yüklenen komut: ${props.help.name}`);
client.commands.set(props.help.name, props);
props.conf.aliases.forEach(alias => {
client.aliases.set(alias, props.help.name);
});
});
});
what the fuck
what
where is your discord?
where you requiring discord?
where is your new client instance?
wtf

where’s your error
I don't know why it doesn't work for you. You're doing something wrong
@void vale i just copied ur code and changed it for me and the error comes stillsomething.updateOne is not a function
require("./util/eventLoader")(client); client.login(ayarlar.token); client.commands = new Discord.Collection(); client.aliases = new Discord.Collection(); fs.readdir("./komutlar/", (err, files) => { if (err) console.error(err); log(`${files.length} komut yüklenecek.`); files.forEach(f => { let props = require(`./komutlar/${f}`); log(`Yüklenen komut: ${props.help.name}`); client.commands.set(props.help.name, props); props.conf.aliases.forEach(alias => { client.aliases.set(alias, props.help.name); }); }); });
@wide sundial in these lines
nor the plate or the table
who do you mean jeremy lel
wheres the rest of the code?
but we can’t help you without the bread (the error) and the table/plate (the full code)
you are calling Discord but you arent importing it
that code is incomplete or if its all you got, you are missing quite a few bits
UnhandledPromiseRejectionWarning: AbortError: The user aborted a request.
any idea what can cause this?
bad internet
@sterile minnow mongoose or mongodb?
MongoDB
no, i use sublime
define funky?
My debugger after i ported to Typescript somehow is logging my objects and responses as Raw view instead of the object explorer.
The way its usually displayed is like the following:
https://cdn.
what is your query?
@lusty quest i search for a User with a id (i got that user and it can display the information) and i want to set "developer" from false to true but it errors
(node:4116) UnhandledPromiseRejectionWarning: TypeError: something.updateOne is not a function
with this
with query i mean your code
const MongoClient = require('mongodb').MongoClient;
const client = new MongoClient('mongodb://', { useUnifiedTopology: true });
client.connect(async function(err) {
const db = client.db('db_name');
const collection = db.collection('collection_name');
collection.updateOne({ 'a' : 2 }, { $set: { 'b' : 1 } })
})
It works
with query i mean your code
@lusty questjs const db = this.client.mongo.db('main'); const model = db.collection('users'); const something = await model.findOne({ id: userID }); something.updateOne({dev : 'false'}, {$set: {dev : "true"}})
const MongoClient = require('mongodb').MongoClient;
const client = new MongoClient('mongodb://', { useUnifiedTopology: true });
client.connect(async function(err) {
const db = client.db('db_name');
const collection = db.collection('collection_name');
collection.updateOne({ 'a' : 2 }, { $set: { 'b' : 1 } })
})
@void vale it doesnt i tried that too
i tried everything
something.updateOne({'dev' : 'false'}, {$set: {'dev' : "true"}})
This is update 1 record, not all
You forgot ' '
I will try
pls
help me guys
no error
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
my code
and what doesn't work?
Its the same thing
What is wrong
something is document. You can't update it with updateOne
it gives no responde
just use updateOne
hi i'm trying to develop my bot at discord.py library and I want to embed mutiple images in discord.Embed function but embed.set_image() allows to insert only 1 image. how can i do this?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
help me guys
discord.js
google command won't work
no response
no error
no error
in console
@summer torrent (node:2296) UnhandledPromiseRejectionWarning: TypeError: something.findOneAndUpdate is not a function
i literally tried that 10 times
@rustic pewter you can't. Multiple images are not supported
It says its not a function
@sterile minnow js const something = await model.findOne({ id: userID }); something.updateOne({dev : 'false'}, {$set: {dev : "true"}})
this is wrong. findOneAndUpdate allows you to find document and update it.
'something' must be a collection
@summer torrent right, appreciate your help
const something = db.collection('collection_name');
collection.updateOne({ 'id' : userID }, { $set: { 'dev' : true } })
help me
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
@delicate shore show error
will try
no error
i wanna say that
@delicate shore show error
@summer torrent NO ERROR
i had named my bot
poketwo
it just does not responds
pls help me
@carmine trench ?
Now it works

anyone know how those web dashboards are made for mee6/yagpdb?
html css
How those two work specifically I dont know.
How oauth and backend generally work, sure
I finally figured out hosting and dont use a stupid free one now 🙂
I finally figured out hosting and dont use a stupid free one now 🙂
@earnest phoenix repl.it: shut up i am the best free one
Seriously
50+ languages
aws
Fast AF
aws
if ur code is bumpy
repl will automatically shut down even with a uptime robot
afterall uptime robot only pings it for 1 sec
Hi, I am making a website, and I want to make it so when I send an endpoint like this (with express) https://cxllm.me/memes/fucking, it shows up with the image/video. Is there any way to do this?
This is my current code:
import { Request, Response } from "express"
import { resolve } from "path";
export = {
endpoint: "/memes/fucking",
method: "get",
run: async (req: Request, res: Response) => {
res.sendFile(resolve(`Images/welcome-to-fucking.mp4`))
}
}```
is the correct content type being sent in the response?
Yes, it sends the video (if u open the link u will see)
in the headers tho
O
seems fine. is this not what you want?
He wants an embed
o
Not necessarily, I just wanted it to show up on discord like an is-inside.me
https://oliy.is-just-a.dev/fucking.mp4 like mine should work
if your internet is fast enough
Should I put .mp4 at the end?
welcome to fucking
Yea
idk how it would work with that, I upload mine directly to a folder and my webserver just serves anything in the folder
why is this in development
ah yes
your backend borked ¯_(ツ)_/¯
can someone tell me what to do if i want my bot that it replies on mention
Regex it, or check if its in message.mentions
var member = msg.mentions.members.first();
if (member.user.id != client.user.id) return;
//or
if (!msg.content.includes(client.user.id)) return;
uNcAuGhT TyPeErRoR: cAnNoT ReAd pRoPeRtY 'iD' oF UnDeFiNeD
?
if (!member || member.user.id != client.user.id) return;
where do you get 'member' ?
I remembered
It doesn't work when you mention a bot
use it
if (!msg.content.includes(client.user.id)) return;
just check if there's no mention before getting the first mentioned member id
The problem is member may not exist
Heroku likly tells you how
How would I capitalise the first letter of a word of a user input when making an embed using discord.py? The normal method of putting .capitalize() isn't working. https://prnt.sc/tpyrm1
I want the choice part to be capitalised.
how are you using .capitalize()
apparently that is incorrect f-string syntax
it should be {choice.capitalize()}?
I'll try
heya, what sort of library/thing do you use to be able to 'search' things from other sites? like how mee6 has the urban dictionary search
It uses the official API
ah, so are there official apis for most sites like that?
yes
okay, cool!
they may or may not be publicly documented, so you have to do your research
yeah
and what’s code
not code
we can’t help
Im only getting this error
then
so it runs with magic
magic bot
uhhh.
how do you get an error from nothing
idk
glitch system is erroring
it could just be glitch being shite but
I how to restart my bot?
ok
do you pay for glitch?
pls say no
Im not buy glitch premium
It's freemium
lol
What code is erroring
install sqlite3
So apparently this bot https://top.gg/bot/666792286348247040 has been taken offline.
The creator of the bot was gracious enough to share the github code with me though. So I have 2 options, fine a free shell (this bot also requires SQL) to host the bot or find another bot on top.gg that has a similar function.
"It also creates #network-userchat, where users can send messages to users on other servers on the same network(No commands are necessary to send messages just type freely in this channel) - essentially just a broadcast but on a userlevel"
Here's the github: https://github.com/Meschdog18/disnet
Any suggestions?
so you want to relay stuff between discord servers?
How to get invite link from another server with eval command?
Interesting concept
@lusty quest yes, the telephone mechanic doesn't really do the job because you have to manually initiate the connection, and the application of it seems a little...weird.
well its a opt in thing
@earnest phoenix webpanel?
If I'm reading the TOS right, do I need to have a user optin before I can do anything regarding data around them?
depends on what data. userIDs should be fine in a limited space but for more they need to opt in
I have a bot that for every message sent, it uses ML it predict if that msg was nice or rude, and updates a running count (int) associated with that user
But doesn't save the msg
should be fine
Really?
messages are you allowed to save for at max 30 days
you dont store the massage you process it
What data would you need an opt in for?
if you permanently store stuff like usernames, Email Adresses
I make a user's niceness queriable via @mention or username#discriminator
is saving guild id allowed
with a mention you still get the id
Right
So Id's I can save (for referencing user specific data), but I need an opt in for their Username?
ids are usually fine. wrote in my Apply for Certification that i store useriD and look at my profile
i would make a Opt in for this
like a command that adds the missing data to the user profile
I did, otherwise it would be passively keeping niceness levels for everyone
and update every message sent in the guild
lol
would still make it a 2 step thing. like you run the command and the Bot asks you if you want that the bot stores following stuff about you: stuff you want to store
then the user needs to answer with yes or no
this is just for going 200% sure its save
or use a Embed and reactions
Well it would say no user record stored. and the optin cmd would generate a profile. For every new message it checks first if you have an existing profile (only created via optin)
Is there a bump feature/command for the 'Discord Server List' bot ?
My original question was:
Do I need an Opt in for this data to be stored:
This is exactly what is stored for a user?
//Identifiers ulong Author.Id // Discord user's ID string Author.Username // Discord user's username; ex: Auger#8261 string Author.Mention // <@!DiscordID> // Bot-generated data double Niceness // RunningTotal divided by TotalCount int TotalCount // Amount of messages a user has sent since opting-in int RunningTotal // The Machine Learning's prediction for a message (+1 nice, -1 rude)
it just relays the Server infos to the DBL page
if you want to get more users look into auctions on DBL
userid should be fine without Opt In
otherwise you could not make Warning Commands etc
Does anyone know of a bot that:
I can select a role,
Then select roles that that role can:
!add @earnest phoenix generalchat
or something?
iirc tatsumaki, Mee6 and Dyno can do this
and ALOT of other bots can too ^
@faint prism also make some TOS they are now needed
i have on my Larger Bots a command for this. it sends the user a DM with the TOS and what data is stored for the user
My bot's help includes this currently:
Description and Data Collected
When a user opts in, the bot will begin passively consuming/deriving data from (NOT KEEPING) any new messages posted by this user. Messages are interpreted by a Machine Learning model that determines if the message is nice or rude. It will then (if it has not already) generate a user record with the following data:
Message Author's Id, Username, Discriminator, Mention, a Running Total (1 for nice message, -1 rude message), A Total Count of messages from that user, and finally a Niceness percentage (updated each new message from user)
That's good
I have an opt out, that deletes the record (and w/o it, no new info will be added until opt in)
sounds good
It's funny, the most used command is its command to test a message directly against the ML model to see how nice or rude it is.
Which doesn't save anything at all or require opting in
you dont store anything so its save
Mhmm
want to get into ML. have a Idea for a bot but this will probably kill me in the process to teach / program
I need to build an opt in system.
I've just been distracted with other parts of the bot
@lusty quest
https://dotnet.microsoft.com/learn/ml-dotnet/
Free courses, tutorials, videos, and more about machine learning. Learn general concepts of machine learning and how to implement them in .NET using ML.NET.
This is what I used
nice learning a new language and ML at the same time. So much fun
i dont even know java
😛
but some Lua, Js, GO, and py
@lusty quest @restive furnace they can't allow
for e.g.
Allow:
Flame Guild Leader
To:
!role add @earnest phoenix Flame Guild
that's what im trying to find,
I don't want mods on my server but bots have admin perms so if the user can use the command they can bypass being able to do things they shouldn't be able to
sorry for ping
responding to you both


