kaogeek / kaogeek-discord-bot Goto Github PK
View Code? Open in Web Editor NEWDiscord bot for KaoGeek, built with TypeScript
License: MIT License
Discord bot for KaoGeek, built with TypeScript
License: MIT License
Proposed steps:
*This is just a quick fix for current issue*
Currently, there are some flagged users making themselves unflagged by leaving the server and rejoining.
Admins suggest that, we should reapply flag role to those who leave with the role.
I plan to test command but it's already merge 😂
Anyways, my main account has DM disable and it's crash the bot.
Log:
Sticky message saved: Hi
error while update sticky message Unknown Message
\kaogeek-discord-bot\node_modules\.pnpm\@[email protected]\node_modules\@discordjs\rest\dist\index.js:640
throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^
DiscordAPIError[50007]: Cannot send messages to this user
at handleErrors (\kaogeek-discord-bot\node_modules\.pnpm\@[email protected]\node_modules\@discordjs\rest\dist\index.js:640:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at Object.runRequest (\kaogeek-discord-bot\node_modules\.pnpm\@[email protected]\node_modules\@discordjs\rest\dist\index.js:1021:23)
at Object.queueRequest (\kaogeek-discord-bot\node_modules\.pnpm\@[email protected]\node_modules\@discordjs\rest\dist\index.js:862:14)
at EventEmitter.request (\kaogeek-discord-bot\node_modules\.pnpm\@[email protected]\node_modules\@discordjs\rest\dist\index.js:1387:22)
at DMChannel.send (\kaogeek-discord-bot\node_modules\.pnpm\[email protected]\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:162:15) {
requestBody: {
files: [],
json: {
content: 'Successfully created sticky message.',
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
},
rawError: { message: 'Cannot send messages to this user', code: 50007 },
code: 50007,
status: 403,
method: 'POST',
url: 'https://discord.com/api/v10/channels/.../messages'
}
Node.js v18.16.0
ELIFECYCLE Command failed with exit code 1.
Steps to reproduce the behavior:
?stickao-set
Just skip DM if user disabled it, maybe.
สร้างโครงสร้างพื้นฐานสำหรับการรันบอท discord
https://github.com/kaogeek/kaogeek-discord-bot/blob/main/data/dock/db.sqlite
It looks unused to me. Someone should double check and remove.
Let's initialize the TypeScript code for the discord bot.
PS - you can create a Draft pull request to prevent duplicate work.
I would like to introduce frameworks for implementing Discord bot that is discord-nestjs. It allows us to implement the bot based on NestJS framework which provides greats decorators and separations of layers of logics. We can also implement REST api in it if we want.
migrate data storage from Keyv to Prisma
in the future we may have more complex feature that needs more structured data.
(please comment if you want to do it, so other people know someone is already working on it)
the isOnlyEmoji
function currently has a bug. it detects numbers (e.g. 123
) as an emoji. this leads to a bug:
a test case has been added:
please fix the function so that this test passes
add Vitest to project to allow unit testing some logic
expect('foo').toBe('foo')
there are some complex logic, e.g. emoji detection #36. maybe these logic can have automated tests to increase confidence in the system
(please comment if you would like to help, so other people know someone is already working on it)
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
)@vitest/coverage-v8
, vitest
)@prisma/client
, prisma
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@prisma/client
, @trivago/prettier-plugin-sort-imports
, @types/eslint
, @types/humanize-ms
, @types/node
, @types/node-cron
, @types/unzalgo
, @typescript-eslint/eslint-plugin
, @typescript-eslint/parser
, @vitest/coverage-v8
, discord.js
, dotenv
, eslint
, eslint-config-prettier
, eslint-plugin-import
, node-cron
, pnpm
, prisma
, rimraf
, tsup
, tsx
, typescript
, vite-tsconfig-paths
, vitest
, zod
).tool-versions
smoke/docker-compose.yml
Dockerfile
.github/workflows/checks.yml
actions/checkout v3
pnpm/action-setup v2
actions/setup-node v3
actions/checkout v3
pnpm/action-setup v2
actions/setup-node v3
actions/checkout v3
pnpm/action-setup v2
actions/setup-node v3
davelosert/vitest-coverage-report-action v2
actions/checkout v3
pnpm/action-setup v2
actions/setup-node v3
actions/checkout v3
docker/setup-buildx-action v2
docker/build-push-action v4
.github/workflows/deployment.yml
actions/checkout v3
docker/setup-buildx-action v2
docker/login-action v2
docker/build-push-action v4
appleboy/ssh-action v0.1.10
package.json
@(-.-)/env 0.3.2
@prisma/client 4.16.1
discord.js 14.11.0
dotenv 16.3.1
humanize-ms 1.2.1
node-cron 3.0.2
prisma 4.16.1
toml 3.0.0
unzalgo 3.0.0
zod 3.21.4
@trivago/prettier-plugin-sort-imports 4.1.1
@tsconfig/node18 2.0.1
@types/eslint 8.40.2
@types/humanize-ms 1.2.2
@types/node 18.16.18
@types/node-cron 3.0.8
@types/unzalgo 3.0.0
@typescript-eslint/eslint-plugin 5.60.1
@typescript-eslint/parser 5.60.1
@vitest/coverage-v8 0.32.2
cross-env 7.0.3
eslint 8.43.0
eslint-config-prettier 8.8.0
eslint-plugin-import 2.27.5
eslint-plugin-prettier 4.2.1
eslint-plugin-unicorn 47.0.0
prettier 2.8.8
rimraf 5.0.1
tsup 7.1.0
tsx 3.12.7
typescript 5.1.5
vite-tsconfig-paths 4.2.0
vitest 0.32.2
pnpm >=8.6
pnpm 8.6.5
.nvmrc
Originally posted by beam41 May 17, 2023
จะได้ติดตามง่ายๆเวลามี activity อะไรบน github
https://gist.github.com/jagrosh/5b1761213e33fc5b54ec7f6379034a22
I think it's unnecessary if disableAutoDeferReply
is true
find a way to let developers see the server logs without having to ssh into a server, so they can better debug the bot
right now when debugging issues, to view the logs, i have to ssh
into @Gusb3ll’s server and run docker compose logs -f
this means only a handful people are able to debug the system because only few people can access log. giving too many people ssh access can be a security concern. therefore, if we are able to use some hosted log management solution, more people can debug the system
my personal favorite would be Papertrail. it is a simple text-based logging system with a free tier. very easy to filter logs using text patterns. the free tier has 50MB/month limit, but each referral would grant an extra 50MB/month for 1 year. i am currently testing out Papertrail with my account, but i am using it with other projects too. it would be great if someone can create a new account so we can have a dedicated account for the bot (let me know so I can send the referral code). since Papertrail supports unlimited team members, we don’t need to share account passwords.
another option is to use Loggly. its free plan has 200MB/day limit. however, the UI does not look as good as Papertrail. it also emphasizes structured logging, which is not what we are doing right now. but it is still a good option to consider given a much higher free tier limit.
any other suggestions?
cc: @Gusb3ll @ST4RCHASER
morning krubb refer to #141
handle more cases : when users change their minds to disable DMs
Steps to reproduce the behavior:
skip DM
Some users in ก้าว Geek's discord trying to modify their nickname to start with/only "!" to be sorted at the top of the user list. After this feature rollout, some users try to replace "!" with other special characters are the same range of ASCII code (e.g., $, %, *, etc.). So blocking only the exclamation mark ("!") is not enough.
I have a suggestion for blocking all special characters (ASCII code from 33 to 47) from the nickname with the mentioned condition.
Enhance nickname validation function more effectively according to an objective.
According to #84 (comment)
It's weird that .DS_Store
is not there in .gitignore
template 😂
.gitignore
.DS_Store
and __MACOSX
package-lock.json
because someone insists to use npm
(We already have yarn.lock
in .gitignore
, so group them together will be very nice)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.