Debugger listening on ws://127.0.0.1:36505/2f565a59-e773-41d4-91de-8b0f59576cc1
Debugger attached.
module.js:549
throw err;
^
Error: Cannot find module 'discord.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (c:\Users\darkr\Desktop\Fairy Bot\index.js:1:79)
at Module._compile (module.js:649:14)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
Waiting for the debugger to disconnect...
Error: Cannot find module 'discord.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (c:\Users\darkr\Desktop\Fairy Bot\index.js:1:79)
at Module._compile (module.js:649:14)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
#development
1 messages · Page 500 of 1
?
it is clear the error
Do npm install discord.js
"but can't suppr him"?
morning all can somebody help me with the api please for d.js
i have that @languid dragon i just need to do the api so that it shows on my bots how manny servers are the bot on DBl
because im tired of always asking i also whent to discord and they say DBL is shit 😦 so yeah im starting to hate what i am doing at this stage @languid dragon
oh and my bots were kicked from there also
from where?
discord
ok..
You're not really making sense lol
but is there a way for somebody to help me with it im not sure if i must the whole code or just some part of it
Go to #topgg-api
Hello. I'm trying to make my first discord bot. I'm following this guide https://www.digitaltrends.com/gaming/how-to-make-a-discord-bot/
When i get to Step 9 and try to run the command "npm install discord.io winston –save." It gives me this error message.
Can someone pleasehelp me with that?
Why use discord.io, it's so outdated
discord.io is outdated
^
you can't really make a working bot with it, you may want to check "An Idiots Guide" for up to date guides
Use Discord.js or Eris.
Eris +1
You'll be better off using discord.js if you're a beginner
Alright i'll look into it. Thanks for the help.
Digital Trends 
Howdyho!
Having tons of irc-nostalgia with creating my little bot. What I can't really seem to find is a place to find out all possible uses for.. say message.xxx (like message.includes, startsWith etc etc) is that just javascript or for discord.js in particular or am I missing a major point? Tried looking it up in the documentation for discord.js but either I'm not good at reading or it isn't there
message is a collection, which is a form of javascript map()
you can look up methods for javascript maps in the mozilla docs
Guys I need a Src of a Rich Prescence Example (JDA pls)
message.content gives you a string, which you can lookup methods for strings
includes works for strings and arrays
startswith works for strings
@quartz kindle thanks dude, already reading the mozilla docs 😃
Oof
other than that, each discord collection also has its own methods
And whats with me?
for example, message.content (the content part is discord`s own method)
but what I'm asking for is called methods I gather?
yes
its like a function that is applied to something, usually data followed by a dot and a function
yeah grasping the usage but failing to find some kind of list with all possible methods
for example, in the discord docs https://discord.js.org/#/docs/main/stable/class/Message
you can see proprieties and methods for message
proprieties are things that give you a value, methods are functions that are executed on it
so ok, those are in addition to what is considered to be "standard" ?
as in, "includes" doesn't exist on that list, hence I discarded the list as not the thing I was looking for
yes, everything that is on discordjs's documentation is their specific methods
the standard javascript methods are not listed there, but you can find them in the mozilla docs
awesome, just what I wanted!
Omg
just pay attention to data types
Thanks for ignoring me
methods for strings, arrays, objects, maps
@earnest phoenix you wont get anything by asking like that. i dont have what you need, and i dont think anyone's gonna spoonfeed you in dms
spoonfeed = giving full code for someone to copy and paste
You just made a sarcastic comment
I wouldn't expect to get help that way...
People here seem to be nice and forthcoming, so if you don't get the response you expect, then perhaps you should consider altering your methods of acquiring what you seek @earnest phoenix
well said :3
And thanks a bunch for the patience 😃
Should I use commando?
whatever you want. i prefer not to
Same.
From my experience commando is very slow
Compared to other bot frameworks.
Ajnd especially compared to writing your own framework.
How do i make a bot
you take some code, shove it in a box, catch it on fire
asking how to add your bot?
Put ur bots client ID in id=CLIENTID
@proven lance
why?
Then u get the option 2 add it 2 a server
For EX
yes, but why am I doing that?
So u can add it 2 your server @proven lance
oh, I wasn't asking how I can, I was asking if you were asking for that
Oh no
@prisma sedge what was the mute reason?
I would recommend pinging one moderator with the bot name/ID and its mute case.
If he/she doesn't respond just DM one.
Ok
@earnest phoenix Could you please unmute my bot @carmine dome (479698613795160084)
Thanks!
why does this send 3 times in the response and why does it not say what the args where??
if(message.channel.type === "dm") {
var args = message.content.split(" ").slice(0)
var args = args.slice(0).join(" ")
let embed = new Discord.RichEmbed()
.setTimestamp()
.setTitle("Direct Message To The Bot")
.setDescription(`Message: `,args)
.addField(`Sent By:`,`<@${message.author.id}>`)
.setColor("RANDOM")
.setThumbnail(message.author.displayAvatarURL)
.setFooter(`DM Bot Messages | DM Logs`)
client.users.get("274284493043531776").send(embed)
}
Quick TypeScript question: why won't this work on my tsconfig:
"node_modules",
"**/*.model.ts",
"**/*.models.ts"
]```
?
I've been reading on it and I see lots of people not managing to get exclude to work but few solutions and none work.
What are you expecting excluding the files should do?
I expect those files not to be transpiled to JS files.
guys
i have installed
vsfpt
on my linux
now i am connected to the server using filezila
i get this message when i upload my files
do i need to zip the files?
because my website was in files
make sure the directory is correct, and that there is no typo
why wont this work for me?
//this bit send embed, but the output part in description says output but not the code part
if (message.author.id !== ownerID) return message.channel.send("You are not authorized to use this command.");
if (message.content.toLowerCase() == "--eval bot.commands") {
let codein = args.join(" ");
let code = eval(codein)
let commandsEmbed = new Discord.RichEmbed()
.setAuthor("Evaluate")
.setColor("Blue")
.setDescription('📤 Output', `\`\`\`js\n${code}\n\`\`\``)
.setFooter(footer)
return message.channel.send(commandsEmbed);
}
//this bit works
try {
let codein = args.join(" ");
let code = eval(codein);
if (typeof code !== 'string')
code = require('util').inspect(code, { depth: 0 });
let embed = new Discord.RichEmbed()
.setAuthor('Evaluate')
.setColor('GREEN')
.addField('📥 Input', `\`\`\`js\n${codein}\`\`\``)
.addField('📤 Output', `\`\`\`js\n${code}\n\`\`\``)
message.channel.send(embed)
} catch(e) {
message.channel.send(`\`\`\`js\n${e}\n\`\`\``);
}
}
ping me*****
How do we use the bot owner’s Id ?
wdym?
wut
Does anyone know how to always keep your bot online?
Okay, thanks!
np
how do i do this?
ik how to do named links in an embed but i never knew you could make a link show different info when hovered over
[text](link "hover")```
can anyone help me to make bot change activity on every 10 seconds?
e.g. i want to change client.user.setActivity(text_1); to client.user.setActivity(text_2);
10 seconds is kinda too fast, do you really need it to be 10 seconds?
its much better 1 minute or 5 minutes
10 seconds is going to get you ratelimited anyways, right?
not literally 10 seconds, just as an example
ah
i cant find anything on google
are you using javascript?
yes
then just do setInterval
got it, tnx
hi im using discord.js and i messed up some of my code can anyone help point out wats wrong const token = process.env.TOKEN;
const fs = require('fs');
const commands = {};
fs.readdirSync('./commands/').forEach(file => {
commands[file.substring(0, file.length - 3)] = require('./commands/' + file);
})
if you have any help plaese @me
yes
post please
post wat
The error
oh ok
const token = process.env.TOKEN;
const fs = require('fs');
const commands = {};
fs.readdirSync('./commands/').forEach(file => {
commands[file.substring(0, file.length - 3)] = require('./commands/' + file);
})
That's your code
its some were in that
What does it say in the console
i dmed you the code its in sever
Yo homies, I code in c#,
I'm trying to have the bot changed the user's nick in the server, and this is what I have so far,
await ((SocketGuildUser)Context.User).ModifyAsync(x => x.Nickname = $"[H]{Context.User.Username}");````
Right under it I have the bot send a message it's not even sending the message?!
Halp
@kind nexus bots cannot change nicknames of users who have the same or higher role and can never change the server owners nickname you need to if (BotHasPerms) or wrap it in a try catch
mmmm
probably discord borked
Wait what
oh wait
1 sec
so basically
I made a role that has the second highest perms
I forgot to give it to the bot tho 😆
I'm so dumb
So im trying to create a skip command that if a user has the role 'DJ' that it skips without votes, and if they dont then its voting to skip
But it doesnt do anything at all
(node:8711) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined
On line 4
http://hatebin.com/baucjmvqnc
roles isnt a property of client https://owo.oooooooooooooo.ooo/i/1szb.png
bot.guild.roles.get ?
<Guild>.roles.get('id')```
so define the guild separtely?
As Faso pro my bot go Pro Google and manages to leave it on 24h
or just do js msg.guild.roles.get('id')
np
hold on
k
@client.event async def on_message(message): if message.author == client.user: return if message.content == "!b": await client.send_message(message.channel, message.content[::-1])
How do I make it so that if a message cotains !b, the incomming msg will be backwards
instead of only !b being backwards
== only does exact matches, you have to use a contains/includes function
Did you ever figure it out dream?
it looks fine to me
but im just glancing at it
are you running the command out side a server with the role?
try doing .has(ID) instead of has(role)
When i try to run my bot it tells me "An invalid token was provided". I regenerated the token a few times now but the error still persists.
make sure you update and save everything
i did
did you?
Oho, found something
I have my token in a config.json and giving it to my code with config.token. When i put the token directly into the code it works
I also have my prefix and a variable in the config but these work
make sure you update and save everything this is the answer on your problem
Can someone switch this if message.content == "its": await client.send_message(message.channel, "it's*") from python to JavaScript??
A guide made by the community of discord.js for its users.
Recommend reading up on the basics here
That doesn't say how to switch it
learn discord.py first
@earnest phoenix
if message.content.startWith("Its") {
message.channel.send("It's*")
}
next time, just learn to do it
Damn no reason to come off like that
or just dont spoonfeed them
@earnest phoenix why would you do that though -- "its" is valid in some situations
@loud salmon so how to i implement it in nodeJS?
@hushed berry you look like you know a lot then can you tell me how to insert that?
I dont actually know nodejs
I don't have any extensive JS experience, sorry
Its my halloween costume
😦
if you need groovy help, im your man though
how can i add the time someone joined the server to my userinfo commands
docs are very nice
ye, i figured it out with testing
but how do i make this ignore @everyone role
.addField("Roles:", member.roles.map(roles => `${roles.name}`).join(', '))
You can use the filter() method and fitler the @everyone role.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
You can also change this:
member.roles.map(roles => `${roles.name}`)
to this:
member.roles.map(roles => roles.name)
Looks a bit cleaner.
i dont understand that filter method
would this work
.addField("Roles:", member.roles.filter(r => r.name !== '@everyone').map(roles =>`\*\*\`${roles.name}\`\*\*`).join(', '))
try it
yup, works like a charm
You want to make the role names bold?
ye
You can just do **${roles.name}**
i know
i just had the above saved somewhere in my files and i like it with the *\ anyways
okay, good.
Toast what language?
python
async or rewrite?
async
youtubeDL right?
yeah
yeah, its not public or anything
theres two parts to the code
the bot part
and the the talking part
like when someome says hello it responds basically
Eh just send me the music part xD dont need anything more than that xD
let mArgs = args.join(", ");
let math = Math.max(parseInt(mArgs));
let embed = new Discord.RichEmbed()
.setDescription(`The maximum value out of **${mArgs}** is **${math}**`)
This outputs the minimum value instead of the max
mArgs is a string
Look at your code and how you are parsing
You can give math.max aan array with the spread operator which is why I prefer
Yeah He is right
It will find the first available number
"You can give math.max an array with the spread operator which is why I prefer"
^^^^
??? just give it args 
args 0 args 1 my man
math.max will work for string
embed.fields[0].value: This field is required
What does that error mean
Its annoying to read through the console with those
means the value is empty
Fill it up lol
whats your code
which file? o.O
the embed...
also while im here https://owo.oooooooooooooo.ooo/i/3nbz.png
what does this mean?
i kinda understand it
but not completely
yes
oh lol
(node:16205) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
I fixed the embed error but...

