diff --git a/Main.tscn b/Main.tscn index 69e33f9..227d678 100644 --- a/Main.tscn +++ b/Main.tscn @@ -1,8 +1,6 @@ -[gd_scene load_steps=4 format=3 uid="uid://cd60nfxe4lnq1"] +[gd_scene load_steps=2 format=3 uid="uid://cd60nfxe4lnq1"] [ext_resource type="Script" uid="uid://cus8nh0g3yyj2" path="res://main.gd" id="1_glv2v"] -[ext_resource type="PackedScene" uid="uid://i3rqbgerpgey" path="res://checker/Checker.tscn" id="2_r0du0"] -[ext_resource type="Script" uid="uid://8yiff3da5cxh" path="res://checker/checker.gd" id="3_cm0pq"] [node name="Main" type="Control"] layout_mode = 3 @@ -12,8 +10,3 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_glv2v") - -[node name="Checker" parent="." instance=ExtResource("2_r0du0")] -script = ExtResource("3_cm0pq") - -[connection signal="message_created" from="." to="Checker" method="_on_main_message_created"] diff --git a/TODO.md b/TODO.md index 9b1ee5d..384b6a7 100644 --- a/TODO.md +++ b/TODO.md @@ -27,16 +27,5 @@ - [x] spool list - [x] spool delete search result (removed embed) -## scam message checker -- [ ] need to modify the command to allow for arguments for how long the timeout should last for -- [ ] bunch of detecting if its a scam message or not -- [ ] update server version -- [ ] message counting -- [ ] immunity detection -- [ ] immunity give command -- [ ] move Pounce (this functionality) to its own independant bot - -- [ ] membership verification for fabsoc - ### Possible furture development - job management diff --git a/addons/discord_gd/discord.gd b/addons/discord_gd/discord.gd index 9c67036..a529119 100644 --- a/addons/discord_gd/discord.gd +++ b/addons/discord_gd/discord.gd @@ -272,13 +272,6 @@ func unban_member(guild_id: String, user_id: String): var res = await _send_request('/guilds/%s/bans/%s' % [guild_id, user_id], {}, HTTPClient.METHOD_DELETE) return res -func timeout_member(guild_id: String, user_id: String, until : String): - var res = await _send_request('/guilds/%s/members/%s' % [guild_id, user_id], {'communication_disabled_until' = '2025-12-5T09:49:58.965896+00:00'}, HTTPClient.METHOD_PATCH) - return res - -func delete_message(channel_id : String, message_id : String): - var res = await _send_request('/channels/%s/messages/%s' % [channel_id, message_id], {}, HTTPClient.METHOD_DELETE) - return res func permissions_for(user_id: String, channel_id: String): # Permissions for a user in a channel diff --git a/checker/Checker.tscn b/checker/Checker.tscn deleted file mode 100644 index 25a9885..0000000 --- a/checker/Checker.tscn +++ /dev/null @@ -1,3 +0,0 @@ -[gd_scene format=3 uid="uid://i3rqbgerpgey"] - -[node name="Checker" type="Node"] diff --git a/checker/checker.gd b/checker/checker.gd deleted file mode 100644 index 116c7a5..0000000 --- a/checker/checker.gd +++ /dev/null @@ -1,52 +0,0 @@ -extends Node - - -var reports_channel_id = "1433027391407788152" # channel to send admin report to - -# Called when the node enters the scene tree for the first time. -func _ready() -> void: - pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta: float) -> void: - pass - - -func _on_main_message_created(bot: DiscordBot, message: Message, channel: Dictionary) -> void: - if message.author.bot: - return - - ## analyse every message to detect if it is a scam message or not - # text = message.content - # images = message.attachments - its an array, so count the attachments - # server join date = message.member["joined_at"] - # could also keep track of how many messages the user has sent on the server and be more sensitive if its the first 5/10/20 or so - # message.author.id , message.author.username - # for any matches we find, we want to senda copy to the admin channel then delete the original copy and timeout the user - # add a check to make sure its not my own message - # Delete Message - /channels/{channel.id}/messages/{message.id} - # trust members after being around for 1 week + sending 20 messages? - - - #print(message) - print(message.guild_id) - if message.author.id == "616872480371376128": - # its fuzzy, lets try and time them out - - print(message) - var attachment_string : String = "\n" - if message.attachments.size()>0: - for attach in message.attachments: - attachment_string += attach.url + ", " - bot.send(message, "Sorry <@" + message.author.id + "> your message was flagged as a suspected scam message, a mod will check it as soon as possible") - bot.send(reports_channel_id, { - "content" : "Message from <@" + message.author.id + "> detected as a scam message:\n" + message.content + attachment_string, - #"attachments" : message.attachments, - }) - var until = "2025-12-05T00:00:00Z" - bot.timeout_member(message.guild_id, message.author.id, until) - bot.delete_message(message.channel_id, message.id) - - - pass # Replace with function body. diff --git a/checker/checker.gd.uid b/checker/checker.gd.uid deleted file mode 100644 index 02a82f5..0000000 --- a/checker/checker.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://8yiff3da5cxh diff --git a/main.gd b/main.gd index 953172f..4cceacf 100644 --- a/main.gd +++ b/main.gd @@ -6,7 +6,6 @@ signal interaction_create(world, bot, interaction, data) var interactions = {} var application_commands = {} -signal message_created(bot: DiscordBot, message: Message, channel: Dictionary) func _load_bot_token() -> String: # read from .env file DISORD_BOT_TOKEN @@ -31,7 +30,7 @@ func _ready() -> void: bot.TOKEN = token #bot.INTENTS = 4609 bot.bot_ready.connect(_on_bot_ready) - bot.message_create.connect(_on_message_create) + #bot.message_create.connect(_on_message_create) bot.interaction_create.connect(_on_interaction_create) bot.INTENTS = bot.INTENTS | (1 << 12) bot.login() @@ -57,17 +56,14 @@ func _on_bot_ready(bot: DiscordBot): # -----Single server (updates instantly) #_register_application_commands(bot, "guild_id_here") - _register_application_commands(bot, "679917161195765822") # personal server + #_register_application_commands(bot, "679917161195765822") # personal server #_register_application_commands(bot, "1038007666032787476") # fabsoc # -----Global (may take upto 1hr to update) - #_register_application_commands(bot) # everywhere + _register_application_commands(bot) # everywhere -func _on_message_create(bot: DiscordBot, message: Message, channel: Dictionary) -> void: - #print("meow!") - message_created.emit(bot, message, channel) - +#func _on_message_create(bot: DiscordBot, message: Message, channel: Dictionary) -> void: #if message.author.bot or not message.content.begins_with(prefix): #return #