Skip to content

Commit

Permalink
Removed TelegramContext parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
natanimn committed Jun 29, 2024
1 parent a35ff2d commit 818a008
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/et/telebof/filters/Filter.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package et.telebof.filters;

import et.telebof.Util;
import et.telebof.TelegramContext;
import et.telebof.types.Update;
import et.telebof.states.StateMemoryStorage;
import et.telebof.types.Message;
Expand Down Expand Up @@ -60,11 +59,10 @@ public class Filter{
public final boolean BOT;
public final boolean POLL;
public final boolean ZERO_INLINE_QUERY;
public final TelegramContext context;
private final StateMemoryStorage storage;
public Filter(Update update, TelegramContext context, StateMemoryStorage storage){

public Filter(Update update, StateMemoryStorage storage){
this.update = update;
this.context = context;
this.storage = storage;
this.TEXT = update.message !=null && update.message.text != null;
this.PRIVATE = chatType("private");
Expand Down Expand Up @@ -118,6 +116,7 @@ public Filter(Update update, TelegramContext context, StateMemoryStorage storage
}

public boolean commands(String... commands){
if (update.message == null) return false;
String command = Util.extractCommand(update.message.text);
if (command == null) return false;
return List.of(commands).contains(command);
Expand Down

0 comments on commit 818a008

Please sign in to comment.