Skip to content

feat: game activity tracker #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 62 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
9a6a422
tracking options in config
flloschy Oct 15, 2022
48faaeb
creating db entry
flloschy Oct 15, 2022
87ca118
added indent for updatePresent
flloschy Oct 15, 2022
7d27126
Tracking done - 7 commands & 2 autocompletes to go
flloschy Oct 15, 2022
c36bb0c
prevent "Must be 25 or fewer in length" error
flloschy Oct 16, 2022
d2b24b1
activated logging again
flloschy Oct 16, 2022
98ea5af
map length protection + blacklistRemove completer
flloschy Oct 16, 2022
ed2ba37
blacklist + look commands
flloschy Oct 16, 2022
95e98f6
All comands Complete
flloschy Oct 16, 2022
58fde26
added interface
flloschy Oct 16, 2022
42ac022
All autocompletes done
flloschy Oct 16, 2022
8f1889b
Prettier
flloschy Oct 16, 2022
c8449cf
Merge branch 'main' into gameActivityTracker
Chicken Oct 16, 2022
71e2143
fix: eslint-prettier conflict preventing merge
Chicken Oct 16, 2022
fdb4154
fix: merge mistakes
Chicken Oct 16, 2022
8a8bbb0
Did Anttis things, and ig it works now? its late I need sleep
flloschy Oct 17, 2022
0dfa1e8
Prettier
flloschy Oct 17, 2022
e6942ba
ESLint error fix (maybe)
flloschy Oct 19, 2022
d5807b4
workflow please work
flloschy Oct 19, 2022
c09c9a5
changed to final channel + trimed time formating
flloschy Oct 19, 2022
1de62a2
format
Chicken Oct 19, 2022
115a04f
merge main
Chicken Oct 19, 2022
a336740
fix eslint warnings
Chicken Oct 19, 2022
3f55418
moved functions to Utils
flloschy Oct 22, 2022
9d8b317
buttons misc + use it
flloschy Oct 22, 2022
3bc4f25
made admin and statistic commands ephemeral
flloschy Oct 22, 2022
91374f1
removed useless imports
flloschy Oct 22, 2022
0775ab7
small tweaks
StrangeGirlMurph Oct 23, 2022
d17fd15
prettify
StrangeGirlMurph Oct 23, 2022
618fc5a
No logging in to chat
flloschy Oct 24, 2022
e14a981
prevent duplicates in autocomplete
flloschy Oct 24, 2022
8808bd1
better
flloschy Oct 24, 2022
be945b3
autocomplete for admin -> blacklistgame
flloschy Oct 24, 2022
0c6439c
lowercase blacklist stuff
flloschy Oct 24, 2022
93647ce
new Descriptions+list cmd+blacklist add a-complete
flloschy Oct 24, 2022
3e7d5ea
listing logic
flloschy Oct 24, 2022
37da19f
removed async
flloschy Oct 24, 2022
f97a712
list command stuff
flloschy Oct 24, 2022
a2f8455
prettier
flloschy Oct 24, 2022
61fae7b
Wow, I figured out there is an prettify command :O
flloschy Oct 25, 2022
704484e
finished Tracker
flloschy Oct 26, 2022
76b7c05
stop bot activity to get logged
flloschy Oct 27, 2022
86fcb13
page fix
flloschy Oct 27, 2022
5d1ce3c
fixed wrong user amount
flloschy Oct 27, 2022
35a1f04
button features, layout stuff and some other things
Oct 28, 2022
b0b9688
Wilson did a thing
flloschy Oct 28, 2022
4277adb
Wilson did a thing 2
flloschy Oct 28, 2022
0087776
yes
flloschy Oct 28, 2022
22cfb86
thx
flloschy Oct 28, 2022
ffab736
configurable Admin command permission
flloschy Oct 28, 2022
863e7bf
wrong game/user count fix
flloschy Oct 29, 2022
9b4eb4a
unused import
flloschy Oct 29, 2022
c1bd5a8
prettify
flloschy Oct 29, 2022
6410a1b
register can be boolean now
flloschy Oct 30, 2022
7ddaebe
GuildPresences intent only when needed
flloschy Oct 30, 2022
1c2c58a
prettify..........
flloschy Oct 30, 2022
21dcd75
Uniform file names
flloschy Oct 30, 2022
179e9a4
Merge branch 'main' into gameActivityTracker
Chicken Nov 1, 2022
bb8a292
fix: git hook...
Chicken Nov 1, 2022
12df18c
prettify
Chicken Nov 1, 2022
28f6973
revised code and styled a bit
Nov 2, 2022
dae9ec8
dynamic jumps
Nov 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"es2021": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "prettier"],
"plugins": ["@typescript-eslint"],
"rules": {
"indent": [
"error",
Expand All @@ -18,9 +18,6 @@
"SwitchCase": 1
}
],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "double"],
"semi": ["error", "always"],
"sort-imports": [
"error",
{
Expand Down
64 changes: 0 additions & 64 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"discord-api-types": "^0.37.14",
"eslint": "^8.11.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^8.0.1",
"prettier": "^2.6.0",
"typescript": "^4.6.2"
Expand Down
25 changes: 20 additions & 5 deletions src/codeSamples/sampleAutocompleter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,27 @@ class CountryAutocompleter extends Autocompleter {
async execute(interaction: AutocompleteInteraction): Promise<void> {
// your options
const country = ["Finland", "Sweden", "Norway"];
// for example return all options which start with the user input
await interaction.respond(
country
.filter((c) => c.startsWith(interaction.options.getFocused() as string))
.map((c) => ({ name: c, value: c }))

// for example filter for options which start with the user input
let filterdoptions = country.filter((c) =>
c
// to make sure capitalisaion doesnt matter, make every option to lower case
.toLowerCase()
.startsWith(
// the same with the user input
interaction.options.getFocused().toLowerCase() as string
)
);

// if the filterd options are more than 25 remove everything after the 25th option
// because discord only allows 25 autocomplete results
if (filterdoptions.length > 25) filterdoptions = filterdoptions.slice(0, 25);

// map filtered options
const map = filterdoptions.map((c) => ({ name: c, value: c }));

// send map back to the user
await interaction.respond(map);
}
}

Expand Down
Loading