open-index/open-npm huggingface dataset:
npm package: @guardbot/chalk
Description: A simple colored logger built for Discord bots.
Author: Aniket
Latest version: 1.0.0

# @guardbot/chalk
> **A simple colored logger built for Discord bots.**

<div>
  <img src="https://raw.githubusercontent.com/guardbotgg/assets/master/made-with-typescript.svg" alt="badge" />
  <img src="https://raw.githubusercontent.com/guardbotgg/assets/master/made-with-love.svg" alt="badge" />
</div >


## 📦 Installation
```bash
$ npm install @guardbot/chalk # via npm
$ yarn add @guardbot/chalk    # via yarn
$ pnpm add @guardbot/chalk    # via pnpm
```


## 🪴 Basic Usage
```ts
import { logger } from '@guardbot/chalk';

logger.info(['client'], 'Bot started');
logger.success(['command'], 'Ping executed');
logger.warn(['cluster'], 'High memory usage');
logger.error(['shard'], new Error('Something broke'));
```


### Scoped Loggers:
```ts
import { logger } from '@guardbot/chalk';

const shardLogger = logger.shard(1);
shardLogger.info([], 'Shard ready');

const commandLogger = logger.command('ping');
commandLogger.success([], 'Command executed');
```


### Custom Colors:
```ts
import { Chalk } from '@guardbot/chalk';

const logger = new Chalk({
  labels: { database: '#4ADE80' }
});

logger.info(['database'], 'Connected successfully');
logger.rgb([255, 100, 50], 'Custom RGB color');
logger.color('#4ADE80', 'Custom Hex Color');
```


### File Logging:
```ts
const log = new Chalk({ file: './logs/bot.log' });
log.info(['client'], 'Saved to file');
```

### Webhook Logging:
```ts
const log = new Chalk({ webhook: 'https://discord.com/api/webhooks/...' });
log.error(['client'], 'Critical failure!');
```

### Timestamps:
```ts
const log = new Chalk({
  timestamps: true,
  timestampFormat: (date) => date.toISOString()
});
```

### Timers:
```ts
logger.time('load');
await doSomething();
logger.timeEnd('load', ['client']);
```


## 🪴 Support Server
<a href="https://discord.gg/invite/GaczkwfgV9" target="_blank">
  <img src="https://discordwidgets.vercel.app/widgets/invite/GaczkwfgV9?theme=dark" alt="Invite" />
</a>
npm package: @guardbot/framework
Description: A simple framework made for building discord bots with discord.js.
Author: Aniket
Latest version: 2.0.0

# @guardbot/framework
> **A simple framework made for building discord bots with discord.js.**

<div>
  <img src="https://raw.githubusercontent.com/guardbotgg/assets/master/made-with-typescript.svg" alt="badge" />
  <img src="https://raw.githubusercontent.com/guardbotgg/assets/master/made-with-love.svg" alt="badge" />
</div >


## 📦 Installation
```bash
$ npm install @guardbot/framework # via npm
$ yarn add @guardbot/framework    # via yarn
$ pnpm add @guardbot/framework    # via pnpm
```

## 🪴 Getting Started

### 1. Initialize the Client
Create your main entry file (e.g., `index.ts`) and initialize the `FrameworkClient`.
```typescript
import { FrameworkClient } from '@guardbot/framework';
import { GatewayIntentBits } from 'discord.js';
import path from 'path';

const client = new FrameworkClient({
  clientOptions: {
    intents: [
      GatewayIntentBits.Guilds,
      GatewayIntentBits.GuildMessages,
      GatewayIntentBits.MessageContent
    ]
  },
  prefix: '!', 
  rootDir: path.join(__dirname),
  registerOnStart: true, 
  guildsToRegister: [],
});

client.login('DISCORD_BOT_TOKEN');
```

### 2. Create a Slash Command
Create a file in your commands directory (e.g., `src/commands/general/ping.ts`).
```typescript
import { SlashCommand } from '@guardbot/framework';

export default SlashCommand({
  name: 'ping',
  description: 'Replies with Pong!',
  commandScope: 'default',
  cooldown: 5000,

  async execute(client, interaction) {
    await interaction.reply({ content: `Pong! 🏓 (${client.ws.ping}ms)` });
  },
});
```

### 3. Create a Message Command
Create a file for prefix-based commands (e.g., `src/commands/legacy/ping.ts`).
```typescript
import { MessageCommand } from '@guardbot/framework';

export default MessageCommand({
  name: 'ping',
  description: 'Replies with Pong!',
  aliases: ['latency'],
  cooldown: 5000,

  async execute(client, message, args) {
    await message.reply({ content: `Pong! 🏓 (${client.ws.ping}ms)` });
  },
});
```

### 4. Create an Event Listener
Create an event file (e.g., `src/listeners/client/ready.ts`).
```typescript
import { Listener } from '@guardbot/framework';

export default Listener({
  name: 'clientReady',
  once: true,

  async execute(client) {
    console.log(`Logged in as ${client.user.tag}!`);
    console.log(`Loaded ${client.commands.size} commands.`);
  }
})
```

