#development
1 messages · Page 754 of 1
thought so
yeah, but in theory the propriety .url should at least return something, but the message is empty
no it shouldn't
what
wait let me try something
learn the language basics before working with it 😩
you're right, i'm learning on-the-go
not good
learn the language to the point you know an array doesn't have the properties of what it holds lol
wrong emoji xD
the squid points
how would I be able to get the average color of an image file in a hex value
I have already managed to get my avatar url and write it as an image file then getting the average color in an rgba array
but would need to convert the 4 values into hex
and the array is not iterable
you already have 4 rgba values and you just need to convert them to hex?
); } }); gives an unexpected error even though it worked fine for 5days
what
ik.
wdym @placid arrow
like
You need to give more of the code
they're all the same ID
Nobody in the world can know whats wrong from that
var mcCommand = '/minecraft'; // Command for triggering
var mcIP = 'mc.hypixel.net'; // Your MC server IP or hostname address
var mcPort = 25565; // Your MC server port (25565 is the default)
exports.run = (client, message, args, body) => {
client.on('message', message => {
if (message.content === mcCommand) {
var url = 'http://mcapi.us/server/status?ip=' + mcIP + '&port=' + mcPort;
if(err) {
console.log(err);
return message.reply('MINECRAFT | Error receving info from hypixel. Please try again later.');
}
body = JSON.parse(body);
if(body.online) {
return message.reply('MINECRAFT | Hypixel is online, look below for more.');
if(body.players.now) {
return message.reply( 'MINECRAFT |' + body.players.now + '** people are playing right now.');
} else {
return message.reply('MINECRAFT | None is playing the server.')
}
message.reply(status);
);
}
});```
pls use ```
there.
so are you using mineflayer?
that code is all kinds of fucked up
^

Anyone know a link of official lavalink docs? I couldn't find it
yeah one sec
are you making your own custom lib or are you using a premade lib?
for ll
lib?
djs
no for lavalink
are you using one of these?
well im confused as fuck rn
I am too
lavalink isn't a library on it's own
yes thx
https://github.com/Deivu/Shoukaku is more maintained

Shoukaku looks 10x better
^
because it is
ngl
I use Shoukaku myself and it works perfectly
my smol neko brain cant think
remember the most important part of the lib Very cute and reliable Shipgirl ❤️ (Important)
yes
Anyways
Has anyone here packaged python shit on nixos
I would like to use https://github.com/vn-ki/anime-downloader
but python kinda like
sucks
in this case on nixos
Ree python is fine
python is pretty eww
rust is so much easier to package that's why im tempted to just rewrite it in rust
well js is too
I feel more comfortable with rust right now
that's why I said rust in the first place
Can you build Rust for WebAssembly iirc
yes
Thats why im semi interested in rust
wasm is nasty
"Request to use token, but token was unavailable to the client."
in what way woudl this be causes
caused
some ideas for djs miscellaneous commands
command idea generator
a sentient AI
activity, avatar, emotes, membercount, roleinfo, say, serverinfo, userinfo, calculator, dictionary, embed, lmgtfy, translate, weather...
Gj
At this point; most unique things come from custom games.
Spamming messages commanf
How to abuse API 101.
Go make a love wheel, or fortune teller command.
Always shit
Doesn't asking someone for a unique command completely defeats the definition of unique
Yus
^^
Is it allowed to do an automatic discord carry forward with a bot?
(For dm ads)
What?
what
what
Go sit on a park bench and hope for random inspiration from an old folk, dog, or screaming kid with parents wanting to shoot themselves in the head.
Wdym automatic discor report
no
as people could just do it themselves
That's just modmail
Make an advice command that gives you random advice.
lol
It's actually a massive pain Todo that tbh
Discord should implement a function for report with bot
Made one before
Or go for the NSFW side of things and make thousands of commands for each kink.
¯_(ツ)_/¯
make something SFW, almost no one does that 😛
So it's the same thing
@earnest phoenix then it will just be abused
Have a baby yoda picture get posted every 30 seconds.
great IDEA
Apart from API abuse if it's global
It's timed boiiiiii
@earnest phoenix no just for report self-bot, raid, dm ads
well you can do that yourself, oh i might have misread
your talking about reporting to discord staff?
or ?
Yes
yeah you can do that yourself lol
But discord is long for answer x)
well no one can be that lazy to type in a report if they really want to
A command that when you type unique it responds back "Please give me a unique command idea"
make a command that totally copies another bot's command lists then pastes it into your channel
A command that reassures you that life will get better and keeps you moving forward for an extra hour, day, month, or year.
a command that automatically types your school essays for you
steals random lines from wikipedia articles or old student articles published on essay writing websites
purpose specific bots > command ideas
Sure, but every bot developer's bot is like an instagram "model/influencer" now and will show you extra booty for the 100k upvote boost.
every grrr
What
100k upvotes for @gilded plank and Oliy will show you his booty 
you wish
@prime cliff if that happends i sell my soul to him
1
= 1k 
uwu
How does my websites new landing page look like?
https://stonks.pro/
is it ok from bot devs to investigate if some user is deliberately abusing bugs in a bot to get it ratelimited/api banned? because i see a very huge spike in "missing permission" errors from commands
@compact oriole why put it in a spoiler
So it wont have the embed
@steel tinsel ehh i mean what I do is either fr the person doing it or just leave the server
@compact oriole <https://link.here>
removes the embed
or properly handle your errors and have command cooldowns
oh ok
I would rephrase Data loss is almost done as data is saved in multiple locations. because saying "data loss is almost done" sounds weird
@loud salmon do you mean "make the bot leave the server"? because someone is spamming the help command at high speed from what i see in my error log
yea make the bot leave the server
or just blacklist the person doing it
and if they keep doing it i just write a quick and dirty blacklist function that leaves the server automatically if it joins it
i've got that feature implemented
oh nice
then use it :P
from the speed of the spam i think there's a selfbot involved
or C+P
sad
is coding your own bot better than using stean discord bot creator
do you have command cooldowns?
yes - check for permission that are required for the command to successfully execute first, if spam is persistent blacklist
no - your fault for allowing such a dumb exploit
@west scroll yes coding it yourself is better if you want it do anything unique or apply it to be added here
ok thanks this might be a dumb question is their a good language as in is their a specific langauge that it should be programmed in
not rlly
python and js are probs the two most popular
but you can do c# cpp etc...
any language works; langs are just to make stuff easier like libraries
like there is a long, long, long list
any language that supports websockets basically
ok thanks never met any one that dosent take the mick
hmm?
normally i just get laughed at lol
oof
an oauth access token
you have to go through the oauth2 process
k
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
tldr: user on your website gets redirected to discord authorization, after being authorizied they get sent back to your website with a code you can exchange for an access token
ah ok
if you know what you're doing an implementation isnt really hard
so basically
theres a nice example guide written by someone that shows how to get the access token and make requests
i can send it to you
@split hazel can i have that guide too
this is one of the best ones https://medium.com/@orels1/using-discord-oauth2-a-simple-guide-and-an-example-nodejs-app-71a9e032770
Don't take it word for word though, use it as an example
ctrl c, ctrl v, got it
It helped me massively while making my own implementation for users to login via discord
this guide is 2 years old, is it still relevant or are there major changes since then?
that guide is pretty much the first result
whats wrong w this 0auth2 https://discordapp.com/login?redirect_to=%2Foauth2%2Fauthorize%3Fresponse_type%3Dcode%26redirect_uri%3Dhttp%253A%252F%252Fredi%252Fcallback%26scope%3Didentify%2520guilds%26client_id%3D362241614770339841
it is lmao but its very useful
and while it's still outdated, it lays down the general premise of how to do it
it got me started as well around a year ago
but you can't rely on that example, obv research is necessary beyond the guide
everything on there still works, i used that guide as a base on everything a couple weeks ago and it works great
but i didnt copy it word for word
that msg what i sent above is generated by passport-discord module
if you want to do what you want to do you need to do alot of your own work
this is mostly a guide on how to exchange the token
and shows how to make a sample request, eg get user details
lmao it got me started with using https://jwt.io
bueno way to authenticate along with discord tokens
you store the discord token in the payload, then sign and store on the client
every request to the server verifies the token
can any one help with this error : when i Try and import discord i get this error
Traceback (most recent call last):
File "/home/joe/rbot/rbot.py", line 2, in <module>
import discord
File "/usr/local/lib/python3.6/dist-packages/discord/init.py", line 20, in <module>
from .client import Client, AppInfo, ChannelPermissions
File "/usr/local/lib/python3.6/dist-packages/discord/client.py", line 42, in <module>
from .voice_client import VoiceClient
File "/usr/local/lib/python3.6/dist-packages/discord/voice_client.py", line 65, in <module>
from .gateway import *
File "/usr/local/lib/python3.6/dist-packages/discord/gateway.py", line 30, in <module>
import aiohttp
File "/usr/local/lib/python3.6/dist-packages/aiohttp/init.py", line 4, in <module>
import multidict # noqa
ModuleNotFoundError: No module named 'multidict'
the only thing i have imported is discord tho
look at the traceback error line 2 module discord
do i just need to pip install it
yh but its having an issue with Aiohttp which is having an issue with multidict
what did u do to install d.py
sudo python3 -m pip install discord.py
nu sudo
do pip install -u discord.py i think it is
if it doesnt work remove the -u
makes it go to latest update
i did now i have this error
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-5V2STe/aiohttp/
which is normally outdated setuptools but i have just updated them
the python idle
i got rid of that error by doing pip3
try re run the discord code
ok got it the bots online now
👍
the bot works
if i want a change prefix command would the code look like this
if message.content.startswith(prefix,'help'):
msg = 'Hello {0.author.mention}'.format(message)
await message.channel.send(msg)
where prefix is a variable that is set by the user
@stuck phoenix is this if the bot got pinged? js if(message.content === "@stuck phoenix") { console.log(`[CMD - bot_ping] ${message.author.tag} (${message.author.id})`) const regularhelp = new Discord.RichEmbed() .setTitle('Prefix: ' + botConfigs.prefix) .setDescription('Oh Hi! You forgot my prefix? \nHere it is! ' + botConfigs.prefix) }
without "1"
!*
@stuck phoenix
y
uhh, did you try it?
! triggers if the bot has a nickname set
you never told it to send a message
ik
that will work if the ping is the only thing in the message
if the message has more text besides the ping, it wont work
package-lock.json
package.json
Please commit your changes or stash them before you merge.
Aborting```
So I might be dumb, but i dont know what this means and ive tried googling it and found nothing. I havent even changed these files and its not letting me git pull on my host
no, check both
just @stuck phoenix ?
Also, when I do
m!eval let guild = client.guilds.get('623600255987875870'); guild.members.get('487322936529911846').user.tag it returns cannot read property user of undefined, yet when I use my ID (That is my tester) it works perfectly. Is this a discord issue?
wait tim
why is ! required if theres text in the message lmao
i think regardless of content it's part of a bot mention
i want it to respond if the bot got pinged
just like this
@stuck phoenix
no something like
hihihihi @stuck phoenix
or
@stuck phoenix ihihihihi
just check if the first part of the message
do you want it to count as a mention
you use both
check for both i guess
just check for both
lol i only check for <@! since i assume discord is gonna update mobile with it soon
but honestly your choice
Just ping if anyone has an idea to my problem
@ember atlas you're trying to pull from your repo with conflicting states in package.json and package-lock.json
if you're using a dependency manager, that might be why
uh i dont think i do
@valid frigate i want it to count as mention
How do I use a local image in embed
what language and library
js
@surreal sage check for <@mention> and <@!mention>
????
@valid frigate pulling a shit ton of local code
just adding it so i can pull and start hosting it again
pulling from a remote repo?
remote repo?
like github
oh wait i know why
your package.json and package-lock.json are not committed maybe?
code?
so both <\@636812729222692880> and <\@!636812729222692880> didnt work
ignore the \ lul
y
if(message.content.startsWith("@stuck phoenix")) {
console.log(`[CMD - bot_ping] ${message.author.tag} (${message.author.id})`)
const arp = new Discord.RichEmbed()
.setTitle('Prefix: ' + botConfigs.prefix)
.setDescription('Oh Hi! You forgot my prefix? \nHere it is! ' + botConfigs.prefix)
.setColor('#ff1493')
.setAuthor('Axyx')
message.channel.send(arp)
}
if(message.content.startsWith("@stuck phoenix")) {
console.log(`[CMD - bot_ping] ${message.author.tag} (${message.author.id})`)
const arp = new Discord.RichEmbed()
.setTitle('Prefix: ' + botConfigs.prefix)
.setDescription('Oh Hi! You forgot my prefix? \nHere it is! ' + botConfigs.prefix)
.setColor('#ff1493')
.setAuthor('Axyx')
message.channel.send(arp)
}```
no errors
bruh
did you just
@surreal sage does not work
lmao there are 2 of the exact same code blocks in your code
there is no error
@surreal sage SyntaxError: Invalid or unexpected token
i mean if i were you id use a or comparison in your if condition
discord.js
@valid frigate its all commited
odd
Check if that code is actually being executed
Good chance you have some kind of return; somewhere if there's no prefix or anything
boss do you want to overwrite local changes
mentions(client.user) or so?
https://stackoverflow.com/questions/14318234/how-do-i-ignore-an-error-on-git-pull-about-my-local-changes-would-be-overwritt maybe this might help you
const rUser = message.mentions.users.first();
or something like this
the second one
ok

