Code Monkey home page Code Monkey logo

guilded.js's Introduction

guilded.js's People

Contributors

ashcorpdev avatar auskarlos87 avatar dastormer avatar firemario211 avatar goodone120 avatar itznxthaniel avatar jmtk avatar renovate[bot] avatar rkoval avatar saboooor avatar serverdeveloper9447 avatar skillz4killz avatar uhuh avatar weismanns avatar zaida04 avatar zanedragonborn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

guilded.js's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): update dependency typedoc to v0.24.7

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

dockerfile
services/proxy/Dockerfile
  • node 20-alpine
  • node 20-alpine
npm
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

  • Check this box to trigger a request for Renovate to run again on this repository

Send images

Can I send or upload an image to a guilded channel? Using this library?

Action Required: Fix Renovate Configuration

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"'

Website Not Responsive if width is below 1000px

Describe the bug

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.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://guilded.js.org/docs/guilded.js
  2. Open dev tools
  3. Open responsive thing (whatever it is called to view different heights and widths)
  4. Change width to 1000px
  5. scroll down a bit and check the text. It is overlapping

Expected behavior

The text should not be overlapping?
It works fine after 767px but still, in between 1000 and 767, the bug is still there.

Screenshots

Screenshot_20230202_150627




Please complete the following information

  • Firefox 109.0

Embeds don't send

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

  • NodeJS version: 18.0.0
  • NPM version 6.x
  • Package version: 0.7.1

Additional context
Add any other context about the problem here.

msg.author and msg.member are always null

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

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

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.
grafik

grafik

Please complete the following information

  • NodeJS version (node -v) v19.1.0
  • NPM version (npm -v) 8.19.3
  • Package version (npm ls guilded.js) [email protected]

Additional context
Add any other context about the problem here.

Allow for user-supplied webhook body

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.

Add support for mentions

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.

doc

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 ? :)

Feature request: add `channel.createWebhook()` function

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",
})

add examples to popular methods

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

Syntax error

Describe the bug
It is just a syntax error in the package.

To Reproduce
Steps to reproduce the behavior:

  1. Install [email protected] using npm
  2. Add the necessary code
  3. Run it using node index.js
    Expected behavior
    The bot should start up.

Screenshots
image
Please complete the following information

  • NodeJS version (node -v): 16.7.0
  • NPM version (npm -v): 7.20.3
  • Package version (npm ls guilded.js): 0.23.5

Additional context
Null

De-complex event types

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.

Add function(s) for getting emojis and roles in a server

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:

  • whether the emote is animated or not
  • emote id
  • emote creation date/time
  • role id
  • role permissions list
  • role created date/time

the animated boolean is a must.

better logging in function

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?

@guildedjs/gil tasks not a folder in node_modules

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:

  1. Setup a project using guilded.js/gil
  2. Start the project
  3. See error in terminal

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

  • NodeJS version: v16.15.1
  • NPM version: 8.4.0
  • Package version: 0.13.0

Additional context
No.

Experimental Fetch API Error

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:

  1. create a "messageCreated" event handler
  2. start the code
  3. send a message in the same guild where is the bot
  4. check the terminal

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.
Capture d’écran 2023-06-28 à 17 12 51
Capture d’écran 2023-06-28 à 17 13 09

Please complete the following information

  • NodeJS version (node -v) => v18.12.1
  • NPM version (npm -v) => 8.19.2
  • Package version (npm ls guilded.js) => [email protected]

Additional context
Add any other context about the problem here.
/////

Websocket Ping is sometimes null

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)

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

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.
grafik

Please complete the following information

  • NodeJS version (node -v) v18.4.0
  • NPM version (npm -v) 8.18.0
  • Package version (npm ls guilded.js) [email protected]

Additional context
Add any other context about the problem here.

Forum Topic Comments

I have a forum system on my bot which will use comments and since I don't think Guilded.JS can currently make forum comments, I can't add it yet.

Guilded's API docs for forum comments can be seen here.

WebhookClient throws error if masquerade isn't provided.

Describe the bug
When creating an instance of WebhookClient without providing a masquerade, an error is thrown.

To Reproduce
Steps to reproduce the behavior:

  1. Run the following code on the latest version of guilded.js
import { Client as GuildedClient, WebhookClient } from "guilded.js";
let hook = new WebhookClient({id: "abc", token: "123"})
await hook.send({content: "hello"})
  1. See the following error thrown:
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

  • Node.js version: 18.7.0
  • npm version: 8.15.0
  • Package version: 0.13.16

Additional context
I can't repro this on 0.13.8

Comments structure (announcements, calendar event, docs, forum)

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
}

add level and exp to member class

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.