This repository was archived by the owner on Sep 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Create doAutoChangePresence.ts #532
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
db53cc2
Create doAutoChangePresence.ts
dannynotsmart 7a72732
Update extraClient.ts
dannynotsmart 82ab6f8
Update src/client/doAutoChangePresence.ts
dannynotsmart 4437f35
Update src/client/doAutoChangePresence.ts
dannynotsmart 3ed96c5
Update src/client/doAutoChangePresence.ts
dannynotsmart 1ec9bbf
Update src/client/doAutoChangePresence.ts
dannynotsmart 6c1ba87
Update src/client/doAutoChangePresence.ts
dannynotsmart b9138f0
Update src/client/doAutoChangePresence.ts
dannynotsmart 5f97e1e
Update src/client/doAutoChangePresence.ts
dannynotsmart fb905b7
Update src/client/doAutoChangePresence.ts
PythonCoderAS 25eeb93
Update src/client/doAutoChangePresence.ts
PythonCoderAS 5f085aa
Add imports and use lodash
PythonCoderAS f5ff61d
Run prettier
PythonCoderAS 9aac775
Merge remote-tracking branch 'danny/patch-1' into patch-1
PythonCoderAS 7287dc5
Merge pull request #2 from PythonCoderAS/patch-1
dannynotsmart ca0047c
Update doAutoChangePresence.ts
PythonCoderAS 94d965d
Update doAutoChangePresence.ts
PythonCoderAS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /** | ||
| * Copyright (C) 2021-2022 PythonCoderAS | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| */ | ||
| import { sample } from "lodash"; | ||
|
|
||
| import { AutoUser } from "../orm/autoUser"; | ||
| import HealthScreeningBotClient from "./extraClient"; | ||
|
|
||
| export default async function doAutoChangePresence( | ||
| client: HealthScreeningBotClient | ||
| ): Promise<void> { | ||
| const guildSize = client.guilds.cache.size; | ||
| const registeredPeople = await AutoUser.count(); | ||
|
|
||
| const presences: string[] = [ | ||
| "Generating Health Screenings", | ||
| `In ${guildSize} servers`, | ||
| `Generating for ${registeredPeople} people!`, | ||
| "/generate name:walkthrough for walkthrough of commands!", | ||
| "Report a bug with /report_bug!", | ||
| "Use /set to set optional configuration info!", | ||
| "can i put ma balls on ya jaws", | ||
| "Run /stats for cool stats about the bot!", | ||
| "Check out your profile with /profile!", | ||
| "Have an idea? Suggest it with /suggest!", | ||
| ]; | ||
|
|
||
| // We only need to set the name. | ||
| await client.user!.setPresence({ activities: [{ name: sample(presences) }] }); | ||
|
|
||
| setTimeout(() => doAutoChangePresence(client), 300000); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.