zaida04 / guilded.js Goto Github PK
View Code? Open in Web Editor NEWA library for creating bots with the guilded.gg bot API.
Home Page: https://guilded.js.org
License: MIT License
A library for creating bots with the guilded.gg bot API.
Home Page: https://guilded.js.org
License: MIT License
Describe the bug
When trying to send an embed, I get an error:
Error: [GuildedAPIError:400:POST] /channels/84e7a9e2-b595-493e-9a39-18ed347b92a8/messages - data must have required property 'content', data must have required property 'embeds', data must match a schema
To Reproduce
Steps to reproduce the behavior:
var obj = {
embeds: [{title: 'Test'}]
};
message.reply(obj);
Expected behavior
Should send the embed as expected
Screenshots
I believe the issue originates from the compiled version of Message.js
/** Send a message that replies to this message. It mentions the user who sent this message. */
reply(content) {
var _a;
if (typeof content === "string")
content = { content };
return this.client.messages.send(this.channelId, { content: content.content, replyMessageIds: (_a = content.replyMessageIds) !== null && _a !== void 0 ? _a : [this.id] });
}
This compiled version does not spread the properties as denoted in the .ts file:
/** Send a message that replies to this message. It mentions the user who sent this message. */
reply(content: RESTPostChannelMessagesBody | string) {
return this.client.messages.send(
this.channelId,
typeof content !== "string"
? {
...content,
replyMessageIds: content.replyMessageIds ? [this.id, ...content.replyMessageIds] : [this.id],
}
: content,
);
}
Please complete the following information
Additional context
Add any other context about the problem here.
Create a base comment structure, and make sub classes that inherit from it for the different structures that can have comments (announcements, calendar event, docs, forum). Can be split up into multiple PRs, doesn't have to be all in one lump-sum, but the base comment model should be done before working on any sub structures. The goal of the base comment model is that sub classes can be created with as little redundancy as possible.
class Comment extends Base {
// props that are shared by all comments
}
class AnnouncementComment extends Comment {
// props specific to this comment
}
Full list of events: https://www.guilded.gg/docs/api/websockets
Figure out which events aren't covered by guilded.js (https://guildedjs.github.io/types/guilded_js.ClientEvents.html).
Bonus points for creating functions that can be reused in a bunch of events. That way we aren't repeating a lot of boilerplate code.
Describe the bug
A clear and concise description of what the bug is.
msg.author and msg.member are always null.
To Reproduce
Steps to reproduce the behavior:
Try to access msg.author or msg.member
Expected behavior
A clear and concise description of what you expected to happen.
That the author and member are not null and return the right user object.
Screenshots
If applicable, add screenshots to help explain your problem.
Please complete the following information
node -v
) v19.1.0npm -v
) 8.19.3npm ls guilded.js
) [email protected]I would love to be a maintainer
Is your feature request related to a problem? Please describe.
Not really, this would allow us to create webhooks the same was as discord.js.
Describe the solution you'd like
In discord.js, there is a channel.createWebhook()
function that allows for us to create webhooks in a channel but there isn't an equivalent in guilded.js.
Describe alternatives you've considered
Currently, I use the client.rest.router.createWebhook()
function to do this, but it's a bit more complex than channel.createWebhook()
in discord.js.
Additional context
// This is what needs to be done currently
let a = await client.rest.router.createWebhook(channelId, {
channelId,
name: "bridge",
});
// This is what I want to be able to do
let a = await channel.createWebhook({
name: "bridge",
})
Describe the bug
A QoL bug fix. Many of the methods used throughout the GlobalManagers have optional parameters for exampleclient.members.fetch(serverId: string, memberId: string, force?: boolean)
. Within the docs it makes it look like the force
parameter is required.
Go to https://guilded.js.org/docs/guilded.js/GlobalMemberManager#fetch
Expected behavior
Clearly defined optional parameters
Can I send or upload an image to a guilded channel? Using this library?
it is not a bug in the actual content, but the responsive website. If viewed below 1000px width, the https://guilded.js.org/docs/guilded.js starts overflowing and text starts overlapping.
Steps to reproduce the behavior:
The text should not be overlapping?
It works fine after 767px but still, in between 1000 and 767, the bug is still there.
Please complete the following information
[ Deleted ]
Is your feature request related to a problem? Please describe.
Guilded.js doesn't support https://www.guilded.gg/docs/api/channels/Mentions, which I need for my bot
Describe the solution you'd like
Support it
Describe alternatives you've considered
shrug
Additional context
Add it and add it to massage content so I can send it with my embed.
Well I am logging in Discord.js like this:
token.json file:
{token": "my_token"}
index.js file:
const Discord = require('discord.js'); // Discord.js v14
const fs = require("fs");
const client = new Discord.Client({ intents: [blah, blah, blah] });
get_values();
function get_values() {
fs.readFile('./src/values/token.json', (err, data) => { // reading file
if (err) {
console.log('TOKEN NOT FOUND!');
process.exit(1)
};
console.log('got values!');
client.login(data.token) // logging in
)};
};
client.on("messageCreate", async msg => { // when got new message
msg.channel.send({ content: "some respond lol" })
});
client.once('ready', () => { // when logged in
console.log('logged in!')
})
But how can i set my client with out providing any token?
I tried this, but got error "No token provided.":
const Guilded = require('guilded.js') // v0.15.1
const fs = require("fs");;
const client = new Guilded.Client({token: fs.readFile("./src/values/token.json", (err, data)=>{
if (err) {
console.log('TOKEN NOT FOUND!');
process.exit(1)
};
return data.token;
})}); // logging in
and I tried this, but also got theerror "No token provided.":
work()
async function work() {
const Guilded = require('guilded.js') // v0.15.1
const fs = require("fs");
let gtoken
await fs.readFile("./src/values/token.json", (err, data)=>{
if (err) {
console.log('TOKEN NOT FOUND!');
process.exit(1)
};
gtoken = data.token;
})
const client = new Guilded.Client{ token: gtoken }
}
How can i fully initialize my bot and get a token before logging in?
Hi there,
I just don't know where is the documentation.
The home page redirect on itself for the documentation.
So, where is the doc ? :)
Describe the bug
The link in the readme 404s
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect there to be an NPM package there
Please complete the following information
Additional context
I'd like to pull this library in to start developing a bot, but there isn't a package.
Additionally, going to the old package has a big red deprecated banner pointing to the same link, which is a 404
Is your feature request related to a problem? Please describe.
I've realized that a lot of our types for events are overly complex and can lead to a frustrating developer experience when it comes to handling these events. Take the memberUnbanned event. The parameter that's emitted could be either a MemberBan
object, or the raw ws event data itself. This leads to having to do the following:
client.on("memberUnbanned", (memberBan) => {
const isMemberBanObj = memberBan instanceof MemberBan;
const reason = isMemberBanObj ? memberBan.reason : memberBan.serverMemberBan.reason;
const userId = isMemberBanObj ? memberBan.target.id : memberBan.serverMemberBan.user.id;
const authorId = isMemberBanObj ? memberBan.createdById : memberBan.serverMemberBan.createdBy;
});
This is a sub-par developer experience. A developer shouldn't have to structure their event to handle two different potential objects. This isn't the only event that this happens in, as it also happens in:
Describe the solution you'd like
For events that emit either a structure or the ws data dependent on if a structure is cached or not, just go with the ws data (example, just make the type WSChatMessageDeletedPayload["d"]
). That makes it a more simple interface, and also lets the user decide if they need the actual structure from cache or not.
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Location: .github/renovate.json
Error type: The renovate configuration file contains some invalid settings
Message: Invalid schedule: 'Invalid schedule: Failed to parse "every 2 weeks on the first of the week"'
I was creating a server info command, and everything was going well, until I wanted to show the amount of roles and emotes, it's not really necessary to add, but how else would a general member know about it? I would want my bot to show all valid information to be shown so the user can actually get to know something when they run the command.
maybe like the <members>.fetchMany(serverId)
function, there should be the same for emotes and roles
for example:
await client.roles.fetchMany(serverId)
await client.emotes.fetchMany(serverId)
There are literally no alternatives possible, there are no role/emote function matching my use, there are only functions to add roles to user or remove roles from user.
Like all the other fetchMany()
functions, these both should return useful information like:
the animated boolean is a must.
Describe the bug
When creating an instance of WebhookClient without providing a masquerade, an error is thrown.
To Reproduce
Steps to reproduce the behavior:
import { Client as GuildedClient, WebhookClient } from "guilded.js";
let hook = new WebhookClient({id: "abc", token: "123"})
await hook.send({content: "hello"})
C:\Users\william\Projects\bolt\node_modules\@guildedjs\webhook-client\dist\WebhookClient.js:7
constructor(webhookConnection, { username, avatarURL }) {
^
TypeError: Cannot destructure property 'username' of 'undefined' as it is undefined.
at new WebhookClient (C:\Users\william\Projects\bolt\node_modules\@guildedjs\webhook-client\dist\WebhookClient.js:7:38)
at guildedClient.bridgeSend (file:///C:/Users/william/Projects/bolt/platforms/guilded.js:123:14)
at client.bridgeSend (file:///C:/Users/william/Projects/bolt/class.js:252:33)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v18.7.0
Expected behavior
This should not be thrown, as providing a masquerade in the constructor should be optional.
Please complete the following information
Additional context
I can't repro this on 0.13.8
Describe the bug
When i fetch a message with the "messageCreated" event in TypeScript, I have the following error:
(Use `node --trace-warnings ...` to show where the warning was created)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
No Error
Screenshots
If applicable, add screenshots to help explain your problem.
Please complete the following information
node -v
) => v18.12.1npm -v
) => 8.19.2npm ls guilded.js
) => [email protected]Additional context
Add any other context about the problem here.
/////
Is your feature request related to a problem? Please describe.
This isn't related to a problem. I'd like to be able supply a webhook body directly to the WebhookClient.send function in guilded.js
Describe the solution you'd like
I'd like it if the WebhookClient.send function would accept both a webhook body while still allowing for the current system with multiple arguments to be used
Describe alternatives you've considered
I've considered creating my own function to destruct an object and pass it to the WebhookClient.send function.
Additional context
This would be pretty useful for my bot, which uses Webhooks to bridge different chat apps.
Is your feature request related to a problem? Please describe.
Add Announcement class and cache enabled manager
Can be modeled after GlobalCategoryManager Category
Describe the bug
A clear and concise description of what the bug is.
Websocket Ping is sometimes null
To Reproduce
Steps to reproduce the behavior:
Try to print out Websocket ping (client.ws.ping)
Expected behavior
A clear and concise description of what you expected to happen.
The correct ping instead of null.
Screenshots
If applicable, add screenshots to help explain your problem.
Please complete the following information
node -v
) v18.4.0npm -v
) 8.18.0npm ls guilded.js
) [email protected]e.g. :
const member = await client.members.fetch(serverid, memberid);
console.log(member.level, member.xp)
and it will return actual level and xp for guild.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are awaiting their schedule. Click on a checkbox to get an update now.
These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
services/proxy/Dockerfile
node 20-alpine
node 20-alpine
apps/docs/package.json
@fortawesome/fontawesome-svg-core ^6.4.0
@fortawesome/free-solid-svg-icons ^6.4.0
@fortawesome/react-fontawesome ^0.2.0
@next/font ^13.4.2
next 13.4.2
react 18.2.0
react-code-blocks 0.0.9-0
react-dom 18.2.0
@types/node 18.16.12
@types/react 18.2.6
@types/react-dom 18.2.4
autoprefixer ^10.4.14
postcss ^8.4.23
tailwindcss ^3.3.2
typedoc 0.23.24
typescript 5.0.4
package.json
@changesets/cli ^2.26.1
@types/node 18.16.12
dotenv 16.0.3
eslint 8.40.0
eslint-config-neon 0.1.47
gen-esm-wrapper 1.1.3
husky 7.0.4
lint-staged 13.2.2
nodemon ^2.0.22
pnpm 8.5.1
prettier 2.8.8
rimraf 5.0.1
ts-node 10.9.1
typedoc 0.23.24
typedoc-plugin-remove-references 0.0.6
typedoc-plugin-rename-defaults ^0.6.5
typedoc-plugin-resolve-crossmodule-references ^0.3.3
typescript 5.0.4
packages/gil/package.json
@discordjs/collection ^1.5.1
colorette ^2.0.20
dotenv ^16.0.3
typescript 5.0.4
packages/guilded-api-typings/package.json
openapi-typescript ^6.2.4
typescript 5.0.4
packages/guilded.js/package.json
@discordjs/collection ^1.5.1
typed-emitter 2.1.0
@types/node 18.16.12
typescript 5.0.4
packages/rest/package.json
form-data ^4.0.0
node-fetch 2.6.11
qs ^6.11.2
typed-emitter 2.1.0
@types/node-fetch 2.6.4
@types/qs ^6.9.7
typescript 5.0.4
packages/ws/package.json
@types/ws 8.5.4
typed-emitter 2.1.0
ws 8.13.0
typescript 5.0.4
services/proxy/package.json
dotenv ^16.0.3
@types/node 18.16.12
typescript 5.0.4
Describe the bug
It is just a syntax error in the package.
To Reproduce
Steps to reproduce the behavior:
node index.js
Screenshots
Please complete the following information
node -v
): 16.7.0npm -v
): 7.20.3npm ls guilded.js
): 0.23.5Additional context
Null
Is your feature request related to a problem? Please describe.
Something that many users are requesting is a demonstration of how to use popular methods (the docs can be become unreadable or prone to confusion when you redirect from like 3 different methods)
Describe the solution you'd like
JSdoc comments for popular methods like message#send, add reaction, etc
Describe alternatives you've considered
Adding guide pages for popular usecases instead
Describe the bug
When using @guildedjs/gil you get the following error: projects\bob\node_modules\@guildedjs\gil\dist\tasks. To make this warning go away, simply create the folder in your src folder.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Runs fine no warnings about the node_modules folder
Screenshots
If applicable, add screenshots to help explain your problem.
Please complete the following information
Additional context
No.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.