Skip to content
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

MC tip copy improvements #15

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 6 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
DISCORD_ALLOWED_PARENT_CHANNEL_IDS,
DISCORD_DM_TOKEN,
EXPLORER_URL,
RAIDGUILD_GAME_ADDRESS,
TIP_PROPOSAL_REACTION_THRESHOLD
} from '@/utils/constants';
import { discordLogger } from '@/utils/logger';
Expand Down Expand Up @@ -145,7 +144,7 @@ export const setupDungeonMasterWorker = () => {

if (Date.now() > proposalExpiration) {
const embed = new EmbedBuilder()
.setTitle('MC XP Tipping Proposal Expired!')
.setTitle(':microphone2: MC XP Tipping Proposal Expired!')
.setDescription(
`The XP tipping proposal has expired. Please create a new proposal.`
)
Expand All @@ -157,7 +156,7 @@ export const setupDungeonMasterWorker = () => {
}

let embed = new EmbedBuilder()
.setTitle('MC XP Tipping Pending...')
.setTitle(':microphone2: MC XP Tipping Pending...')
.setColor('#ff3864')
.setTimestamp();

Expand Down Expand Up @@ -194,7 +193,7 @@ export const setupDungeonMasterWorker = () => {
const txHash = tx.hash;

embed = new EmbedBuilder()
.setTitle('MC XP Tipping Transaction Pending...')
.setTitle(':microphone2: MC XP Tipping Transaction Pending...')
.setURL(`${EXPLORER_URL}/tx/${txHash}`)
.setDescription(
`Transaction is pending. View your transaction here:\n${EXPLORER_URL}/tx/${txHash}`
Expand All @@ -215,7 +214,7 @@ export const setupDungeonMasterWorker = () => {
await updateLatestXpMcTip(client, 'latestXpMcTips', data);

embed = new EmbedBuilder()
.setTitle('MC XP Tipping Transaction Failed!')
.setTitle(':microphone2: MC XP Tipping Transaction Failed!')
.setURL(`${EXPLORER_URL}/tx/${txHash}`)
.setDescription(
`Transaction failed. View your transaction here:\n${EXPLORER_URL}/tx/${txHash}`
Expand All @@ -227,10 +226,10 @@ export const setupDungeonMasterWorker = () => {
return;
}

const viewGameMessage = `\n---\nView the game at https://play.raidguild.org/games/gnosis/${RAIDGUILD_GAME_ADDRESS}`;
const viewGameMessage = `\n---\nView the game at https://play.raidguild.org`;

embed = new EmbedBuilder()
.setTitle('MC XP Tipping Succeeded!')
.setTitle(':microphone2: MC XP Tipping Succeeded!')
.setURL(`${EXPLORER_URL}/tx/${txHash}`)
.setDescription(
`<@${receivingDiscordId}>'s character received ${MC_XP_TIP_AMOUNT} XP for MC'ing this meeting.${viewGameMessage}`
Expand Down
4 changes: 2 additions & 2 deletions src/interactions/cs/tipXp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
updateLatestXpTip
} from '@/lib';
import { ClientWithCommands } from '@/types';
import { EXPLORER_URL, RAIDGUILD_GAME_ADDRESS } from '@/utils/constants';
import { EXPLORER_URL } from '@/utils/constants';
import { discordLogger } from '@/utils/logger';

export const tipXpInteraction = async (
Expand Down Expand Up @@ -199,7 +199,7 @@ export const tipXpInteraction = async (
const message = (interaction.options.get('message')?.value ?? '') as string;
const reasonMessage = message ? `\n---\nReason: **${message}**` : '';

const viewGameMessage = `\n---\nView the game at https://play.raidguild.org/games/gnosis/${RAIDGUILD_GAME_ADDRESS}`;
const viewGameMessage = `\n---\nView the game at https://play.raidguild.org`;

const dmFailureMessage =
discordIdsNotInDm.length > 0
Expand Down
2 changes: 1 addition & 1 deletion src/interactions/cs/tipXpAttendance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export const tipXpAttendanceInteraction = async (
return;
}

const viewGameMessage = `\n---\nView the game at https://play.raidguild.org/games/gnosis/${RAIDGUILD_GAME_ADDRESS}`;
const viewGameMessage = `\n---\nView the game at https://play.raidguild.org`;

const discordMembersSuccessfullyTipped = discordMembers.filter(
m =>
Expand Down
8 changes: 4 additions & 4 deletions src/interactions/cs/tipXpMc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const tipXpMcInteraction = async (

if (proposalActive) {
const embed = new EmbedBuilder()
.setTitle('Meeting MC XP Tip Proposal')
.setTitle(':microphone2: Meeting MC XP Tip Proposal')
.setDescription(
`There is already a proposal to tip the MC for this meeting. However, that proposal will expire at ${new Date(
proposalExpiration ?? 0
Expand All @@ -69,7 +69,7 @@ export const tipXpMcInteraction = async (

if (needsCooldown) {
const embed = new EmbedBuilder()
.setTitle('Meeting MC XP Tipping Cooldown')
.setTitle(':microphone2: Meeting MC XP Tipping Cooldown')
.setDescription(
`All members must wait ${
endTime
Expand Down Expand Up @@ -209,11 +209,11 @@ export const tipXpMcInteraction = async (

const newProposalExpiration = Date.now() + PROPOSAL_EXPIRATION_TIME;
const embed = new EmbedBuilder()
.setTitle('Meeting MC XP Tip Proposal')
.setTitle(':microphone2: Meeting MC XP Tip Proposal')
.setDescription(
`<@${senderId}> is proposing to tip ${MC_XP_TIP_AMOUNT} XP to <@${
meetingMcDiscordMembers[0]?.id
}> for MC'ing this meeting.\n\nTo approve this tip, please react with an emoji. **${TIP_PROPOSAL_REACTION_THRESHOLD} emoji reactions are required for the tip to succeed**.\n\nThis proposal will expire at ${new Date(
}> for MC'ing this meeting.\n\n@here To approve this tip, please react with an emoji. **${TIP_PROPOSAL_REACTION_THRESHOLD} emoji reactions from unique users are required for the tip to succeed**.\n\nThis proposal will expire at ${new Date(
newProposalExpiration
).toLocaleString()}.`
)
Expand Down