mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-24 10:07:24 +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
|