Skip to content

Commit

Permalink
Remove a huge amount of patreon references
Browse files Browse the repository at this point in the history
  • Loading branch information
duncte123 committed Nov 7, 2024
1 parent 51965c5 commit 07ffb14
Show file tree
Hide file tree
Showing 48 changed files with 128 additions and 460 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
github: [duncte123]
patreon: DuncteBot
custom: https://paypal.me/duncte123
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@
[discord]: https://discord.com/api/guilds/191245668617158656/embed.png
[discordLink]: https://duncte.bot/server
[inviteLink]: https://duncte.bot/invite
[patronLink]: https://patreon.com/DuncteBot
[patronImage]: https://img.shields.io/badge/Donate-Patreon-orange.svg

[![Build Status][circle]][circleLink] [![DiscordBots][dbl]][dblLink] [![Patreon][patronImage]][patronLink] [![Support Guild][discord]][discordLink]
[![Build Status][circle]][circleLink] [![DiscordBots][dbl]][dblLink] [![Support Guild][discord]][discordLink]

# SkyBot
SkyBot is an LGBT-friendly multipurpose discord bot with features such as music and moderation.


# Support
If you need any support please join our [Discord server][discordLink] <br />
If you want to support development of the bot [consider to become a patron][patronLink]


# How to invite the bot to a server?
Expand Down
3 changes: 0 additions & 3 deletions bot/src/main/java/me/duncte123/skybot/CommandManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ public CommandManager(Variables variables) {
this.addCommand(new DidYouMeanCommand());
this.addCommand(new DiscordMemesCommand());
this.addCommand(new DogCommand());
this.addCommand(new DonateCommand());
this.addCommand(new DrakeCommand());
this.addCommand(new EmoteCommand());
this.addCommand(new EnlargeCommand());
Expand Down Expand Up @@ -226,8 +225,6 @@ public CommandManager(Variables variables) {
this.addCommand(new OrlyCommand());
this.addCommand(new OwoCommand());
this.addCommand(new PatCommand());
// TODO: remove some day, can't do any harm really
this.addCommand(new PatreonCheckCommand());
this.addCommand(new PauseCommand());
this.addCommand(new PcCheckCommand());
this.addCommand(new PingCommand());
Expand Down
2 changes: 1 addition & 1 deletion bot/src/main/java/me/duncte123/skybot/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class Settings {
public static final String NEKKO_BASE = "https://nekobot.xyz/api/image?type=";
public static final int DEFAULT_COLOUR = 0x0751c6;

public static final String PATREON = "https://www.patreon.com/DuncteBot";
// public static final String PATREON = "https://www.patreon.com/DuncteBot";

public static final long SUPPORT_GUILD_ID = 191245668617158656L;
public static final long GUILD_PATRONS_ROLE = 470581447196147733L;
Expand Down
6 changes: 3 additions & 3 deletions bot/src/main/java/me/duncte123/skybot/audio/AudioLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ public class AudioLoader extends AbstractAudioLoadResultHandler {
private final String trackUrl;
private final boolean isPatron;

public AudioLoader(AudioData data, GuildMusicManager mng, boolean announce, String trackUrl, boolean isPatron) {
public AudioLoader(AudioData data, GuildMusicManager mng, boolean announce, String trackUrl) {
this.data = data;
this.requester = data.getUserId();
this.mng = mng;
this.announce = announce;
this.trackUrl = trackUrl;
this.isPatron = isPatron;
this.isPatron = false;
}

@Override
Expand All @@ -83,7 +83,7 @@ public void ontrackLoaded(@NotNull TrackLoaded trackLoaded) {
}

try {
scheduler.addToQueue(track, this.isPatron);
scheduler.addToQueue(track);

if (this.announce) {
final TrackInfo info = track.getInfo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public Queue<Track> getQueue() {
return queue;
}

public void addToQueue(Track track, boolean isPatron) throws LimitReachedException {
if (queue.size() + 1 >= MAX_QUEUE_SIZE && !isPatron) {
public void addToQueue(Track track) throws LimitReachedException {
if (queue.size() + 1 >= MAX_QUEUE_SIZE) {
throw new LimitReachedException("The queue is full", MAX_QUEUE_SIZE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.wolfram.alpha.visitor.Visitable;
import me.duncte123.botcommons.StringUtils;
import me.duncte123.botcommons.messaging.EmbedUtils;
import me.duncte123.botcommons.messaging.MessageConfig;
import me.duncte123.botcommons.messaging.MessageUtils;
import me.duncte123.skybot.Variables;
import me.duncte123.skybot.objects.command.Command;
Expand All @@ -34,15 +33,12 @@
import net.dv8tion.jda.api.entities.MessageEmbed;
import net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion;
import net.dv8tion.jda.api.utils.messages.MessageCreateData;
import net.dv8tion.jda.api.utils.messages.MessageEditBuilder;
import net.dv8tion.jda.api.utils.messages.MessageEditData;

import javax.annotation.Nonnull;
import java.util.concurrent.atomic.AtomicReference;

import static me.duncte123.skybot.Settings.PATREON;
import static me.duncte123.skybot.utils.AirUtils.shortenUrl;
import static me.duncte123.skybot.utils.CommandUtils.isUserOrGuildPatron;

public class WolframAlphaCommand extends Command {

Expand All @@ -64,7 +60,7 @@ public WolframAlphaCommand() {
private MessageEmbed generateEmbed(CommandContext ctx, WAQueryResult result, Variables variables) {
final Member member = ctx.getMember();
final EmbedBuilder embed = EmbedUtils.getDefaultEmbed();
embed.setAuthor(member.getEffectiveName(), PATREON, member.getUser().getAvatarUrl());
embed.setAuthor(member.getEffectiveName(), "https://duncte.bot/", member.getUser().getAvatarUrl());

embed.setTitle("**Input:** " + parseString(result.getQuery().getInput()),
parseString(result.getQuery().toWebsiteURL()));
Expand Down Expand Up @@ -119,48 +115,50 @@ private MessageEmbed generateEmbed(CommandContext ctx, WAQueryResult result, Var

@Override
public void execute(@Nonnull CommandContext ctx) {
if (!isUserOrGuildPatron(ctx)) {
return;
}

final WAEngine engine = getWolframEngine(ctx.getConfig().apis.wolframalpha);

if (engine == null) {
MessageUtils.sendMsg(ctx, ":x: Wolfram|Alpha function unavailable!");
return;
}

final AtomicReference<Message> message = new AtomicReference<>();

MessageUtils.sendMsg(MessageConfig.Builder.fromCtx(ctx)
.setMessage("Calculating.....")
.setSuccessAction(message::set)
.build());

final String queryString = ctx.getArgsRaw();
final WAQuery query = engine.createQuery(queryString);
final WAQueryResult result;

try {
result = engine.performQuery(query);
}
catch (WAException e) {
editMsg(message, ctx.getChannel(), new MessageEditBuilder()
.setContent(
":x: Error: " +
e.getClass().getSimpleName() +
": " +
e.getMessage()
)
.build());
e.printStackTrace();
return;
}

editMsg(message, ctx.getChannel(), new MessageEditBuilder().setContent("Result:")
.setEmbeds(
generateEmbed(ctx, result, ctx.getVariables())
).build());
MessageUtils.sendMsg(ctx, "This command is scheduled for removal");

// if (!isUserOrGuildPatron(ctx)) {
// return;
// }
//
// final WAEngine engine = getWolframEngine(ctx.getConfig().apis.wolframalpha);
//
// if (engine == null) {
// MessageUtils.sendMsg(ctx, ":x: Wolfram|Alpha function unavailable!");
// return;
// }
//
// final AtomicReference<Message> message = new AtomicReference<>();
//
// MessageUtils.sendMsg(MessageConfig.Builder.fromCtx(ctx)
// .setMessage("Calculating.....")
// .setSuccessAction(message::set)
// .build());
//
// final String queryString = ctx.getArgsRaw();
// final WAQuery query = engine.createQuery(queryString);
// final WAQueryResult result;
//
// try {
// result = engine.performQuery(query);
// }
// catch (WAException e) {
// editMsg(message, ctx.getChannel(), new MessageEditBuilder()
// .setContent(
// ":x: Error: " +
// e.getClass().getSimpleName() +
// ": " +
// e.getMessage()
// )
// .build());
// e.printStackTrace();
// return;
// }
//
// editMsg(message, ctx.getChannel(), new MessageEditBuilder().setContent("Result:")
// .setEmbeds(
// generateEmbed(ctx, result, ctx.getVariables())
// ).build());
}

private void editMsg(AtomicReference<Message> ref, MessageChannelUnion channel, MessageEditData message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

import static me.duncte123.botcommons.messaging.MessageUtils.sendEmbed;
import static me.duncte123.botcommons.messaging.MessageUtils.sendMsg;
import static me.duncte123.skybot.Settings.PATREON;

public class LoveCommand extends Command {
// private static final String EMPTY_BAR = " ";
Expand Down Expand Up @@ -89,7 +88,7 @@ public void execute(@Nonnull CommandContext ctx) {
// final int intScore = response.get("score_int").asInt() / 10;

final EmbedBuilder embed = EmbedUtils.getDefaultEmbed()
.setTitle(response.get("names").asText(), PATREON)
.setTitle(response.get("names").asText())
.setColor(EmbedUtils.getColorOrDefault(ctx.getGuild().getIdLong()))
// The idea is cool, but it looks stupid
/*.setDescription(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

import static me.duncte123.botcommons.messaging.MessageUtils.sendErrorWithMessage;
import static me.duncte123.botcommons.messaging.MessageUtils.sendMsg;
import static me.duncte123.skybot.Settings.PATREON;
import static me.duncte123.skybot.utils.CommandUtils.isDev;
import static me.duncte123.skybot.utils.CommandUtils.parseJagTag;

Expand Down Expand Up @@ -269,8 +268,7 @@ private void removeTag(CommandContext ctx, String tagName) {

private void createTag(CommandContext ctx) {
if (!isTagPatron(ctx.getMember())) {
sendMsg(ctx, "Unfortunately only our tag tier patrons are able to create tags.\n" +
"You can become one for $5/month over at <" + PATREON + '>');
sendMsg(ctx, "Sorry, this is no longer possible");

return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public AchievementCommand() {
@Override
public void execute(@Nonnull CommandContext ctx) {

if (!passes(ctx, false)) {
if (!passes(ctx)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public CaptchaCommand() {

@Override
public void execute(@Nonnull CommandContext ctx) {
if (!passes(ctx, false)) {
if (!passes(ctx)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public DidYouMeanCommand() {

@Override
public void execute(@Nonnull CommandContext ctx) {
if (!passes(ctx, false)) {
if (!passes(ctx)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public FactsCommand() {

@Override
public void execute(@Nonnull CommandContext ctx) {
if (!passes(ctx, false)) {
if (!passes(ctx)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import java.util.List;

import static me.duncte123.botcommons.messaging.MessageUtils.sendMsg;
import static me.duncte123.skybot.utils.CommandUtils.isUserOrGuildPatron;

public abstract class ImageCommandBase extends Command {

Expand All @@ -62,13 +61,8 @@ private boolean canSendFile(CommandContext ctx) {
}
}

@SuppressWarnings("BooleanMethodIsAlwaysInverted")
/* package */ boolean passes(CommandContext ctx) {
return passes(ctx, true);
}

protected boolean passes(CommandContext ctx, boolean patron) {
return canSendFile(ctx) && (!patron || isUserOrGuildPatron(ctx));
protected boolean passes(CommandContext ctx) {
return canSendFile(ctx);
}

private String getFileName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public JokeoverheadCommand() {

@Override
public void execute(@Nonnull CommandContext ctx) {
if (!passes(ctx, false)) {
if (!passes(ctx)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public SaltyCommand() {

@Override
public void execute(@Nonnull CommandContext ctx) {
if (!passes(ctx, false)) {
if (!passes(ctx)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public ShitCommand() {

@Override
public void execute(@Nonnull CommandContext ctx) {
if (!passes(ctx, false)) {
if (!passes(ctx)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public DrakeCommand() {

@Override
public void execute(@Nonnull CommandContext ctx) {
if (!passes(ctx, false)) {
if (!passes(ctx)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public IWantToDieCommand() {

@Override
public void execute(@Nonnull CommandContext ctx) {
if (!passes(ctx, false)) {
if (!passes(ctx)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public ItsFreeRealEstateCommand() {

@Override
public void execute(@Nonnull CommandContext ctx) {
if (!passes(ctx, false)) {
if (!passes(ctx)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public abstract class FilterBase extends NoPatronImageCommand {

@Override
public void execute(@Nonnull CommandContext ctx) {
if (!passes(ctx, false)) {
if (!passes(ctx)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public FlagCommand() {

@Override
public void execute(@Nonnull CommandContext ctx) {
if (!passes(ctx, false)) {
if (!passes(ctx)) {
return;
}

Expand Down
Loading

0 comments on commit 07ffb14

Please sign in to comment.