Skip to content

Commit

Permalink
chore: More thorough logging of song request events (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
AverageHelper authored Oct 29, 2022
1 parent f5c86fd commit 1520fcd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.3] - 2022-10-29
### Changed
- More thorough logging, especially around song request messages. This should help us debug some timing issues.

## [2.0.2] - 2022-09-24
### Changed
- Internal rejection logs now have more context.
Expand Down Expand Up @@ -384,6 +388,7 @@ After updating, be sure to run `npm ci && npm run build:clean && npm run migrate
### Added
- Initial commit

[2.0.3]: https://github.com/AverageHelper/Gamgee/compare/v2.0.2...v2.0.3
[2.0.2]: https://github.com/AverageHelper/Gamgee/compare/v2.0.1...v2.0.2
[2.0.1]: https://github.com/AverageHelper/Gamgee/compare/v2.0.0...v2.0.1
[2.0.0]: https://github.com/AverageHelper/Gamgee/compare/v1.8.3...v2.0.0
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": "gamgee",
"version": "2.0.2",
"version": "2.0.3",
"description": "A Discord bot for managing a song request queue.",
"private": true,
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/commands/songRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ApplicationCommandOptionType, hideLinkEmbed } from "discord.js";
import { getQueueChannel } from "../actions/queue/getQueueChannel.js";
import { isQueueOpen } from "../useGuildStorage.js";
import { localizations, t } from "../i18n.js";
import { logUser } from "../helpers/logUser.js";
import { processSongRequest } from "../actions/queue/processSongRequest.js";
import { resolveStringFromOption } from "../helpers/optionResolvers.js";
import { sendMessageInChannel, stopEscapingUriInString } from "../actions/messages/index.js";
Expand Down Expand Up @@ -47,7 +48,7 @@ export const sr: GuildedCommand = {

const MENTION_SENDER = `<@!${user.id}>`;

logger.debug(`Got song request message at ${createdTimestamp}`);
logger.debug(`Got song request message at ${createdTimestamp} from ${logUser(user)}`);
const queueChannel = await getQueueChannel(guild);
if (!queueChannel) {
await context.followUp({
Expand Down
4 changes: 3 additions & 1 deletion src/constants/textResponses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,14 @@ export const phrases: ResponseRepository = [
"That's par for the course",
// eslint-disable-next-line deprecation/deprecation
({ me }) => `That was close… I was almost ${indefiniteArticle(me)} ${firstWord(me)} sandwich!`,
["The queue is now open! :tada:\n...\n||just kidding||", "", "... Did I get you?"],
"They told me not to keep saying random stuff. BUT I DIDN'T LISTEN!",
"This is just a random phrase. Feel free to add to another.",
"(This message will be in a separate message)",
"This reminds me of the time when I tried to drink some water to maybe act like other people, and I wish I never did.",
"\\*thoughtful phrase\\*",
() => `To talk to a customer, please press \`${randomInt(9)}\``,
"Today is the tomorrow you were promised yesterday",
"Truly inspirational!",
"Warning: Your pc have many virus please call the number to fix issue: ||*gotcha* :P||",
"We've been trying to reach you about your vehicle's extended warranty. You may consider this your first and only notice.",
Expand All @@ -358,7 +360,7 @@ export const phrases: ResponseRepository = [

...philosophy,
...copypasta
]; // 217 of these
]; // 219 of these
logger.silly(`I have ${phrases.length} random things to say ^^`);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function useLogger(): Logger {
if (!logger) {
logger = createLogger({
level: "silly",
format: format.json(),
format: format.combine(format.timestamp(), format.json()),
// defaultMeta: { service: "user-service" },
transports: [
//
Expand Down

0 comments on commit 1520fcd

Please sign in to comment.