Skip to content

Commit

Permalink
v4.0.1 release
Browse files Browse the repository at this point in the history
v4.0.1
  • Loading branch information
Rahuletto authored Jun 25, 2023
2 parents 445bd3a + f1027a6 commit 6052941
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 37 deletions.
14 changes: 4 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
---
name: Bug report
about: Create a report to help us improve
title: 'Bug Report'
labels: 'bug'
assignees: ''
---

**Describe the bug**
## Describe the bug

A clear description of what the bug is.

**To Reproduce**
### To Reproduce

Steps to reproduce the behavior:

1. Run the bot
Expand Down
8 changes: 0 additions & 8 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'feature'
assignees: ''
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Expand Down
4 changes: 2 additions & 2 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 14.10.x | :white_check_mark: |
| 12.5.x | :x: |
| 14.x.x | :white_check_mark: |
| 13.x.x | :x: |

## Reporting a Vulnerability

Expand Down
8 changes: 0 additions & 8 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
---
name: Pull Request
about: Improve the package by contributing.
title: 'Pull Request'
labels: 'pr'
assignees: ''
---

# Description

_Overview of the things you changed_
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simply-djs",
"version": "4.0.0",
"version": "4.0.1",
"description": "The simplest way to build complex Discord bots.",
"main": "lib/simplydjs.js",
"types": "typings/simplydjs.d.ts",
Expand Down
11 changes: 9 additions & 2 deletions src/chatbot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { https } from './misc';
import { SimplyError } from './error';
import { ExtendedMessage } from './typedef';

import { Configuration, OpenAIApi } from 'openai';

// ------------------------------
// ------- T Y P I N G S --------
// ------------------------------
Expand Down Expand Up @@ -88,6 +86,15 @@ export async function chatbot(

// For ChatGPT integration.
if (options?.gptToken) {
const { Configuration, OpenAIApi } = await import('openai').catch(
() => {
throw new SimplyError({
function: 'chatbot',
title: "Cannot find the module 'openai'",
tip: 'To use the chatbot with gpt, you need to install openai package. Use\n\nnpm install openai\n'
});
}
);
await message.channel.sendTyping();

const configuration = new Configuration({
Expand Down
2 changes: 1 addition & 1 deletion src/ghostPing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export async function ghostPing(
);
}
})
.catch((_err) => {
.catch(() => {
return true;
});

Expand Down
6 changes: 3 additions & 3 deletions src/starboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,21 @@ export async function starboard(
react.emoji.name == '⭐' ||
react.emoji.name == '🌟'
) {
const minmax = react.count;
const count = react.count;

const starboard = await client.channels.fetch(options.channelId, {
force: true,
cache: true
});

if (minmax < minimumRequired) {
if (count < minimumRequired) {
const messages = await (starboard as TextChannel)?.messages.fetch({
limit: 100
});

const existing = messages.find(
(msg) =>
msg.embeds[0]?.footer?.text == '⭐ | ID: ' + extMessage.id
msg.embeds[0]?.footer?.text == '⭐ | ID: ' + react.message.id
);

if (existing) {
Expand Down

0 comments on commit 6052941

Please sign in to comment.