mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-27 16:24:23 +00:00
20 lines
370 B
Elixir
20 lines
370 B
Elixir
defmodule Mix.Tasks.RmUser do
|
|
use Mix.Task
|
|
alias Pleroma.User
|
|
|
|
@moduledoc """
|
|
Permanently deletes a user
|
|
|
|
Usage: ``mix rm_user [nickname]``
|
|
|
|
Example: ``mix rm_user lain``
|
|
"""
|
|
def run([nickname]) do
|
|
Mix.Task.run("app.start")
|
|
|
|
with %User{local: true} = user <- User.get_by_nickname(nickname) do
|
|
{:ok, _} = User.delete(user)
|
|
end
|
|
end
|
|
end
|