### 5. Recommended Project Structure
```bash
src/
├─ commands/
│  └─ general/
│     └─ ping.ts
├─ listeners/
│  └─ client/
│     └─ ready.ts
└─ index.ts
```


## 🪴 Support Server
<a href="https://discord.gg/invite/GaczkwfgV9" target="_blank">
  <img src="https://discordwidgets.vercel.app/widgets/invite/GaczkwfgV9?theme=dark" alt="Invite" />
</a>
npm package: @guardbot/sanitizer
Description: Tiny text sanitizer that's really just a bunch of libraries in a trenchcoat.
Author: aniket091
Latest version: 1.1.0

# @guardbot/sanitizer
> **Tiny text sanitizer that's really just a bunch of libraries in a trenchcoat.**

## **📦 Installation**
```sh
$ npm install @guardbot/sanitizer # via npm
$ yarn add @guardbot/sanitizer # yarn
$ pnpm add @guardbot/sanitizer # pnpm
```

## **🪴 Usage**
```typescript
import sanitizer from '@guardbot/sanitizer';

sanitizer('aéà)àçé');
// 'aea)ace'

sanitizer(someCompletelyUnusableString, 'fallback');
// 'fallback'
```
npm package: @guardian/anghammarad
Description: Notification service for the Guardian's dev teams
Author: Guardian
Latest version: 3.0.3

# Anghammarad Node Client

[Anghammarad](https://github.com/guardian/anghammarad) is a notification service for the Guardian's dev teams.

## Usage

To use Anghammarad from your project, include its client library in
your package.json.

`yarn add @guardian/anghammarad` or `npm install --save @guardian/anghammarad`

The Anghammarad client contains a function that will send a notification.

```js
import { Anghammarad, type AnghammaradNotification } from '@guardian/anghammarad';

const client = new Anghammarad(snsClient, snsTopic);
const notification: AnghammaradNotification = { };
await client.notify(notification);
```

For example

```js
import { Anghammarad, RequestedChannel } from '@guardian/anghammarad';

const client = new Anghammarad(snsClient, snsTopic);

await client.notify({
  subject: "Hello",
  message: "Hi there, something has happened which we'd like to tell you about",
  actions: [{ url: 'https://example.com' }],
  target: { Stack: 'my-stack', Stage: 'CODE', App: 'my-app' },
  channel: RequestedChannel.Email,
  sender: 'my-monitoring-tool',
});
```

### Parameters

| key     | description                                                                    | required | example                                   |
|---------| ------------------------------------------------------------------------------ | -------- |-------------------------------------------|
| subject | The subject line of the message                                                | Y        | "An example alert"                        |
| message | The body of the message                                                        | Y        | "This is an example alert. Please ignore" |
| actions | An array of objects containing a cta and/or a url                              | Y        | [{"url": "https://example.com}]           |
| target  | A target object containing one or more of Stage, Stack, App and Account number | Y        | {Stage: "CODE"}                           |
| channel | One of the accepted channel types                                              | Y        | "prefer hangouts"                         |
| sender  | The name of the process sending the alert                                      | Y        | "my app"                                  |

### Channels

Anghammarad can currently notify via either email or Google chat. The channel param can be used to pass the required notification channel. The prefix `prefer ` can be added to specify that where possible a particular channel should be used but if not, use another available channel. The `RequestedChannel` enum is provided with a list of available values.

## Releasing the client
On merge to `main`, the client is published to npm as `@guardian/anghammarad` using [`changesets`](https://github.com/changesets/changesets).

### Beta release
To create a beta release, add the `[beta] @guardian/anghammarad` label to your PR.
A comment will be added to the PR with the version number of your beta release.
npm package: @guardian/automat-client
Description: Client lib for Automat
Author: Nicolas Long
Latest version: 0.2.17

# @guardian/automat-client

A basic (JS) client for Automat. If you are reading this and don't know
what Automat is, this library is probably not useful for you.

## Local dev

### Watch for changes

```
$ yarn dev
```

### Point a project to your local version of automat-client

With [`yarn link`] you can develop against a locally checked out version of
this client:

In your local checkout of `automat-client`:

```
$ yarn link
```

And then in the project consuming the client:

```
$ yarn link "@guardian/automat-client"
```

To revert back to using the published version of the package:

```
$ yarn unlink "@guardian/automat-client"
$ yarn install --force
```

[`yarn link`]: https://classic.yarnpkg.com/en/docs/cli/link/

NOTE: Ensure you build this library before adding it locally to your project, by running `yarn build`.

## Publishing

On your feature branch, increment the version in the `package.json` file.
Once we hit version 1 we should use semver when doing this.

Once the feature branch is merged into master, run:

    yarn publishToNPM

This will build and then publish to NPM.

You should then push your (updated) master to origin.

You can then update the clients!

Note: you'll need to be part of the @guardian org on npm to do this.\
Speak to a suitable person if you don't have access.