lmaoooo
or something
theres a nice thing called || or the or comparison
@valid frigate What do you mean?
|| <- this is or
yes
if (command === "1" || command === "2")
it just seems unclear what youre trying to do @ember atlas
I add changes to repo -> git pull and start it up on my host
oh i see
so you have a repo set up on your vps, and are pulling from github
local repo*
see
@valid frigate Technically yes
i want to buy the domain
ah ok
but
so you're overwriting all local changes on your vps
http://tryitandseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.ee
stop
I just clone the repo on my vps so the files go there when I git pull
i want to buy that domain
Then start it up
But this time its talking about these damn package lock changes that never happened
hmmm
i mean if you're sure that your vps repo is supposed to be overwritten with everything from the remote repo
the top answer from that so post says
If you want remove all local changes from your working copy, simply stash them:
git stash save --keep-index
If you don't need them anymore, you now can drop that stash:
git stash drop
Whats this "remote repo" you keep speaking of?
github
if(message.isMemberMentioned(client.user.id)) {
console.log(`[CMD - bot_ping] ${message.author.tag} (${message.author.id})`)
const arp = new Discord.RichEmbed()
.setTitle('Prefix: ' + botConfigs.prefix)
.setDescription('Oh Hi! You forgot my prefix? \nHere it is! ' + botConfigs.prefix)
.setColor('#ff1493')
.setAuthor('Axyx')
message.channel.send(arp)
}``` event does not happen if i ping the bot
bruh
or do i have to use client.user ?
you need a user class
message.isMentioned(client.users.get(client.user.id))``` ???
or client?
so this is what you're doing so far afaik
- you pushed changes from your device onto github, the remote repository
- you're logged into your vps and want to pull changes from github, but you're getting errors about files being overwritten
1 thing: does it work
yes vysion
mk
if(message.isMemberMentioned(client.user.id)) {
console.log(`[CMD - bot_ping] ${message.author.tag} (${message.author.id})`)
const arp = new Discord.RichEmbed()
.setTitle('Prefix: ' + botConfigs.prefix)
.setDescription('Oh Hi! You forgot my prefix? \nHere it is! ' + botConfigs.prefix)
.setColor('#ff1493')
.setAuthor('Axyx')
message.channel.send(arp)
}``` this?
dude
No
it didnt
Before that
if(message.content.startsWith("@stuck phoenix")) {
console.log(`[CMD - bot_ping] ${message.author.tag} (${message.author.id})`)
const arp = new Discord.RichEmbed()
.setTitle('Prefix: ' + botConfigs.prefix)
.setDescription('Oh Hi! You forgot my prefix? \nHere it is! ' + botConfigs.prefix)
.setColor('#ff1493')
.setAuthor('Axyx')
message.channel.send(arp)
}``` this?
with and without ! ?
@ember atlas on your vps, try git reset --hard && git pull
Yes
if you're absolutely sure you want to overwrite
it does not
also
cuz console.log does not happen
Does it not
let your bot be accepted
not the right place to ask
you need to wait for your bot to get accepted here
does not work
gonna move the script
good
@valid frigate wonderful. it commited :D
no
nice
and boss, do that every time you want to pull changes
it just fast-forwards all files to ur github's files so everything remains up to date
dont know dont care
who even counts their bot's code by SLoC
you should aim to make your bot's code clean and scalable imo
sloc isn't a bragging right
do you have a github i could look at
yes
but the pinged event does not happen
mine either but ok
what does your if statement look like atm
impossible to believe js code could be optimized
console.log(`CM-CMDS Test`)
if(message.isMemberMentioned(client.user.id)) {
console.log(`[CMD - bot_ping] ${message.author.tag} (${message.author.id})`)
const arp = new Discord.RichEmbed()
.setTitle('Prefix: ' + botConfigs.prefix)
.setDescription('Oh Hi! You forgot my prefix? \nHere it is! ' + botConfigs.prefix)
.setColor('#ff1493')
.setAuthor('Axyx')
message.channel.send(arp)``` idk what you say but this is my code
cant validate your claims
Not an id
if(message.isMemberMentioned(client.user)) {}```
@surreal sage it has been more than 10 minutes and you still havent replaced client.user.id with client.user
ooookkkkkkkk
oh there we go
But is that what you're looking for
i love take on me
Because you said you wanted it to be a mention only
That will be a mention
and whatever else will still go through
around 2 weeks
Does anyone wanna collab on a bot idea
well that was a long time ago but yeah, not too long
dbl is definitely better at queue times vs discord bots
thanks
excuse me someone could make an order "{prefix} clear @user" (I'm French)
console.log(`CM-CMDS Test`)
if(message.isMemberMentioned(client.user)) {
console.log(`[CMD - bot_ping] ${message.author.tag} (${message.author.id})`)
const arp = new Discord.RichEmbed()
.setTitle('Prefix: ' + botConfigs.prefix)
.setDescription('Oh Hi! You forgot my prefix? \nHere it is! ' + botConfigs.prefix)
.setColor('#ff1493')
.setAuthor('Axyx')
message.channel.send(arp)
}``` does not work
wait
nup
does not work
isMentioned?
hi @wicked pivot if you ask for code like that, we call that "spoonfeeding" which means just giving the answer without teaching anything
isMemberMentioned is that a custom method?
no
no
What Lang
Oh shit
@valid frigate I don't have any code like her so I'm just asking if it's possible
Didn’t know that existed
https://guide.cdeveloper.xyz/guide/user-blacklist sites like this isnt spoonfeeding
y
?
but the mention didnt happen
holy shit
@surreal sage im being brutally honest right now, i hope nobody follows that tutorial for the following reasons:
- json is not a database
give a lesson on how to setup a database first
when did i ask
console.log(`CM-CMDS Test`)
if(message.isMemberMentioned(client.user)) {
console.log(`[CMD - bot_ping] ${message.author.tag} (${message.author.id})`)
const arp = new Discord.RichEmbed()
.setTitle('Prefix: ' + botConfigs.prefix)
.setDescription('Oh Hi! You forgot my prefix? \nHere it is! ' + botConfigs.prefix)
.setColor('#ff1493')
.setAuthor('Axyx')
message.channel.send(arp)
}``` im for this ok
dude
ok are you getting CM-CMDS Test in your console
custom commands test
???
just a thing for me ok
CM-CMDS
you include the language and then line break
??
https://discordjs.guide/creating-your-bot/adding-more-commands.html#member-info-command does it better
that's not even a proper command handler
Okay so the code is not being reached @surreal sage
you're spoonfeeding them
I have a theory that message is not what you think it is
ah yes
wtf
because a djs guide would spoonfeed
theyre all about not spoonfeeding
A djs guide is not spoon feeding
that's subjective
it is yes but usually people give a decent explanation to wtf the code is doing
sometimes it is, if the answer has no explanation
anyway
There is a difference between spoon feeding and giving you an answer you were already close too
enough bickering about spoon-feeding, just dont do it
I use regex to filter args too
Simply using .split(" ") doesn't cancel out multispaces
@late hill split can take positional arguments, e.g you can tell it to split the first space only
go ahead

security concerns
Yes
can someone read over my docs real quick as well while we are doing this https://ene.vysion.cc/guides
grammatical errors would be epic if you can spot any

Lol
So if you give it paint and it eats a specific color that’s the color your website will be
You’ll have a dead rabbit the next day
use water with food coloring
It’s still not good to give them anything out of their normal diet
And carrots are orange
Do you wanna orange website
😂
anyone have a clue or a google result for how to assign case numbers for reports, bug reports, bans, mutes, kicks, warnss for discord.js??
LUL
nah bruh you need to use a real big boy database
I haven’t seen many recommend MySQL
anything by oracle is poopoo
Use sqlite3 or something
Not MySQL
Me personally I use sequelize ( an orm) and swlite3
Sqlite3*
is there a way to do it without a database as im not ready to do a database for the bot?
learning how to use a db early on is good
Well yes
npm ERR! code EINVAL
npm ERR! EINVAL: invalid argument, read
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\eeeno\AppData\Roaming\npm-cache\_logs\2019-12-23T20_37_26_993Z-debug.log``` i get this error if i install an module
read your debug log
well i dont think a database would be needed for a bot that is just for one server?
and its bad coding practice
If you don’t know what you’re doing
this is the log
TxT file
?
Nothing xd
logging users == BAD
it is good to monitor your bots use and know spammers
not saving to files tho
They have a blacklisting command xd
I can blacklist any guild or user
Ima blacklist chill
To see if it works
its not hard to make a blacklist command lmao
copy pasta xD
I’m already having to make a bunch of classes which I’m confused about enough
I’m curious how they did it though
classes are bea
slowly but surely
That’s off topic
Classes are just blueprints for objects
class User {
constructor(guild_id, owner_id) {
this.guildID = guild_id;
this.ownerID = owner_id;
this.ships = [];
this.resources = {
iron: 0,
coal: 0,
diamond: 0,
lapis: 0,
emerald: 0,
dragonDust: 0,
darkCrystal: 0,
uranium: 0
}
}
buyShip(type) {
let cost = ship[type].requirements;
for (ore in cost) {
let formula = this.ships.length * cost[ore] + 1000;
if (this.resources[ore] < formula) return `Not enough ${ore}`
}
let ship = new ship[type];
this.ships.push(ship)
User.update({ships: this.ships}, {where: {user_id: this.ownerID, guild_id: this.guildID}})
}
}
I am trying to figure out how to save the resources to the user
Should I make a seperate method or?
save
It isn't that long though
temporarily or permanently
@earnest phoenix please take note of the pinned channel etiquette and please hold your comments unless you are actively trying to help
Are you talking to me Wesley?
Yes
The data you're saving
Which
Sequelize and Sqlite3
ok.. what is your question then
User.update({ships: this.ships}, {where: {user_id: this.ownerID, guild_id: this.guildID}})
I am wondering how to save the resources to the user
Should it be done in another method or what?
sure? I mean it's up to you. Are tou going to use the method later on as well or just for that?
Also, User is already the name of your class
Yeh
I will not be using the method later on I do not think
Was wondering if update is supposed to be a static method in your class that you have yet to implement (or didn't show in the code example)
I am updating the table
Yeah, you'd want to rename the table variable/class name
would make more sense to change the table name to users but ok
I would suggest using Player as class name
As that won't interfere with the User class that your discord library probably has
Just makes it easier to distinguish
If you want a good website https://devdocs.io/ 🤷♂️
when is my bot activated
I know
@earnest phoenix ?
For your bot on the website, juste wait
when will it be active
are you serious?
@earnest phoenix #502193464054644737
ım from turkey .d
congrats
Depends on you
const Discord = require('discord.js');
module.exports.run = async (bot, message, args) => {
if(!message.member.hasPermission("MUTE_MEMBERS"))
return message.reply("Vous avez pas les permissions pour faire cela !");
if(message.guild.roles.get("539293854776688641").members.map(g => g.memberCount < 1)) {
let embedlist = new Discord.RichEmbed()
.setTitle("Il n'y à pas de membres mute")
.setTimestamp()
.setFooter(`demande de ${message.author.username}`, message.guild.iconURL)
return message.channel.send(embedlist)
}else{
let embedlist = new Discord.RichEmbed()
.setTitle("Liste des membres mute")
.setDescription(`${message.guild.roles.get('539293854776688641').members.map(m => m.user.tag).join('\n')}`)
.setTimestamp()
.setFooter(`demande de ${message.author.username}`, message.guild.iconURL)
return message.channel.send(embedlist)
}
};
module.exports.help = {
name: "mutedlist"
};``` How can i see if they are some people muted ?
@valid frigate late reply: i was referring to the message.content === part. also, the difference between <@ and <!@ is whether or not the member has a nickname in the guild where the message came from
odd
@wicked pivot I think you're looking for <Role>.members.size
Member does not have a memberCount property
yes, unless its a static method
const { Player } = require('./path/to/class')
const newPlayer = new Player(message.guild.id, message.author.id)
newPlayer.create()
Hm
Okay
async create(){
const res = await User.findOne({where: {user_id: this.ownerID, guild_id: this.guildID}})
if(!res){
await User.create({user_id: this.ownerID, guild_id: this.guildID}).catch(err => console.log(`Error occured: ${err}`));
await User.update({resources: this.resources}, {where: {user_id: this.ownerID, guild_id: this.guildID}});
console.log("Successfully created user");
}
}
My create method isn't working for some reason
It is not returning any errors
and that is how you create a entry in the table
if(message.guild.roles.get("539293854776688641").members.map(g => g.members.size < 1))```
like this makes me a error :
`2019-12-23T21:19:11.561231+00:00 app[worker.1]: (node:4) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'size' of undefined`
its an async method, so await newPlayer.create()
other than that, console log some stuff to see if the database calls are woring
@wicked pivot you are basically doing member.members.size
g is a member in your map function
what are you trying to do?
I did await it
Yes sorry, i did a mistake this time @quartz kindle
console.log(res)
const Discord = require('discord.js');
module.exports.run = async (bot, message, args) => {
if(!message.member.hasPermission("MUTE_MEMBERS"))
return message.reply("Vous avez pas les permissions pour faire cela !");
if(message.guild.roles.get("539293854776688641").members.map(g => g.size < 1)) {
let embedlist = new Discord.RichEmbed()
.setTitle("Il n'y à pas de membres mute")
.setTimestamp()
.setFooter(`demande de ${message.author.username}`, message.guild.iconURL)
return message.channel.send(embedlist)
}else{
let embedlist = new Discord.RichEmbed()
.setTitle("Liste des membres mute")
.setDescription(`${message.guild.roles.get('539293854776688641').members.map(m => m.user.tag).join('\n')}`)
.setTimestamp()
.setFooter(`demande de ${message.author.username}`, message.guild.iconURL)
return message.channel.send(embedlist)
}
};
module.exports.help = {
name: "mutedlist"
};``` How can i see if they are some people muted ?
@quartz kindle sorry i'm french I have a hard time with English
is 539293854776688641 the muted role?
yes
okay therefore js if(message.guild.roles.get("539293854776688641").members(g => g.size < 1)) ?
How can i look if the people has a role
message.member.roles.has
the difference between <@ and <!@ is whether or not the member has a nickname in the guild where the message came from
Not anymore tim
The updated editor that displays mentions edits the mentions and sends them all as <@!
Even if no nickname
yeah but remember discord is inconsistent so it's only like that on desktop

And we all know they won't fix that issue for another X amount of time and then go and have an API death again
Discord is a stable platform TM
I swear <@! was on mobile also, not only desktop
[2019-12-23 13:52:46] [COMMAND] C:\Users\Aj\Desktop\StarGaze\commands\test.js
[2019-12-23 13:52:46] SequelizeTimeoutError: SQLITE_BUSY: database is locked
[2019-12-23 13:52:46] at Query.formatError (C:\Users\Aj\Desktop\StarGaze\node_modules\sequelize\lib\dialects\sqlite\query.js:419:16)
[2019-12-23 13:52:46] at Query._handleQueryResponse (C:\Users\Aj\Desktop\StarGaze\node_modules\sequelize\lib\dialects\sqlite\query.js:73:18)
[2019-12-23 13:52:46] at Statement.afterExecute (C:\Users\Aj\Desktop\StarGaze\node_modules\sequelize\lib\dialects\sqlite\query.js:250:31)
[2019-12-23 13:52:46] at Statement.replacement (C:\Users\Aj\Desktop\StarGaze\node_modules\sqlite3\lib\trace.js:19:31)
@late hill really? when did that happen lol
stupid discord keeps changing stuff around
I love me some more undocumented fucking changes
Xd
That's the story of discord
Think about how the Python community felt when they just pushed an update that would break the entire lib with no simple fix
XD
Oof
Also to my question
What does it mean when a database is locked and how does it become unlocked
😂
I don't mean to be an ass but this is probably a super common issue
I'm sure there are resources online
Okay
@west raptor can you help me in #topgg-api please?
Me need help with bot
for what
Okay so the fixes I found on the internet aren’t working
do you get any error on console?
I'm on mobile
@west raptor it still continues to tell me database is locked even after implementing the fixes suggested
@summer torrent not sure I'm on mobile
mobile is bad for coding
Ik
You use Termux?
You don't have access to the console..?
What are you using to host the bot
You used an app to create the bot or..?
Yea to code it
Yea
I'll link it
Did you use an app to code the bot as in an editor or an actual app that basically does the coding for you
If your telling it to run the code on your mobile
Every time you go out of console
It will go offline
Cuz most mobile apps get turned off when not in use
To save ram and CPU on mobiles
👀
Issues : https://github.com/tempage/dorynode
(please open the issue in github, not in email. we are ALL developers :)
upgrade node.js : 'download file' menu -> check 'appfiles' -> check 'executable'
v6.12.3 arm : https://dorynode.firebaseapp.com/v6.12.3_arm_release/nod...
I see from general chat that you're using botghost
oh
That in doing
Bruh
Yh that app just lets you run scripts
Yup
You're phones the one actually trying to host the bot
Oh
When your phone:
A) looses connection
B) turns off
Bot will go sleepy time
Bruh
Also if you close the app itself it will unless it's an admin task
Okay
I coded a bot on mobile 👀
Though I had it on a server that I could just use an ssh connection and sftp to
Can you link me the app you use and a vid or whatever you used to learn it
I didn’t use a video
Okay
Coding on mobile is just a bad idea in general
coding on mobile is like using a toilet bowl for your cereal bowl, yea sure its possible but thats not what its meant for
It's won't go online bim mad
well tbf his doesn't work cuz the program isn't made to be up and hosting
True
True
Also u don't need to insult the guy at getting stopped at a emulator issue
I don’t see how I insulted him
????
Dw about it
If you could kindly tell me
I cba to keep talking about this
Bruh
I didn't feel insulted
I only pointed it out cuz it came across as a bit unesserary
I ain't gonna keep arguing it
Ok
hi all
Hi spider
Hi
Hello spider
Welcome to #development




