#development
1 messages Β· Page 734 of 1
andddd where do we put this?
so for example
if str(message.channel) in channels and str(message.author) in valid_users:
if message.content.find("!hello") != -1:
await message.channel.send("Hi.")
if it finds !hello in the chat
it will send Hi.
there's a memberCount property
you don't need to count members manually
π
lol
best command handler
π
if else with bad support for arguments and you end up with three thousand lines of code π
tbf
his bot would tirgger
if !hello is anywhere in the code
also
its caps sensitive
#readthedocs

id personally advise looking up how to get the bot to respond to the first part only rather than trigger if any mentioning of the command is there
and making caps insensitive
yeah
and making sure await is even in a async function
learn the basics of discord.py and aysnc
ok
might as well switch to js
Requirement already up-to-date: google-api-python-client in c:\program files\python36\lib\site-packages (1.7.11)
Requirement already up-to-date: google-auth-httplib2 in c:\program files\python36\lib\site-packages (0.0.3)
Requirement already up-to-date: google-auth-oauthlib in c:\program files\python36\lib\site-packages (0.4.1)
fuck my life
there r like
50 parts to Gdrive api package
and its saying its installed
yettt
its nowhere to be found
now we begin the hunt for gdrive
just send your code breifly
send code
oh you meant your
i think that is safe only a server id
for one I don't care about
token is in another file
you try to loop through guild but have no variable named guild
f"""Number of members in the server: {discord.guild.member_count}"""```
big no no
and yes cry is right
your iterating through somthing which just doesnt exist
also it wont work if you have any other channel name other than general
rather than hardcoding the ID why not just get it from message?
as for member count
whats the point in getting id if its not used?
id = client.get_guild(647173625912360961)
channels = ["commands"]
valid_users = ["yellowyears#7678", "Agon#0394"]
are you talking about this?
think about what your trying to get
and yes
your getting the guild and assigning it to id
yet you do nothing with it for member count
so it should be?
id = 647173625912360961
channels = ["commands"]
valid_users = ["yellowyears#7678", "Agon#0394"]
okay
yeah
well think about it
good point
this?
mhmmm
thats saying
variable?
youve got the guild from client pretty much
so
instead of discord.guild
what do we need to replace it as...
Hi Can anybody help me in giving me a welcome code that can save in a file with the invite json
we need to replace it as id
yes
okay it works better now
you mean a welcome message?
with this i can maybe make the member count in welcome message now
thank you for that chill
np
would it be better if I merge my ticket commands in to the utility cat or have a seperate cat for tickets
whatever you feel like is the best
I was thinking maybe merge, but if I have too much commands in that cat I might wanna go back to having it as a seperate cat
why does my embed send multiple times even though i opened the bot once
check that there arnt any extra instances going (double check)
and check its not sending the command more times
Getting this error TypeError: on_member_join() takes 0 positional arguments but 1 was given
when using this code
@client.event
async def on_member_join():
id = client.get_guild(647173625912360961)
for channel in id:
if channel.name == "general":
await channel.send(f"""Welcome to the server {member.mention}.""")
any one can give me a welcome message code pls https://cdn.discordapp.com/attachments/272764566411149314/647789997663191041/unknown.png
DUDE
stop begging for the code
when i makes
no sense
if what you want is a welcome message
CODE it yourself
by looking at the docs
@dark swift you add argument when calling on_member_join()?
do you call on_member_join(something) or do you call on_member_join()
the code begging was not for you, that was for rocketman
oh okay
I don't know what I did it just doesn't work now
i don't think I added an argument.. on purpose lol
other commands work
I put in on_member_join(id):
and now I get a different error when somebody joins
TypeError: 'Guild' is not iterable
oh dude
right
you cant pass anything through on_member_join
cuz it wont pass you anything
yeah
and you cant iterate through a guild payload
client.get_guilds() gets a payload i think which isnt iterable
ah okay
on_member_join event takes one argument
Can't you just iterate over client.guilds
i believe the best code now would be
@client.event
async def on_member_join(member):
channels = discord.utils.get(member.guild.channels, name="general")
await channel.send(f"Welcome {member.mention}")
role = dicord.utils.get(member.guild.roles, name="Member")
await member.add_roles(role)
also I wasn't begging for code @modest maple
oh okay
without giving any info or any sign of actually wanting to know how to program it
what
for example when you join some servers will have a personalised banner and all you have to do is get the users profile picture and name and then put those variables into a picture and that is how you make it i am pretty sure
@fluid widget
yeah ahha
uses suprisingly little system reasources
yeah
wait one last thing
I am using the code from discord.ext import commands to get commands like discord.utils.get and the whole line is grey as opposed to from and import being orange and discord.ext and commands being white. Is this correct?
yes i use pycharm
and maybe english isn't their first language aha
pycharm greys it out if the import isnt used globally
oh okay
good and you?
sometimes it is just a bug
i french
bonjour
#memes-and-media for french
le grand douche ne marchait pas
give my script bot admin pls dm me
t fr?
@earnest phoenix no
of course I'm french
non
sorry mate
i'm not even french haha just testing out what i know
i said 'the shower does not work'
ik
alright
if i do botsprefixHelp it sends 1 embed but if i do it again it sends 2
you're probably subscribing to the event every time you get the event
oh
analyze your code
i fixed it
body {
background-image: url("https://i.pinimg.com/originals/82/8b/ee/828beeae04781fb166ca613ee75603ee.jpg") ;
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.bot-name {
color: #fb5a04;
}
.bot-description {
color: white;
}
.bot-tags-title {
color: white;
}
.owners {
color: white;
}
.column {
color: white;
}
</style>```
moved it to develelopment now
but:
The bot name should be the hex code
help
but its going to the defualt black colour fixed
has anyone successfully used heroku to host a bot?
or you can also use googles free trial for the year and then get a cheap vps
unless private i guess
Yeah they are great but they are to far away from me so I switched services
@earnest phoenix there is some in pins
Hosting starting at $1.67/m - Servercheap.NET is a fast and reliable virtual private server platform, designed for serious developers.
Most of them have a cheaper plans
$20 a year
not bad
unmetered connection
thanks for the recs
welp, its openVZ, thats why
linux is good
windows is a bit of a hassle for me to use for hosting
Once you get used to Linux you never wanna go back :^)
yeah it's great so the $20 is a steal if you live in the US lul
Tbh I use my computer as a host sometimes
but for bots right not websites?
Yeah
yeah thats fine honestly
I have a good computer and I mainly run gentoo or arch
It's very easy to host stuff if need be
I would like to get a raspi soon though
Both are very good operating systems
Arch especially
Gentoo is a bit harder but also extremely flexible
I wanted to try arch desktop for programming but gave up because I couldn't be bothered typing a shit ton of commands
I'm thinking of making a script
it's a bit of a hassle ay?
I install arch a lot and it would make my life so much easier
Eh
Not really
Imo
Just gotta know what you're doing
Arch isn't a hard install at all imo
haha thats not me π
Just follow the wiki and you'll be fine
The arch wiki is definitely the best place to go for anything Linux
I'm building a new pc soon so I'm planning on using my current pc as a server for recording, hosting development etc
so I think I might dual boot arch and windows but I'm still conflicted
I feel like arch is just a generally good distro for any Linux user really
I've wanted to switch but idk shits just been sticking to me with windows
help me please
ready
ready for what?π€£
idk
im ready promotion im ready promotion
Y you gettin' promoted? π
no but i wish
would it be possible for me to make a command to restart my bot?
i think it means it can't add roles
let me check real quick
i dont think it has permissions
yeah i gave the bot admin tempoarily
but it doesnt have a role
so like I made it have admin in the discord developer portal but would it have to get a role in the server?
you can set the invite link (or the role once you invite the bot) to have the manage roles permission
would it be possible for me to make a command to restart my bot?
Squall, what language.
also how do bots get roles as soon as they join? that give them all necessary permissions
ah right
@sudden geyser discord.py
Run something like sys.exit then restart it in the background
hmm for some reason I cant seem to save the changes
it doesn't give me the option
i'll try another browser
Yellow, make sure you check its role hierarchy
yeah
no it just doesn't get any permissions anyway
apart from @everyone permisions
I can set permissions but I can't save them
You can add permissions to the invite link
yeah its for testing though
no I am talking about this
Yeah
so i can fix this
That's what you'd use
yeah I know
But it wouldn't guarantee that the bot will actually have all those permissions
The user inviting the bot will always have full control on what permissions a bot gets
You're gonna have to make your bot work even if it doesn't have the required permissions
Do a check if your bot has the permission and if it doesn't then display a message to the user explaining what went wrong
yeah
good point
but
why can't i save the permissions in the Discord Developer Portal?
yes
yeh
Who nows how to program the vote like hasNadeko bot ?
@light drift what does nadekos vote system do?
@stray wasp he votes the bot and give coin currency
You have a database which contains the users currency
And everytime a user votes it will add the amount of coins you want added
To the table where the coins are stored
anyone have the regex to track if a youtube link is a playlist, my regex just seemingly broke
Basically, I'm trying to write a regex that matches urls like this:
https://www.youtube.com/playlist?list=PLBOh8f9FoHHjOz0vGrD20WcTtJar-LOrw
But not urls like this:
H
thanks
@stray wasp but how i can setup the comand and the fuciont because i donΒ΄t now how to explain every time when he vote gives 500 coins like that
is it message.author.send to dm someone?
so.. i was helping my mom schedule an appointment with a government thing, and they have this online form you need to fill up, heres how it went (keep in mind this is an official government website belonging to the "federal police")
you need to chose your city from a drop down list, after choosing your city, another drop down list gets populated with the available offices in that area. doesnt work, all options cause "error: invalid selection". click on language switch, suddenly works, switch language back, works, ok , so i select the branch and fill up the rest. put her birthday (explicitly written that it should be DD/MM/YYYY) and click proceed. "error: invalid birthday". try again, error again. for the lulz try inverting DD/MM to MM/DD against their instructions. works, form processed successfully.
gg government of Brazil
lmao
lol
Google drive API progress:
Started a subrutine
bout it
added an entire 1 line to the code
https://tayron.is-inside.me/L7v8lMcb.png can someone help me with this TODO
I would like to stop that after a time from Bot an advertising message comes in a triggered command.
(like dank memer)
what
Oh Translator is shit
Just check if the argument supplied if an invite is included
somthing like that?
I would like to trigger that after 10 times by a Command a Webungs message with is sent (like dank memer)
hmmm
So after 10 times triggering a command such a message as: Vote for me. Sent afterwards
you could use a dict for each user using the command
then just have a counter
so once it goes past 10
it triggers then gets reset back to 0
but how
youre js yh?
jup
ah, i dont rlly know js at all so im not the most help
Tim might be a good one to ask tho
who's tim?
@quartz kindle sorry for the ping m8 but you will know more than me
Would be nice if you can help via DM or sth
wut
@fierce wind you want me to code it?
avoid spoonfeeding
Lemme message you cry
uh no
@quartz kindle can u dm?
Quit mini modding. End of conversation.
@sterile minnow you want your bot to send a message after using a command 10 times right? are the commands locked/disabled afterwards? or they can continue using them? if they can continue using, should it send another message after 10 more have passed? is it per person, like every time a specific person uses it 10 times? or is it global? if anyone uses 10 times? or is it per server? if anyone in the server uses 10 times?
If someone uses a command the counter should be increased with +1 and at the 10th command use the message afterwards. But I do not know how to do that. Yes everything can be used by everyone except bot team stuff @quartz kindle
i mean, you have to decide
per bot i think
global:
person A in server A uses comman 9x
person B in server B uses command 1x
send message
yeah
per server:
person A in server A uses command 9x
person C in server B uses command 1x = no message
person B in server A uses command 1x = send message
per person:
person A in server A uses command 9x
person B in server A uses command 1x = no message
person A in server A uses command 1x = message
global sounds good
then just make a simple global variable
let counter = 0
when someone uses a command:
counter++;
if(counter === 10) { counter = 0; message.channel.send() }
okay thx i'll test it
can even simplify to if(++counter === 10) { counter = 0; message.channel.send(); }
<% var x = client.guilds.get('636090383109128204').members.get(member.user.id).roles.map(r => r.name) %>
<% var y = client.guilds.get('636090383109128204').members.get(member.user.id).roles.forEach(r => r.hexColor) %>
<p style="color:<%=y%>">
<%= x %></p>
why does that not color the roles of y?
wich Coding language?
EJS
because you're just using forEach
not map
i tried .map
as well
with map it returns an array
right
so what would i have to do?
what do you think, if it returns an array
.join ?
would that output a valid color
I want to use GenericGuildMessageReactionEventListener with discord jda and I want to get the msg the user reacted to but it doesnt give me back anything. If anyone can help me, please send me a dm :)
did you print the info in the console?
actually setting the log level to debug would help wouldnt it
not sure since ive never worked with reactions but might provide more information
I need help. can someone please help me? my bot went offline and there's a strange error in the log.
tr?
at timeout.client.setTimeout (/rbd/pnpm-volume/e9fe28aa-eb21-4000-b265-97c9e5e57503/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/ClientManager.js:40:57)
at Timeout.setTimeout [as _onTimeout] (/rbd/pnpm-volume/e9fe28aa-eb21-4000-b265-97c9e5e57503/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/Client.js:436:7)
at listOnTimeout (internal/timers.js:535:17)
at processTimers (internal/timers.js:479:7)
(node:1488) 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(). (rejection id: 2)
(node:1488) [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.```
might of been due to the API lag spike just now
that's the problem
somthing in the bot timed out
so the problem will be resolved within day? @modest maple
Ok @modest maple thank you sir
@vital lark yeah I did, its just giving back null, I am using this code:
public class GenericGuildMessageReactionEventListener extends ListenerAdapter {
public void onGenericGuildMessageReaction(GenericGuildMessageReactionEvent event) {
Message msg = event.getChannel().getHistory().getMessageById(event.getMessageId());
System.out.println(msg);
}
}
@modest maple
dude bot I still rebooted the offline bot from the console this time the console gave error!
@earnest phoenix provide some code
What?
the code that's causing the error
do you know?
the error was not caused by a code! @earnest phoenix
ok then
at timeout.client.setTimeout (/rbd/pnpm-volume/e9fe28aa-eb21-4000-b265-97c9e5e57503/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/ClientManager.js:40:57)
at Timeout.setTimeout [as _onTimeout] (/rbd/pnpm-volume/e9fe28aa-eb21-4000-b265-97c9e5e57503/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/Client.js:436:7)
at listOnTimeout (internal/timers.js:535:17)
at processTimers (internal/timers.js:479:7)
(node:1488) 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(). (rejection id: 2)
(node:1488) [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.```
about 2 hours ago this error appeared on the console at a time and the bot was offline! @earnest phoenix
and it still happens?
handle your errors properly and discord's api was unstable a few hours ago
no problem in the console now, but the bot is constantly rebooting itself on the console, but not online! @earnest phoenix
@earnest phoenix assuming you're on glitch: That error can also happen if the host gets banned.
You can test it by running curl -I https://discordapp.com/api/v7/gateway and seeing if it returns 429 Too Many Requests
I'm going to assume it's your host as I just tried it out and got the same result. Nevermind, mine just randomly restarted.
You'll have to contact glitch support if you want that resolved (or wait it out).
no problem, I changed the boat's token and the boat's fixed! @sudden geyser
no lol
what is the prefix for DSL?
-
ok
It didnt let me use the command
it said my account needed to be verified, but.. my account is already verified
@vital lark
check your email again
client.on('message', message => {
if (message.content == `${prefix}testgf`) {
if(message.author.id == config.owner){}else{return;}
if (message.author.bot) return;
if (message.channel.type === 'dm') return;
let args = message.content.split(' ').slice(1);
if(!args) return message.channel.send("lol")
var id = args[0];
let request = [
client.shard.broadcastEval(`this.guilds.get("${id}").name`).then(v => v.reduce((a, b) => a + b, 0)),
client.shard.broadcastEval(`this.guilds.get("${id}").id`).then(v => v.reduce((a, b) => a + b, 0))
];
Promise.all(request).then(guild => {
client.shard.broadcastEval(`[this.guilds.get("${id}").name, this.guilds.get("${id}").id]`).then(r => {
let embed = new Discord.RichEmbed()
.setColor(`b76e79`)
.setTitle("Test")
.addField("Shard Guild Finder", "Test")
.addField(r[0], r[1])
.setFooter("Shards")
message.channel.send({embed});
});
});
}
});```
How?? :c
how...what
i mean first of all
if(message.author.id == config.owner){}else{return;} is redundant
use != there
If i'm in the shard 2 how to get a guild in the shard 1?
And that's just a detail....
For the message.author.....
why are you getting the guild's name
what
i mean you might as well just get the entire guild object
This is called a test
make your tests more reliable then
Mmmh
Yup
post a specific snippet you need help with then be like "can someone help me fix this"
client.on('message', message => {
if (message.content == `${prefix}testgf`) {
if(message.author.id == config.owner){}else{return;}
if (message.author.bot) return;
if (message.channel.type === 'dm') return;
let args = message.content.split(' ').slice(1);
if(!args) return message.channel.send("lol")
var id = args[0];
Promise.all(client.shard.broadcastEval(`this.guilds.get("${id}")`).then(v => v.reduce((a, b) => a + b, 0))).then(guild => {
let embed = new Discord.RichEmbed()
.setColor(`b76e79`)
.setTitle("Test")
.addField("Shard Guild Finder", "Test")
.setDescription(guild.name)
.setFooter("Shards")
message.channel.send({embed});
});
}
});
I just want to be able to get the details of a guild from one shard to another
And no error in console
bruh
spoonfeed moment
well you have one request in an array
therefore making the array redundant aka take the broadcastEval out of the array
wait im confused
why are you broadcasting eval twice for the same object
Like this?
like what
@earnest phoenix #commands
client.on("message", message => {
if (message.content.startsWith(`${prefix}gf`)) {
if (message.author.id != config.owner) return;
let args = message.content.split(" ").slice(1);
if (!args) return message.channel.send("Please specify an id");
var id = args[0];
let getg = [
client.shard.broadcastEval(`this.guilds.get("${id}")`)
]
Promise.all(getg).then(guild => {
let e = new Discord.RichEmbed()
.setColor(`b76e79`)
.setTitle("Shard Guild Finder")
.setDescription(guild.name)
.setFooter("Shard Guild Finder");
message.channel.send({ embed: e });
console.log(guild)
});
}
});```
But `d.gf 646090515934085141`
Console: https://pastebin.com/ZsjdUjsU
Screen: https://media.discordapp.net/attachments/446482621707452426/648045424959029258/unknown.png?width=400&height=215
Promise.all(client.shard.broadcastEval(`this.guilds.get("${id}")`))```
because this does not work
Are you looking to get a list of guilds?
No
Just one guild
If i'm in the shard 2 i want to get a guild in the shard 1
My server in shard 2
My server in shard 1
have you tried logging what: client.shard.broadcastEval(`this.guilds.get("${id}")`) brings back?
No but
Promise.all(getg).then(guild => {
let e = new Discord.RichEmbed()
.setColor(`b76e79`)
.setTitle("Shard Guild Finder")
.setDescription(guild.name)
.setFooter("Shard Guild Finder");
message.channel.send({ embed: e });
console.log(guild)
});```
console.log(guild) = https://pastebin.com/ZsjdUjsU
:/
But usually a good practice is to log what everything returns so you can make sure it isn't messing up anywhere
But
like console.log(getg)

idk man, I still think you should log everything else
I don't have any experience with shards
I don't think its usually in two sets of square brackets 
Try doing let getg = client.shard.broadcastEval.. instead of let getg = [...]
Well what did it bring back
An error
What error 
Well, for the getg promise to happen, he asked me to put them on because it's a promise.all
I go to sleep
Maybe try promise.one
accounce?
Do you mean announce?
What kinda of announce command?
Announcement between multiple guilds?
Kinda need more info
@slender mountain normal announcement command
Normal as in...?
When I do !announce <announcement> what do you want to happen?
@slender mountain ah like https://gist.github.com/XenoCraftMC/7c09305237242351e128a8f83d715ad9
This code
client.on("message", message => {
if (message.content.startsWith(`.announce`)) {
let args = message.content.split(" ").slice(1);
if (!args) return message.channel.send("Please specify an announce");
var ann = args[0];
message.delete()
message.channel.send(ann)
}
});```
Ah ok
Good bye i'm tired
Let me try
That only sends it to the channel the command was used in though
client.on("message", message => {
if (message.content.startsWith(`.announce`)) {
let args = message.content.split(" ").slice(1);
if (!args) return message.channel.send("Please specify an announce");
var ann = args[0];
message.delete()
message.channels.find("name", "announcment").send(ann)
}
});```
Bye

@slender mountain oo
And this one isn't working
Give me the error
Ah wait
And copying and pasting code will never help you
Okk
Ik
Can you give me the error?
client.on("message", message => {
if (message.content.startsWith(`.announce`)) {
let args = message.content.split(" ").slice(1);
if (!args) return message.channel.send("Please specify an announce");
var ann = args[0];
message.delete()
message.channels.find("name", "announcment").send(ann)
}
});```
the error of this code
``/app/commands/admin/Announce.js
02 PM
(function (exports, require, module, __filename, __dirname) { module.exports = class NewsCommand extends Command {1:02 PM
``
This is the error
Lol

Ah any problem
π
client.on("message", message => {
if (message.content.startsWith(`.announce`)) {
let args = message.content.split(" ").slice(1);
if (!args) return message.channel.send("Please specify an announce");
var ann = args[0];
message.delete()
message.guild.channels.find("name", "announcment").send(ann)
}
});```
Test this
Ik
It works in the channel which I use the command @earnest phoenix
Nope
message.guild.channels.find("name", "announcment")```
It works on another channel also @earnest phoenix
Please read this
Oh
And stop ping i'm here
Ok
Again
This code
Ty
It works in the channel I use the cmd
I want like
.announce #channel text
@earnest phoenix
I'm a slave?
Ah sorry
And this code is nice
What's the problem?
Nothing
How about you show what happens when you try to use the command
also @earnest phoenix why is ann = args[0] 
@slender mountain ups
that would only get one word
you would want it to be var ann = args.splice(1).join(" ")
πΆ
client.on("message", message => {
if (message.content.startsWith(`.announce`)) {
let args = message.content.split(" ").slice(1);
if (!args) return message.channel.send("Please specify an announce");
var chan = args[0].replace(/\D/g,"");
var ann = args.splice(1).join(" ");
message.delete()
message.guild.channels.find("id", chan).send(ann)
}
});```
Ty i'm tired and raj thinks I'm a slave
When he's happy I'll go sleep
@earnest phoenix no I don't and sorry
Test this code
Yeah this one ok
Perfect
Bye
Bye
How bad is .broadcastEval on performance?
I am trying to play a music file thats saved on my pc but when I run the command nothing happens .-. Code:
[Command("play", RunMode = RunMode.Async)]
public async Task PlayAsync(IVoiceChannel channel = null)
{
try
{
channel = channel ?? (Context.User as IGuildUser)?.VoiceChannel;
if (channel == null) { await Context.Channel.SendMessageAsync("User must be in a voice channel, or a voice channel must be passed as an argument."); return; }
var audioClient = await channel.ConnectAsync();
Stream output = CreateStream("Avenged Sevenfold - 05 - Gunslinger.mp3").StandardOutput.BaseStream;
AudioOutStream stream = audioClient.CreatePCMStream(AudioApplication.Music);
await output.CopyToAsync(stream);
}
catch (Exception e)
{
Console.WriteLine(e + "Stopped audio stream");
}
}
private Process CreateStream(string filePath)
{
return Process.Start(new ProcessStartInfo
{
FileName = "ffmpeg.exe",
Arguments = $"-hide_banner -loglevel panic -i \"{filePath}\" -ac 2 -f s16le -ar 48000 pipe:1",
UseShellExecute = false,
RedirectStandardOutput = true
});
}
Console Output:
09:45:26 Audio #1 Connecting
09:45:27 Audio #1 Unknown OpCode (8)
09:45:27 Audio #1 Connected
whats the alternative for db.updateValue in quick.db v7
i read the docs and tried using set and it didn't work
here's my code:
client.level.set(message.author.id + message.guild.id, 1).then(i => {
let messages;
if(i.value === 25) messages = 25;
else if (i.value === 50) messages = 50;
else if (i.value === 100) messages = 100;
if(!isNaN(messages)) {
client.level.set(`lvl_${message.author.id + message.guild.id}`, 1).then(o => {
message.channel.send(new Discord.RichEmbed()
.setAuthor("You leveled up!", message.author.avatarURL)
.setDescription(`You are now level \`${o.value}\``)
)
console.log(`${message.author.id} leveled up to level ${o.value} || messages sent: ${messages}`)
})
}
})
(client.level is a table)
error:
(node:27787) UnhandledPromiseRejectionWarning: TypeError: client.level.set(...).then is not a function```
use await/async instead of .then
- proper usage of then is
.then(smh => smh.edit('Correct .then usage'))proper usage of editing messages
quickdb is notoriously bad for lack of documentation and confusing versioning
supposedly, v7 doesnt even use promises at all, it should be all sync, from their examples, but you have to actually look at the source code to be sure as nothing is explained anywhere
I have question about Eris: how to get latency from Client object?
Does anyone know how to make propely global functions because right now they works but my ide gives me errors
That shouldn't even work?
it does
You called it functions ?
can give me example?
You can add stuff to module.exports and then easily require them
kk lemme try
require will return whatever you put in there
k now it only gives errors on func.js
not anymore on the bot file
my func.js
is it possible for me to see what servers my bot is in? I know in how many servers it's in but can I see which ones?
What library?
me? or totem?
^^
Totempalen
I can see that you're using Discord.js @restive furnace
k
Hm, I have no experience with python so I can't help you there, sorry
ah okay, no problem
thanks, I'll try that right now
k i fixed my func.js
Hi
I setup the Webhook in website but I'm not receiving messages if someone upvote.
How to setup
ur code rn?
k
Does anyone know how to get this working? js let user; if (args[0]) { user = message.mentions.users.first() || message.guild.members.find(val => val.username === args.join(" ")) || message.guild.members.find(val => val.tag === args.join(" ")) || message.guild.members.find(val => val.id === args[0]); if (!user) { return message.channel.send( "User with the search was not found. Search: `" + args.join(" ") + "`" ); } else { user = await message.guild.fetchMember(user.id); } } else { user = message.author; } //func.log(user); message.channel.send(user.id);this only works with userinfo (no args) and userinfo mention and userinfo userid only
@restive furnace if you're trying to match the username & tag: a GuildMember does not have those properties. You'll have to get the user property after finding it.
log(`YΓΌklenen komut: ${props.help.name}.`);
^
TypeError: Cannot read property 'name' of undefined
Jump Toat files.forEach.f (/app/bot.js:41:39)
at Array.forEach (<anonymous>)
Jump Toat fs.readdir (/app/bot.js:39:9)
at FSReqCallback.args [as oncomplete] (fs.js:145:20)
please help I added a command to my bot and started to get this error in the log. how do I fix this mistake?
but the part where he made the mistake is attached to the command. why does this problem occur when the command has everything it needs ? I'll give you the command. @modest maple
what ever name is, hasnt been assigned anything
What? Yandex translation doesn't translate correctly what you want to say!. @modest maple
@modest maple @sudden geyser how then i can do it, because the idea of that is that u dont need to mention a user like userinfo ChillFish8
(sry for ping)
what
the fetching part
get the user object in the find function and compare the username
k
@earnest phoenix check your exports by the way
const Discord = require("discord.js");
const client = new Discord.Client();
exports.run = async (bot, message, args) => {
let nesne = args[0];
if (!nesne)
return message.channel.send("Please User ID?");
db.set(`blacklist_${nesne}`, "aktif");
message.channel.send(`**${nesne}** User Black list!!`);
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["karaliste","black-list"],
permLevel: 4
};
exports.help = {
name: "blacklist",
description: "[Adminastrator Command]",
usage: "blacklist ID"
};```
look, the command has everything you need, but the error continues!
@sudden geyser
check all your files
or log each file name until it stops and you'll know what file it is
MongoTimeoutError: Server selection timed out after 30000 ms at Timeout.setTimeout [as _onTimeout] (/rbd/pnpm-volume/f86f98b5-30ff-4543-805e-dac179316552/node_modules/.registry.npmjs.org/mongodb/3.3.4/node_modules/mongodb/lib/core/sdam/topology.js:897:9)
how would i fix this?
Anyone know a good API for getting info about colors?
Hi, I'm trying to make an eval command in Python, and it returns me this error : Unexpected quote mark, '"', in non-quoted string
Does someone knows why it returns me that?
My code :
@commands.command()
async def run(self, ctx, code):
if ctx.author.id == 465129603208577044:
execute = await eval(code)
print(execute)
await ctx.send(execute)
@modest maple
Ignoring exception in command run:
Traceback (most recent call last):
File "C:\Users\mail\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\bot.py", line 863, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\mail\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\core.py", line 721, in invoke
await self.prepare(ctx)
File "C:\Users\mail\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\core.py", line 685, in prepare
await self._parse_arguments(ctx)
File "C:\Users\mail\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\core.py", line 599, in _parse_arguments
transformed = await self.transform(ctx, param)
File "C:\Users\mail\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\core.py", line 452, in transform
argument = view.get_quoted_word()
File "C:\Users\mail\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\view.py", line 174, in get_quoted_word
raise UnexpectedQuoteError(current)
discord.ext.commands.errors.UnexpectedQuoteError: Unexpected quote mark, '"', in non-quoted string
thats unusual
try read through that
not sure if thatll be much help
@slender thistle Ok, but why is it returning that?
Have you tried printing code
@slender thistle I can't, it returns the error before I can print(code)
But if I use \" instead of " it works
I suggest you ask discord.py server with that since I never experienced that error
I asked
You asked in Discord API server
Either wait for answer there or re-ask in discord.py server that ChillFish sent above
I'm ngl, shouldn't discord.py handle that by default
wut
idk
i remember reading somthing about IOS build of discord started adding '
but thats probably gone
@novel oar I just realized reading the convo in discord.py server
Read the consume rest tag they sent
Im getting this error: Invalid or uncached id provided. when i do example n*ui Lumap (he is real user)
My code: https://hastebin.com/egukezozaj.cs
first of all, its a promise, it needs to be then'ed or awaited
second of all, it returns the guild, not the fetch results
because this method is used for filling up the guild cache
the correct course of action for getting a user by their username should be:
-> guild.members.find
-> if no result
-> await guild.fetchMembers
-> guild.members.find
k lemme try
this wont work ```
message.guild.members.find(val => val.username === args.join(" "))
@quartz kindle
<head>
<title>
</title>
</head>
<body>
Xetaah<br>
and more on your Discord server
<p> Discordtip is tutututu
</p>
<table>
<tr>
<td>Invite Xetaah</td><td>See how to use it!</td>
</tr>
</table>
<p style="background-color:#6b70c4;">
</p>
</body>
</html>
css doesn't work
??
@prime cliff
Try put some text and see if it shows the blue background
<p style="background-color:#6b70c4;">
Right here
</p>```

@prime cliff and for add a color in all bot page
would be ```.body {
background-color:#6b70c4;
.body {
}


let me see if it works xd
@prime cliff doesnt work 
should i send all code again? i think it will be more faster
You're really bad at css lol
really bad*
i mean i used css a lot but stopped using it like for months
body {
background-image: url("https://i.pinimg.com/originals/82/8b/ee/828beeae04781fb166ca613ee75603ee.jpg") ;
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.bot-name {
color: #fb5a04;
}
.bot-description {
color: white;
}
.bot-tags-title {
color: white;
}
.owners {
color: white;
}
.column {
color: white;
}
</style>```
Also some elements may required !important; to override DBL's css e.g color: white !important;
@prime cliff but for background?
@restive furnace val is a member, members dont have usernames, users do
val.user.username
Thanks it worked!
I do and the bot does keep running even after that but
is it supposed to be tts?
tts=tts
you should always do permission checks before executing the command
not needed
That's the core module
he means check the bot has the ability to send embeds
check if your bot can do x before doing x
you can compare the permission ID the bot has to what it needs
you'll prevent yourself from getting errors
it's bad practice to dm the user
reply to them in the same channel they executed the command
I think I'll just let my bot rest for now here cuz it's working fine on all the other guilds
Oh !
so it cant send anything rn
So how do I like unmute it π³
Wait no way it does
apparently it was sending unknown command on every thing that included its prefix
its not fake
Whom do I contact any idea?
Chill, are you familiar with libraries to play with pixel colors in real time
Hmm?
but i dont rlly use it much or at all
@nocturne lotus Contact the moderator who muted your bot

my friend does real time pixel colours in pygame
Fucking 'ell
I dmed him
the worst thing is it fucking works xD
Hope he replies quick
He did reply super fast
what did he say
He's checking it in test server
how to i handle dms to a shard if every dm is sent to shard 0?
Ok so I'm kind of having a little bump in my code. Basically I'm trying 2 make a bug report command. So something like this -bugreport it says error 1 and my proof or image is
then what i need it 2 do is send the message 2 a private bug report channel with the image. The code i am currently using is right here >>> https://hastebin.com/oxocoluvih.js So if any 1 knows how 2 add this feature, just ping me. NOTE: I have tried multiple things 2 try and do this but none work. Thanks for any/all help!
How can I dedicate one shard to taking care of certain functions/commands?
Just a simple if(shard.id === n) return x?
else (return Y)
And is it possible to have one shard not deal with guilds at all? Just leave it hanging around strictly for DMs?
not really no @near ether as you cant specify what guilds are on what shard along with depending on the user they will be connecting to a diffrent shard
once again
not rlly possible
as that means
if a user DMs your bot that is on any other shard other than 0 it just wont respond
which just isnt good
Yea my bot uses DMs for a turn based game but if sharding forces DMs to shard 0 then I guess thatβs a rip
you literally don't have to track anything i think
the api provides the uses number in the invite object
yh
huh so that guide is outdated now? (or just useless?)
it has always been like that
i believe atleast for D.py the invite gives you the uses
but it should for everything
as it tracks it for servers
that guide is probably for tracking who used what invite on member join (which spams the API)
Task exception was never retrieved
future: <Task finished coro=<Server_Response() done, defined at C:/Users/ChillFish8/Documents/The_Innkeeper_Database/TheInnkeeper.py:62> exception=gaierror(11001, 'getaddrinfo failed')>
Traceback (most recent call last):
File "C:/Users/ChillFish8/Documents/The_Innkeeper_Database/TheInnkeeper.py", line 66, in Server_Response
description=(f"**OrcPub Server response:**\n"
File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\pythonping\__init__.py", line 52, in ping
comm = executor.Communicator(target, provider, timeout, socket_options=options, verbose=verbose, output=out)
File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\pythonping\executor.py", line 224, in __init__
self.socket = network.Socket(target, 'icmp', source=None, options=socket_options)
File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\pythonping\network.py", line 21, in __init__
self.destination = socket.gethostbyname(destination)
socket.gaierror: [Errno 11001] getaddrinfo failed
Exception ignored in: <function Socket.__del__ at 0x0000023C41DCE678>
Traceback (most recent call last):
File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\pythonping\network.py", line 56, in __del__
if self.socket:
AttributeError: 'Socket' object has no attribute 'socket'
Exception ignored in: <function Communicator.__del__ at 0x0000023C41DDCC18>
Traceback (most recent call last):
File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\pythonping\executor.py", line 233, in __del__
if self.socket:
AttributeError: 'Communicator' object has no attribute 'socket'
oh what would we do without the custom Lib not liking /
How do you do webhooks with sharding? Wonβt multiple shards be already occupying the same given port?
webhooks don't need sharding
have your webhook server on your sharding manager
and then on vote send a message to the relevant shard
or do whatever with it
a webhook server?
iirc you just have to create a webhook, slap that shit in your code and send payloads to it
i dont see the server aspect of it unless you're talking about like a wrapper to interface with the webhook or smth
sometimes
i just hate google
and their freaking api
how is it so complicated and have such awful docs
smh smh
i just assumed he was talking about DBL webhooks
for which your bot runs a server to receive them
for sending webhooks to discord, sharding is irrelevant
hey i just created a canvas picture how do i put it to a embed
.attachFile(new Discord.Attachment(attachment, 'xd.png'))
.setImage("attachment://xd.png"); ??
something like that yes, test it
this was a disaster but i did it
what
the screenshot didn't send
wow
so, quick explanation
server and client run mods which are able to connect to a c# signalR server
that way i can easily exchange data between programs made in entirely different languages
- nice
i also did this cause why not
i want to buy a second monitor
overall tho thats rlly quite cool
but i'd also like to buy a wall mount and i can't find one around me
so i have to order one
same
So I'm working on this kick command... In line 33, I want my bot to send an error when the user to be kicked has a higher role than the bot itself. But, the bot surpasses that checkpoint on line 33 and sends a Missing Permissions error. The odd thing is, it does error on line 30 when appropriate, but not on 33.
Code: https://gist.github.com/SinistreCyborg/f147da54b4d8ee7a3c1547675c22054f
(Eris)
In a class, can I set up a setter or getter like this?
class whatever {
constructor() {}
get 'x.y' () {}
}```
wanna know some more dumb shit you can do?