The bot doesn't have permissions
Whats the command doing?
@woven sundial guildCreate event
uh iirc yes
let me see
hmm my bot should have administrator in all servers 🤔
Just try it out.
loop through the channels and send to the first one it has perms in is my recommendation @woven sundial
np
oof doesnt look like anyone has a answer to my question
sad
Mongo-DB, mongoose or postgres, which is better for a sharded bot? Speed, system usage etc. things
mongodb is the db, monoose is just ODM so you can have predefined scemas and stuff
but between postgres/mongo is not really a speed question, more of a design question --what do you need for your app? relations or documents. only you can answer that
Hello.
dont believe me just why
explain your problem
Cardi B - "Bodak Yellow" from the debut album Invasion of Privacy Stream/Download: https://CardiB.lnk.to/IOPAY Exclusive Bardi Gang merchandise available her...
Post in off topic
ok mum
This channel is for bot development only
@earnest phoenix stop lurking smh
i cant help it
what about that
I don't see any error
Or know what the expected behavior is
.type has nothing to do with size
.filter
message.guild.channels.filter(m => what ever you want to do with m)
yes
When will verification applications be open?
Can someone help me make a bot using discord.js?
A guide made by the community of discord.js for its users.
if i add this to my message event will it ignore other bots, not work in dm, and react with an x to the message?
if (message.channel.type === "dm") {
message.react(":x:");
message.author.send("Can/'t Use Commands In DM!")
return;
}
if (message.channel.type === "dm") return;
if (message.author.bot) return;
Can someone help me host a bot?
Heroku or Glitch
Or a decent host
if paid then idk but if ya want for free then one of the above
.setDescription(":gear: " + `Succesfully cleared ${deleteCount} messages\nBy: ` + "`` "+ `${message.author.username}` + `` + " ``\nIn: ` + `` "+ `${wydy}` + `` + " ``")
how would i make it so in the part where it says wydy it would say what channel the messages where purged in?
i dont care
how is message not defined in this??
https://hastebin.com/rahunorodi.js
im tryna make it so if someone types in dm to bot it does nothing
but if its a command then it will send error saying cant use commands in dm then return;
nvm, forgot to double / a line
Is this a good JSON file. Like easily being able to parse it and add users to it?
{
"guilds": {
"10020": {
"users": {
"000111": {
"username": "A Discord User",
"discrime": "4063",
"amount": 5,
"reasons": [
"this",
"is",
"a",
"warning",
"test"
]
}
}
}
}
}
Just use a different json file for each guild
{"userid":"2897342397492", "amount": 1, "reasons":['test']},
{"userid":"2897342397492", "amount": 1, "reasons":['test']}
]```
If you have 2000 guilds, I would switch to a database instead of json files.
I don't though
So if I needed to get an individual user, how would I search for the user id?
you using discord.js right?
Do you think I should store all the info in one JSON?
My bot is only in 16 guilds
what "info"
JSON is nice for small configs not databases
@unborn cairn
JSON is good for configurations that will generally not change
Yeah 16 guilds
Even if it is 16 don't you expect it to grow?
Databases such as MongoDB or MySQL are very powerful and scalable, which you should use to store often changing data from the start
no not really
Even sqlite will be better
If I'm going to do a database then I'll use MySQL
hosting a database is no problem really
(just put that there incase he uses glitch)
Still isn't adding to my JSON file
def addwarning(guild: str, userid: str, reason: str):
aw = warns["guilds"][guild]["users"][userid]["reasons"].append(reason);
json.dumps(aw);
print("Done!");
addwarning("10020", "000111", "this is a reason test plz work :)");
How do I add the new value to the JSON file?
Someone
please
help
ok
How do you get a data from a MongoDB collection with mongoose mention pls
..
How do I make a command that posts the avatar icon of somebody but with a filter?
@steel heath Have you tried looking on the mongoose docs?
Yeah, found something like
var BlaSchema = new Schema({ name: String, age: Number });
var foo = mongoose.model("bar", BlaSchema)
foo.find({})```didn't work
Well, everything is there...
I wouldn't wait for someone to tell you something that you could find yourself in a few minutes
Never used mongoose, otherwise I would help
hmh, docs r pretty complicated for me but thanks anyway
I personally use an ODM called mongorito.
I don't like how mongoose uses schemas
I switched to mongodb for the sole purpose of getting away from schemas
@steel heath
Mongorito documentation is fairly easy to understand
oh thank you
I'm getting an error when I run this command: ```python
@client.command()
async def adduserinfo(message):
print(message.author.id)
f = open("userlist.txt","a")
if message.author.id in open('userlist.txt').read():
await client.say("Your user ID is already in the file.")
else:
f = open("userlist.txt","a")
f.write(message.author.id)
await client.say("Added your user ID to the file.")
f.close()```
Error: raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param)) discord.ext.commands.errors.MissingRequiredArgument: message is a required argument that is missing.
Using discord.py
well you are missing message when you run the command
Someone willing to help me make a bot?
Can you help me make a bot?
wdym @knotty steeple
Can someone help me make a bot?
What about it?
you are doing <prefix>adduserinfo instead of <prefix>adduserinfo somethinghere
@mild quarry
Ok
@knotty steeple Can you help make me a bot?
no
await EventChannel.GetPermissionOverwrite.EveryoneRole(x => ChannelPermission.Speak = false);```
EventChannel and EveryoneRole are properly established
but It has an issue with "GetPermissionOverwrite"
u can learn to code
Ye
Which part?
Coding
learn a programming language
Cause we're not just gonna make a bot for you
first of all
Python is a good beginner coding language
It called teaching.
I wanna code in Discord.js
no u
node
do you know how to make a bot @vital cradle
😆
What do you suggest @knotty steeple
for what
Why doesn't I have the bot developer role? 😆
Code
How do you get it?
submit a bo- look up ^
Don't let the bot die for any reason afterwards.
And need help, the description requiring 300 characters, what should I put?
xD
Describe your bot and then have a list of commands.
-bots @kind nexus
This user has no bots
That's what a lot of people do for their description.
-bots @grim elk
Bots
@peak plinth
-bots @earnest phoenix
Bots
@primal viper
@onyx marten
it says bot devolpers
What ur bot @grim elk?
@peak plinth
Have fun.
I remember someone telling me about "something#GetPermissionOverwrite" 😆
I forgot the other part...
Oops
hehe
@vital cradle if you're using discord.js for your bot, all I can say is read the docs, look at the examples (if there are any), read a lot, and code.
there are tons of examples
What do you use?
#1 thing you absolutely have to do: Read so much, your head will spin.
Something like this @steel heath ?
const mongoose = require('mongoose');
const ExampleSchema = mongoose.Schema({
a_var: String,
another_var: Number
});
const Example = mongoose.model('Example', ExampleSchema);
//No name for collection specified so mongoose will add an 's' to the model name (collection will be 'examples')
Example.find({}, function (err, results) {
//results -> array of all documents in collection 'examples'
});
Example.findOne({}, function (err, results) {
//results -> first document in collection 'examples'
});
Example.find({a_var: "Match this"}, function (err, results) {
//results -> array of all documents in collection 'examples' where 'a_var' equals 'Match this'
});
Example.findOne({another_var: 2}, function (err, results) {
//results -> first document in collection 'examples' where 'another_var' equals 2
});
mongoose.connect(connectionstring) to connect to your db
In case you didn't know that yet 👀
Yo dudes
I'm coding in C#,
I'm trying to have the bot edit the permission of a channel so that a certain role can't speak
I have "EventChannel" set as the channel and "EveryoneRole" set as the role to be edited
ok
How would I exactly change the perm of the role in the channel perms
That sentence was confusign ^^
^^ Not as confusing as that one
so what lib
okidoki
alright lemme remember how to do this brb
alright so where are you? like there are two steps, getting the role, and then changing the perms, have you figured out the first part?
wait
oh you're trying to edit a channel?
to stop a certain role from speaking?
do you know how to unbox?
alright so you need to unbox the channel to type SocketGuildChannel, which is done with the as keyword
ie e.Channel as SocketGuildChannel
if you don't do this, it won't let you edit the guild info on the channel
I don't know how to unbox
(I use e as the context variable because that's was it was pre-0.9.6 but you probably use something else)
unboxing is what I just explained :P
e.Channel as SocketGuildChannel is unboxing
do you have the current channel stored as a variable?
no
do you know how to do that?
can you show me the line of code you used to do that?
SocketGuildChannel EventChannel = Context.Guild.VoiceChannels.FirstOrDefault(x => x.Name == "Events");```
I mean

Hiii!!!!
I'm not here
so AddPermissionOverwriteAsync should be a function under EventChannel
first argument is the IRole, second variable can be initted with new OverwritePermissions() with the arguments to the latter being various enums
and you can set whatever you want
gimme 2 sec ill find the right one
How to make a nsfw command in python 3.6.5?
ok figured it out im stupid lol
so it's like this: new OverwritePermissions(sendMessages:PermValue.deny)
👀
what
aren't you trying to deny the sending of messages?
if not, replace sendMessages with whatever
@odd scroll shut
Yeah
🤷
I did
so it all works fine?
well you activate the AddPermissionOverwriteAsync on the channel object
that ties it to the channel
and then the first argument is the role, which is what ties it to the role
that's the second argument
so the full line should be something like cs EventChannel.AddPermissionOverwriteAsync(myRole, new OverwritePermissions(speak: PermValue.Deny));
or
im spoonfeeding a bit here but ya'll can fite me
you can do it externally as well
like set the OverwritePermissions to another value
like
OverwritePermissions p = new OverwritePermissions(speak: PermValue.Deny);```
and then use EventChannel.AddPermissionOverwriteAsync(myRole, p);
what is this language
Yes
oh
alrighty, cool baens
I'm pretty postivie
It's not just the coding I like
I like when people EXPLAIN it to me
So I'm actually LEARNING something
help?
are you posting server count to the api
Can i do .../file to get a file that is 2 folders out?
../../
@topaz fjord yes
https://media.turtle-bot.com/f/X6Q9b.png doesnt seem like it @merry portal
if you are using the d.js lib it posts every 30 mins
What's the point of posting every 30 minutes? 👀
Just post whenever you get a new server
Smart xD
@earnest phoenix thats more spammy
but api is 60req/s isnt it?
I'm just going to assume that their bot isn't a huge bot
I know that for me, I've been doing that since day one and have had no issues
I wouldn’t need to worry, my bot is only in 4 guilds
If my bot is leaving/joining servers at a rate higher than 60 a second, I'll set a timer then
let arg1 = args.slice(1).join(' ');
if (!arg1) {
message.channel.send('Configuration Values:\n`logs:` sets the logs channel\n`mod:` sets the moderator role\n`prefix:` sets the prefix')
}
if (arg1 == logs) {
message.channel.send(`Set the logging channel to ${message.channel}`)
}
if (arg1 == mod) {
let arg2 = args.slice(2).join(' ')
if (!arg2) {
message.channel.send('You must supply a mod role.')
}
if (!arg2) {
let role = guild.roles.find(`name`, `${arg2}`);
if (!role) {
message.channel.send(`Couldn't find the role \`${arg2}\``)
}
if (role) {
message.channel.send(`Found the role \`${arg2}\``)
}
}
}
}
break;```
why does that always return config values
thanks @quartz kindle
So I started using heroku for my bot
And I get this error in the logs:
Error: ENOENT: no such file or directory, scandir './commands/'
Whenever i run a command
dont use heroku
y
I am trying to make a new bot but this code won't work, I can't seem to find the error or understand it. Please help.
botconfig.json is malformed
@stone hatch client.on('error', console.error);
add that
it'll tell you the error
ok
anywhere in the bot code
?
@stone hatch botconfig.json is messed up
How?
Show it
Block out the token
Remove the comma after the prefix line
You need one after token
Done.
Try it
THANK YOU
👍
😉
sa
@lost scarab yes xD
do u know how to do it? @cursive dagger
yes
just check if their next msg is x and store vars
?
That's why you have to learn JavaScript first.
so idk how to make those like more "hard" things
Anyone can help me with my error? This is for bot info code.
Error:
Code:
All solved now!
yes
Can you help me in DM thing I show you.
I can't seem to find the error for this:
-waits patiently-
Double check your if statement
if statment? ok
You're missing a curly bracket
It should be js if () { ... }
In the top layer
i know
?
Problem with find
not reportsEmbed
ok
It's before the send
Ok.
Can't u see the output?
it's working now ? @stone hatch
Of course not
you lie
desmond to fix the pass a function instead use message.guild.channels.find(channel => channel.name == "reports");
Fixed already.
Oh, I'm stupid as fuck, sorry
It was the reportEmbed instead of reportsEmbed
It was only deprecation warning about find
Ok.
u better use .find(item => item === var) for example
@stone hatch
Yes?
message.channel.send
yes
ok.
Not message.send
but where is it
message.channel.send("");
Find it in the code
this is will work
??
lol
huh?
at the line 28 @stone hatch
ok
at the line 28 of yout bot
Ok, but now..
It can't kick any members that have no perms.
And it says no can do pal.
your bot have perms ?
Show me your perms command
@stone hatch
K
@crisp pendant
its' !
if(!message.member.hasPerm
yes
You used the variable KReason as you put
‘’’ let KReason = ‘’’
ok
Does this.
Do they have perms in the role
Check if they have manage messages ticked on there user
OK
line 28 : if(!message.member.hasPermission("MANAGES_MESSAGES")) return message.channel.send('You don't have permissions')
you have to write if(!
yes
ok
I don’t know if you have a command handler or not but this is my code for the kick
const Discord = require("discord.js");
module.exports.run = async(bot, message, args) => {
let kickedUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if(!kickedUser) return message.reply("Couldn't find user.");
let reason = args.join(" ").slice(22);
if(!message.member.hasPermission("MANAGE_MESSAGES"))
return message.reply("You don't have permission!");
if(kickedUser.hasPermission("MANAGE_MESSAGES"))
return message.reply("This person cannot be kicked!");
let kickedChannel = message.guild.channels.find(`name`, "logs")
if(kickedChannel){
let kickedEmbed = new Discord.RichEmbed().setTitle("Kicked").setColor("#00ffff").addField("Kicked User", kickedUser).addField("Kicked by", message.author).addField("Reason", reason);
kickedChannel.send(kickedEmbed);
}
message.guild.member(kickedUser).kick(reason);
}
module.exports.help = {
name: "kick"
}
Your line 29 states that if kUser does not have permission than ‘this person is not valid to be kicked’
So what do I have to do?
Yes
yes
K
It work @stone hatch ?
ok
its' working ?
this?
yes try
Spoonfeeding 
error ?
message.mentions.users.first() || message.guild.members.get(args[0])
);
if (!kickedUser) {
return message.channel.send("L'utilisateur n'existe pas !");
}
let kickReason = args.join(' ').slice(22);
if(!message.member.hasPermission("MANAGE_MESSAGES")) {
return message.channel.send("Vous n'avez pas les permissions pour faire cela !");
}
if(kickedUser.hasPermission('MANAGE_MESSAGES')) {
return message.channel.send("Vous ne pouvez pas kick cette personne !");
}
let kickEmbed = new Discord.RichEmbed()
.setDescription('Kicks')
.setColor('#dc143c')
.addField(
'Utilisateur kické',
`${kickedUser} (ID: ${kickedUser.id})`
)
.addField(
'Utilisateur ayant kické',
`${message.author} (ID: ${message.author.id})`
)
.addField('Canal', message.channel)
.addField('Raison', kickReason);
let kickChannel = message.guild.channels.find(`name`, 'reports');
if (!kickChannel) {
return message.channel.send(
'Canal "Reports" introuvable. veuillez créer ce canal !'
);
}
message.guild.member(kickedUser).kick(kickReason);
kickChannel.send(kickEmbed);```
my code
i'm french ...
Ok.
Im super new to python and im trying to make a bot that autoassigns ranks based on activity
learn python
ok
one last thing for a while
hhh is only storing the last line of the file to a variable
f = open('userlist.txt')
line = f.readline()
while line:
st = line
st = st[:-1]
hhh = ('<@!' + st + '>')
line = f.readline()
f.close()
print(hhh)
@client.event
async def on_message(message):
if message.content.startswith(">embed"):
embed=discord.Embed(title="hello", description= hhh, color=0x00ff40)
await client.send_message(message.channel, embed=embed)```
How can I get it to store all of the lines?
Doing print('<@' + st + '>') works but storing it to a variable only gets the last line
i dont know python, but im pretty sure you're replacing hhh with the next line on every loop
so you go through all the lines, but each gets replaced with the next, and leaves you with only the last one
print outputs to the console on every line, so it cant be replaced
True
anyone able to help me with this rethinkdbdash issue?
RangeError: Invalid time value
at Date.toISOString (<anonymous>)
at Function.Term.expr (/home/tony/Bots/Benny/node_modules/rethinkdbdash/lib/term.js:2342:49)
at /home/tony/Bots/Benny/node_modules/rethinkdbdash/lib/term.js:2364:40
at Object.loopKeys (/home/tony/Bots/Benny/node_modules/rethinkdbdash/lib/helper.js:56:14)
at Function.Term.expr (/home/tony/Bots/Benny/node_modules/rethinkdbdash/lib/term.js:2362:12)
at Function.Term.insert (/home/tony/Bots/Benny/node_modules/rethinkdbdash/lib/term.js:543:39)
at Object.execute (/home/tony/Bots/Benny/commands/mute.js:70:43)
affected code:
await client.r.table('cases').insert({ // <------- apparently here, mute.js:70:43
id: totalCases + 1,
member: member.user,
modeator: msg.author,
reason: reason,
mutedAt: mutedAt,
unmuteAt: unmuteAt,
});
invalid time value. mutedAt and unmuteAt are probably expecting something that can be converted into a Date object
they are dates though afaik @quartz kindle
const mutedAt = new Date();
let date = new Date();
date += durationTime;
let unmuteAt = new Date(date);
thats before in the code
how's the table schema?
idk how rethink works. do tables have defined data types? or you can store whatever?
im sure you can stick in whatever









