Skip to content
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
9 changes: 7 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@ jobs:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-pr-message: 'This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.'
stale-pr-message: 'This pull request is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.'
stale-issue-label: 'stale'
stale-pr-label: 'stale'
close-issue-label: 'inactivity-closed'
close-pr-label: 'inactivity-closed'
labels-to-add-when-unstale: 'valid'
exempt-issue-labels: 'valid,good first issue'
exempt-pr-labels: 'valid,good first issue'
days-before-stale: 30
days-before-close: 5
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,19 @@ public final class VcActivityCommand extends SlashCommandAdapter {
private static final long MAX_AGE_DAYS_LIMIT = 7;
private static final long MAX_USES_LIMIT = 100;

public static final String YOUTUBE_TOGETHER_NAME = "YouTube Together";
public static final String POKER_NAME = "Poker";
public static final String BETRAYAL_IO_NAME = "Betrayal.io";
public static final String FISHINGTON_IO_NAME = "Fishington.io";
public static final String CHESS_CG_2_DEV = "Chess / CG 2 Dev";
public static final String AWKWORD_NAME = "Awkword";
public static final String SPELLCAST_NAME = "Spellcast";
public static final String DOODLECREW_NAME = "Doodlecrew";
public static final String WORDSNACK_NAME = "Wordsnack";
public static final String LETTERTILE_NAME = "Lettertile";


private static final List<Command.Choice> VC_APPLICATIONS =
List.of(new Command.Choice(YOUTUBE_TOGETHER_NAME, YOUTUBE_TOGETHER_NAME),
new Command.Choice(POKER_NAME, POKER_NAME),
List.of(new Command.Choice(POKER_NAME, POKER_NAME),
new Command.Choice(BETRAYAL_IO_NAME, BETRAYAL_IO_NAME),
new Command.Choice(FISHINGTON_IO_NAME, FISHINGTON_IO_NAME),
new Command.Choice(CHESS_CG_2_DEV, CHESS_CG_2_DEV),
new Command.Choice(AWKWORD_NAME, AWKWORD_NAME),
new Command.Choice(SPELLCAST_NAME, SPELLCAST_NAME),
new Command.Choice(DOODLECREW_NAME, DOODLECREW_NAME),
new Command.Choice(WORDSNACK_NAME, WORDSNACK_NAME),
Expand All @@ -78,12 +72,11 @@ public final class VcActivityCommand extends SlashCommandAdapter {
* invite targets" PR on JDA</a>. There is no official list from Discord themselves, so this is
* our best bet.
*/
private static final Map<String, String> VC_APPLICATION_TO_ID = Map.of(YOUTUBE_TOGETHER_NAME,
"755600276941176913", POKER_NAME, "755827207812677713", BETRAYAL_IO_NAME,
"773336526917861400", FISHINGTON_IO_NAME, "814288819477020702", CHESS_CG_2_DEV,
"832012586023256104", AWKWORD_NAME, "879863881349087252", SPELLCAST_NAME,
"852509694341283871", DOODLECREW_NAME, "878067389634314250", WORDSNACK_NAME,
"879863976006127627", LETTERTILE_NAME, "879863686565621790");
private static final Map<String, String> VC_APPLICATION_TO_ID =
Map.of(POKER_NAME, "755827207812677713", BETRAYAL_IO_NAME, "773336526917861400",
FISHINGTON_IO_NAME, "814288819477020702", SPELLCAST_NAME, "852509694341283871",
DOODLECREW_NAME, "878067389634314250", WORDSNACK_NAME, "879863976006127627",
LETTERTILE_NAME, "879863686565621790");

private static final List<OptionData> inviteOptions = List.of(new OptionData(OptionType.INTEGER,
MAX_USES_OPTION,
Expand Down Expand Up @@ -217,7 +210,7 @@ private static void handleErrors(@NotNull SlashCommandEvent event,

/**
* Interprets the given option as integer. Throws if the option is not an integer.
*
*
* @param option the option that contains the integer to extract, or null if not present
* @return the extracted integer if present, null otherwise
**/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,13 @@ private void revokeAction(@NotNull RevocationGroupIdentifier groupIdentifier) {
@NotNull ModerationAction actionType) {
logger.info("Revoked temporary action {} against user '{}' ({}).", actionType,
target.getAsTag(), target.getId());
RevocableModerationAction action = getRevocableActionByType(actionType);

String reason = "Automatic revocation of temporary action.";
actionsStore.addAction(guild.getIdLong(), jda.getSelfUser().getIdLong(), target.getIdLong(),
actionType, null, reason);
action.getRevokeType(), null, reason);

return getRevocableActionByType(actionType).revokeAction(guild, target, reason);
return action.revokeAction(guild, target, reason);
}

private void handleFailure(@NotNull Throwable failure,
Expand Down