Skip to content

Commit 8e5b49c

Browse files
committed
edit readme
1 parent aec123a commit 8e5b49c

File tree

3 files changed

+10
-72
lines changed

3 files changed

+10
-72
lines changed

.github/CHANGES.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/SECURITY.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

README.md

Lines changed: 10 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -17,72 +17,33 @@
1717
</div>
1818

1919
# discord-afk-js
20+
2021
**[discord-afk-js](https://www.npmjs.com/package/discord-afk-js?activeTab=readme)** is a JavaScript library created to facilitate the management of AFK (Away From Keyboard) status within Discord bots. This library is designed to simplify the process of tracking and handling AFK users in a Discord server without the need for an external database.
2122

2223
# Requirements
23-
- [NodeJS](https://nodejs.org) 16.9.0 or higher
24+
25+
- [NodeJS](https://nodejs.org) 18.x or higher
2426

2527
# Installation
28+
2629
To start using **discord-afk-js**, you can install it through npm, the Node.js package manager. Open your terminal and run the following command:
2730

2831
```bash
2932
npm install discord-afk-js
3033
```
3134

3235
# Usage
33-
**discord-afk-js** offers a straightforward way to manage AFK users in your Discord bot. Below is an example of how to utilize the **AfkClient** class:
34-
35-
```javascript
36-
const { AfkClient } = require('discord-afk-js');
37-
const moment = require('moment');
38-
39-
// Create an instance of AfkClient
40-
const afk = new AfkClient();
41-
42-
// Checking if a user is AFK without time
43-
const reason = args.join(' ') || 'No Reason';
44-
afk.addUser('user123', reason);
45-
46-
if (afk.findUser('user123')) {
47-
console.log('User is marked as AFK'); // console: User is marked as AFK
48-
console.log('AFK Message:', afk.afkMessage('user123')); // console: AFK Message: No Reason
49-
}
50-
// or
51-
// Adding a user to AFK status with time
52-
const reason = args.join(' ') || 'No Reason';
53-
afk.addUser('user123', [Date.now(), reason]);
54-
55-
if (afk.findUser('user123')) {
56-
console.log('User is marked as AFK'); // console: User is marked as AFK
57-
const data = afk.findMessage('user123');
5836

59-
const [ time, reason ] = data;
60-
const timeago = moment(time).fromNow();
37+
[No Database Version](https://github.com/SITCommunity/discord-afk-js/tree/nodb-stable?tab=readme-ov-file)
6138

62-
console.log('AFK Message:', `${reason} ${timeago}`); // console: AFK Message: No Reason a few seconds ago
63-
}
64-
65-
// Removing a user from AFK status
66-
afk.removeUser('user123');
67-
```
68-
In the code snippet above, we start by importing the **AfkClient** class. After creating an instance of this class, we demonstrate how to add a user to the AFK list, check their AFK status, and remove them from AFK status.
69-
70-
# API
71-
The **discord-afk-js** library provides a set of methods for working with AFK status using the **AfkClient** class.
72-
73-
# Changelog | Migrating to discord-afk-js
74-
```diff
75-
+ change afk to AfkClient for import
76-
+ afk.set() -> afk.addUser()
77-
+ afk.delete() -> afk.removeUser()
78-
+ afk.get() -> afk.findUser()
79-
+ afk.findMessage()
80-
```
39+
[Database Version](https://github.com/SITCommunity/discord-afk-js/tree/db-stable?tab=readme-ov-file)
8140

8241
# License
83-
This project is open-source and is licensed under the Apache-2.0. You can find more details about the license in the [LICENSE.md](https://github.com/CyraTeam/discord-afk-js/blob/main/LICENSE) file included in the project.
42+
43+
This project is open-source and is licensed under MIT License. You can find more details about the license in the [LICENSE.md](https://github.com/CyraTeam/discord-afk-js/blob/main/LICENSE) file included in the project.
8444

8545
With this comprehensive readme, you have a clear and detailed guide on how to use the **discord-afk-js** library to manage AFK status in your Discord bot.
8646

8747
# Discord Servers
88-
<a href="https://discord.gg/qpT2AeYZRN" target="_blank" rel="noopener noreferrer"><img alt="Discord" src="https://img.shields.io/discord/984857299858382908?label=CyraTeam&logo=discord"></a>
48+
49+
<a href="https://discord.gg/qpT2AeYZRN" target="_blank" rel="noopener noreferrer"><img alt="Discord" src="https://img.shields.io/discord/984857299858382908?label=CyraTeam&logo=discord"></a>

0 commit comments

Comments
 (0)